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 gcd(long long x, long long y) {
  if (y == 0)
    return x;
  else
    return gcd(y, x % y);
}
struct node {
  long long a, b;
  friend node operator+(node x, node y) {
    node tp;
    tp.b = x.b * y.b;
    tp.a = x.a * y.b + x.b * y.a;
    long long gc = gcd(tp.a, tp.b);
    tp.a /= gc;
    tp.b /= gc;
    return tp;
  }
};
bool check(long long k) {
  for (long long i = 2; i * i <= k; i++) {
    if (k % i == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    long long n;
    scanf("%I64d", &n);
    long long maxp, minp;
    for (long long i = n + 1;; i++) {
      if (check(i)) {
        maxp = i;
        break;
      }
    }
    for (long long i = n;; i--) {
      if (check(i)) {
        minp = i;
        break;
      }
    }
    node ans;
    ans.a = 1;
    ans.b = 2;
    node tp;
    tp.a = -1;
    tp.b = minp;
    ans = (ans + tp);
    tp.a = (n - minp + 1);
    tp.b = (minp * maxp);
    ans = (ans + tp);
    ans.b = 2 * minp * maxp;
    ans.a = minp * maxp + 2 * (n - minp - maxp + 1);
    long long gcdd = gcd(ans.a, ans.b);
    ans.a /= gcdd;
    ans.b /= gcdd;
    printf("%I64d/%I64d\n", ans.a, ans.b);
  }
}
