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);
}
bool ok(int x) {
  int m = sqrt(x);
  for (int i = 2; i <= m; i++) {
    if (x % i == 0) 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 (ok(i)) {
        b = i;
        break;
      }
    }
    for (int i = n;; i--) {
      if (ok(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);
  }
}
