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 T;
long long n, L, R, fz, fm, g;
long long gcd(long long a, long long b) { return a ? gcd(b % a, a) : b; }
inline long long pow(long long x, long long y, long long p) {
  long long z = 1;
  for (; y; y >>= 1, x = x * x % p)
    if (y & 1) z = z * x % p;
  return z;
}
inline bool prime(long long x) {
  return x == 2 || x == 7 || x == 61 ||
         pow(2, x - 1, x) == 1 && pow(7, x - 1, x) == 1 &&
             pow(61, x - 1, x) == 1;
}
int main() {
  for (scanf("%d", &T); T--;) {
    scanf("%I64d", &n);
    for (R = n + 1; !prime(R); ++R)
      ;
    for (L = n; !prime(L); --L)
      ;
    fz = (L - 2) * R + (n - L + 1) * 2;
    fm = L * R * 2;
    g = gcd(fz, fm);
    printf("%I64d/%I64d\n", fz / g, fm / g);
  }
}
