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 double INF = 1e99;
const double EPS = 1e-9;
const int Mo = 1e9 + 7;
int i, j, k, l, m, n, cnt, T, ii;
int prime[100010];
bool flag[100010];
long long p, q, u, v;
bool isPrime(int k) {
  if (k < 100010) return !flag[k];
  for (int i = 0; i < cnt && prime[i] <= k; i++)
    if (k % prime[i] == 0) return false;
  return true;
}
int gcd(long long p, long long q) {
  if (!q)
    return p;
  else
    return gcd(q, p % q);
}
int main() {
  cnt = 0;
  memset(flag, 0, sizeof(flag));
  for (int i = 2; i < 100010; i++)
    if (!flag[i]) {
      prime[cnt++] = i;
      for (int j = i * 2; j < 100010; j += i) flag[j] = 1;
    }
  cin >> T;
  for (ii = 1; ii <= T; ii++) {
    cin >> l;
    u = l + 1;
    while (!isPrime(u)) u++;
    v = l;
    while (!isPrime(v)) v--;
    p = u * v + 2 * (l - v - u + 1);
    if (p < 0) p = -p;
    q = 2 * u * v;
    if (q < 0) q = -q;
    long long yue = gcd(p, q);
    if (yue < 0) yue = -yue;
    cout << p / yue << "/" << q / yue << endl;
  }
}
