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 a, long long b) {
  return (a % b == 0) ? b : gcd(b, a % b);
}
bool Check(long long num) {
  long long sq = ceil(sqrt(1.0 * num));
  for (long long i = 2; i <= sq; i++) {
    if (num % i == 0) return false;
  }
  return true;
}
long long next(long long num) {
  long long i;
  long long strt = ((num + 1) % 2) ? num + 1 : num + 2;
  for (i = strt; !Check(i); i += 2)
    ;
  return i;
}
long long prev(long long num) {
  long long i;
  long long strt = ((num - 1) % 2) ? num - 1 : num - 2;
  for (i = strt; !Check(i); i -= 2)
    ;
  return i;
}
int main() {
  int t;
  long long up, down, n, m, p;
  scanf("%d", &t);
  while (t--) {
    scanf("%I64d", &n);
    if (n == 2) {
      printf("1/6\n");
      continue;
    }
    if (n == 3) {
      printf("7/30\n");
      continue;
    }
    if (Check(n)) {
      m = next(n);
      up = m * (n - 2) + 2;
      down = 2 * n * m;
    } else {
      m = prev(n);
      p = next(n);
      long long dif = (p - 1 - n);
      up = m * (p - 2) - 2 * dif;
      down = 2 * m * p;
    }
    long long g = gcd(up, down);
    up /= g;
    down /= g;
    printf("%I64d/%I64d\n", up, down);
  }
  return 0;
}
