Let's assume that 

  * v(n) is the largest prime number, that does not exceed n;
  * u(n) is the smallest prime number strictly greater than n. 



Find <image>.

Input

The first line contains integer t (1 ≤ t ≤ 500) — the number of testscases. 

Each of the following t lines of the input contains integer n (2 ≤ n ≤ 109).

Output

Print t lines: the i-th of them must contain the answer to the i-th test as an irreducible fraction "p/q", where p, q are integers, q > 0.

Examples

Input

2
2
3


Output

1/6
7/30
#include <bits/stdc++.h>
using namespace std;
int pir[101000], p[100010];
int prime(int n) {
  int k = 0;
  for (int i = 0; i < n; i++) p[i] = 1;
  p[0] = p[1] = 0;
  for (int i = 2; i < n; i++) {
    if (p[i]) pir[k++] = i;
    for (int j = 0; j < k && i * pir[j] < n; j++) {
      p[i * pir[j]] = 0;
      if (i % pir[j] == 0) break;
    }
  }
  return k;
}
int k;
bool init(int n) {
  for (int i = 0; i < k && pir[i] * pir[i] <= n; i++)
    if (n % pir[i] == 0) return false;
  return true;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  k = prime(100010);
  int T;
  scanf("%d", &T);
  while (T--) {
    int n;
    scanf("%d", &n);
    long long a = n;
    while (!init(a)) a--;
    long long b = n + 1;
    while (!init(b)) b++;
    long long x = a * b - 2 * a - 2 * b + 2LL * n + 2;
    long long y = 2 * a * b;
    long long d = gcd(x, y);
    x /= d;
    y /= d;
    printf("%I64d/%I64d\n", x, y);
  }
  return 0;
}
