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>
const int maxn = 1e5 + 10;
int prime[maxn];
int mark[maxn];
int cnt;
using namespace std;
long long gcd(long long a, long long b) {
  if (!b)
    return a;
  else
    return gcd(b, a % b);
}
void init() {
  cnt = 0;
  memset(mark, 1, sizeof(mark));
  for (int i = 2; i < maxn; i++) {
    if (mark[i]) {
      prime[cnt++] = i;
      for (int j = 2; i * j < maxn; j++) mark[i * j] = 0;
    }
  }
}
bool Isprime(long long x) {
  if (x < maxn) return mark[x];
  for (int i = 0; i < cnt && prime[i] <= x; i++) {
    if (x % prime[i] == 0) return false;
  }
  return true;
}
long long getv(long long x) {
  for (long long i = x; i >= 2; i--)
    if (Isprime(i)) return i;
}
long long getu(long long x) {
  for (long long i = x + 1; i; i++)
    if (Isprime(i)) return i;
}
int main() {
  int t;
  init();
  scanf("%d", &t);
  while (t--) {
    long long n;
    scanf("%lld", &n);
    if (Isprime(n + 1)) {
      long long x = n - 1;
      long long y = 2 * (n + 1);
      long long k = gcd(x, y);
      x /= k;
      y /= k;
      printf("%I64d/%I64d\n", x, y);
      continue;
    }
    long long v = getv(n);
    long long u = getu(n);
    long long sum_x, sum_y, k, ans_x, ans_y;
    sum_x = u * v - 2 * u + 2 * n - 2 * v + 2;
    sum_y = 2 * u * v;
    k = gcd(sum_x, sum_y);
    sum_x /= k;
    sum_y /= k;
    printf("%I64d/%I64d\n", sum_x, sum_y);
  }
  return 0;
}
