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>
inline long long mult(long long x, long long y, long long n) {
  long long tmp = x;
  tmp *= y;
  tmp %= n;
  return (long long)tmp;
}
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}
inline long long Abs(long long x) { return x < 0 ? -x : x; }
long long exp(long long a, long long n, long long p) {
  if (p == 0) return 1;
  long long x = exp(a, n, p >> 1);
  x = mult(x, x, n);
  if (p & 1) x = mult(x, a, n);
  return x;
}
inline bool withness(long long s, long long n) {
  long long t = n - 1;
  int cnt = 0;
  while (!(t & 1)) {
    cnt++;
    t /= 2;
  }
  long long x = exp(s, n, t);
  long long pre = x;
  for (int i = 0; i < cnt; i++) {
    x = mult(x, x, n);
    if (x == 1 && pre != 1 && pre != n - 1) return true;
    pre = x;
  }
  if (x != 1) return true;
  return false;
}
inline bool is_prime(long long n) {
  for (int i = 2; i < 44; i++) {
    int flag;
    long long tmp = i % n;
    if (i % n == 0) continue;
    flag = withness(tmp, n);
    if (flag) return false;
  }
  return true;
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    long long n;
    scanf("%lld", &n);
    if (n == 2) {
      printf("1/6\n");
      continue;
    }
    long long x = n, y = n;
    for (long long i = n; i >= n - 10000; i--) {
      if (is_prime(i)) {
        x = i;
        break;
      }
    }
    for (long long i = n + 1; i <= n + 10000; i++) {
      if (is_prime(i)) {
        y = i;
        break;
      }
    }
    if (n == y - 1) {
      printf("%lld/%lld\n", y - 2, 2 * y);
      continue;
    }
    long long p = (y - 2) * x - (y - 1 - n) * 2;
    long long q = 2 * x * y;
    long long tmp = gcd(p, q);
    printf("%lld/%lld\n", p / tmp, q / tmp);
  }
  return 0;
}
