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;
bool ispr(long long a) {
  for (long long i = 2;; i++) {
    if (i * i > a) return true;
    if (a % i == 0) return false;
  }
}
long long gcd(long long a, long long b) {
  for (;;) {
    if (a < b) swap(a, b);
    a %= b;
    if (a == 0) return b;
  }
}
int main() {
  int query;
  scanf("%d", &query);
  for (int p = 0; p < query; p++) {
    long long a;
    scanf("%I64d", &a);
    if (a == 2) {
      printf("1/6\n");
      continue;
    }
    long long lb, ub;
    for (long long t = a;; t--) {
      if (ispr(t)) {
        lb = t;
        break;
      }
    }
    for (long long t = a + 1;; t++) {
      if (ispr(t)) {
        ub = t;
        break;
      }
    }
    long long x = 2 * lb * ub;
    long long y = lb * ub + 2LL * (a - lb + 1 - ub);
    long long g = gcd(x, y);
    printf("%I64d/%I64d\n", y / g, x / g);
  }
}
