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;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%lld", &n);
    long long l, r;
    bool flag = true;
    for (int i = 2; i * i <= n; i++) {
      if (n % i == 0) {
        flag = false;
        break;
      }
    }
    if (flag) {
      r = n + 1;
      while (r) {
        int f1 = 1;
        for (int i = 2; i * i <= r; i++) {
          if (r % i == 0) {
            f1 = 0;
            break;
          }
        }
        if (f1) {
          break;
        }
        r++;
      }
      long long cc = 2 * n * r;
      long long xx = n * r - 2 * (r - 1);
      long long g = gcd(xx, cc);
      printf("%lld/%lld\n", xx / g, cc / g);
    } else {
      l = n - 1;
      while (l) {
        int f2 = 1;
        for (int i = 2; i * i <= l; i++) {
          if (l % i == 0) {
            f2 = 0;
            break;
          }
        }
        if (f2) {
          break;
        }
        l--;
      }
      r = n + 1;
      while (r) {
        int f3 = 1;
        for (int i = 2; i * i <= r; i++) {
          if (r % i == 0) {
            f3 = 0;
            break;
          }
        }
        if (f3) {
          break;
        }
        r++;
      }
      long long c1 = 2 * l * r;
      long long x1 = l * r - 2 * (l + r - n - 1);
      long long gg = gcd(x1, c1);
      printf("%lld/%lld\n", x1 / gg, c1 / gg);
    }
  }
  return 0;
}
