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;
long long n, p;
bool mark[40001];
vector<long long> pr;
long long gcd(long long x, long long y) {
  if (!y) return x;
  return gcd(y, x % y);
}
bool isprime(long long x) {
  for (long long i = 0; i < p && pr[i] * pr[i] <= x; i++)
    if (x % pr[i] == 0) return false;
  return true;
}
int main() {
  for (long long i = 2; i < 40001; i++)
    if (!mark[i]) {
      p++;
      pr.push_back(i);
      for (long long j = i; j < 40001; j += i) mark[j] = true;
    }
  scanf("%I64d", &n);
  for (long long i = 0, x; i < n; i++) {
    long long u, v;
    scanf("%I64d", &x);
    for (long long i = x + 1; 1; i++)
      if (isprime(i)) {
        u = i;
        break;
      }
    for (long long i = x; 1; i--)
      if (isprime(i)) {
        v = i;
        break;
      }
    if (u == x + 1)
      printf("%I64d/%I64d\n", u - 2, 2 * u);
    else {
      long long a = v - 2;
      long long b = 2 * v;
      long long c = x - v + 1;
      long long d = u * v;
      long long lcm = b / gcd(b, d) * d;
      a *= lcm / b;
      c *= lcm / d;
      long long sum = a + c;
      long long g = gcd(sum, lcm);
      printf("%I64d/%I64d\n", sum / g, lcm / g);
    }
  }
  return 0;
}
