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 isp(int u) {
  for (int j = 2; j * j <= u; j++) {
    if (u % j == 0) return false;
  }
  return true;
}
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    long long num, pos, pos2;
    cin >> num;
    if (num == 2) {
      cout << "1/6\n";
      continue;
    }
    long long N = 0, D = 1;
    for (int i = num;; i--)
      if (isp(i)) {
        pos = i;
        break;
      }
    for (int i = pos + 1;; i++)
      if (isp(i)) {
        pos2 = i;
        break;
      }
    N = (pos - 2) * pos2 + 2 * (num - pos + 1);
    D = 2 * pos * pos2;
    long long G = gcd(N, D);
    N /= G;
    D /= G;
    cout << N << "/" << D << endl;
  }
  return 0;
}
