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;
const int MOD = 1e9 + 7;
const auto INF = 0x3f3f3f3f;
const int N = 1e6 + 5;
int prime[N];
vector<int> isprime;
void getprime() {
  for (int i = 2; i <= N - 5; i++) {
    if (!prime[i]) {
      isprime.push_back(i);
      for (int j = 2 * i; j <= N - 5; j += i) {
        prime[j] = true;
      }
    }
  }
}
long long GCD(long long a, long long b) {
  if (!b) return a;
  return GCD(b, a % b);
}
const int S = 20;
long long mult_mod(long long a, long long b, long long c) {
  a %= c;
  b %= c;
  long long ret = 0;
  while (b) {
    if (b & 1) {
      ret += a;
      ret %= c;
    }
    a <<= 1;
    if (a >= c) a %= c;
    b >>= 1;
  }
  return ret;
}
long long pow_mod(long long x, long long n, long long mod) {
  if (n == 1) return x % mod;
  x %= mod;
  long long tmp = x;
  long long ret = 1;
  while (n) {
    if (n & 1) ret = mult_mod(ret, tmp, mod);
    tmp = mult_mod(tmp, tmp, mod);
    n >>= 1;
  }
  return ret;
}
bool check(long long a, long long n, long long x, long long t) {
  long long ret = pow_mod(a, x, n);
  long long last = ret;
  for (int i = 1; i <= t; i++) {
    ret = mult_mod(ret, ret, n);
    if (ret == 1 && last != 1 && last != n - 1) return true;
    last = ret;
  }
  if (ret != 1) return true;
  return false;
}
bool Miller_Rabin(long long n) {
  if (n < 2) return false;
  if (n == 2) return true;
  if ((n & 1) == 0) return false;
  long long x = n - 1;
  long long t = 0;
  while ((x & 1) == 0) {
    x >>= 1;
    t++;
  }
  for (int i = 0; i < S; i++) {
    long long a = rand() % (n - 1) + 1;
    if (check(a, n, x, t)) return false;
  }
  return true;
}
int main() {
  getprime();
  int T;
  scanf("%d", &T);
  while (T--) {
    int n;
    scanf("%d", &n);
    long long ans1, ans2, a, b;
    for (int i = n + 1;; i++) {
      if (Miller_Rabin(i)) {
        b = i;
        break;
      }
    }
    for (int i = n;; i--) {
      if (Miller_Rabin(i)) {
        a = i;
        break;
      }
    }
    long long temp = a * b;
    a = a + (b - n - 1);
    b = temp;
    ans1 = b - 2 * a;
    ans2 = 2 * b;
    long long gcd = GCD(ans1, ans2);
    ans1 /= gcd;
    ans2 /= gcd;
    printf("%lld/%lld\n", ans1, ans2);
  }
}
