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;
int sieve[100000];
vector<int> prime;
long long int gcd(long long int a, long long int b) {
  if (!a)
    return b;
  else
    return gcd(b % a, a);
}
int check(int n) {
  int i;
  for (i = 0; i < prime.size(); i++) {
    if (n == prime[i]) return 1;
    if (n < prime[i]) break;
    if (n % prime[i] == 0) return 0;
  }
  return 1;
}
void reduce(long long int a, long long int b) {
  long long int div = gcd(a, b);
  printf("%lld/%lld\n", a / div, b / div);
}
int main() {
  int t, i, j, n, k, x, y;
  long long int a, b;
  string s;
  for (i = 2; i < 100000; i++) {
    for (j = 2 * i; j < 100000; j = j + i) {
      sieve[j] = 1;
    }
  }
  for (i = 2; i < 100000; i++) {
    if (!sieve[i]) prime.push_back(i);
  }
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    if (n == 2) {
      cout << "1/6\n";
      continue;
    }
    if (n % 2 == 0) {
      x = n - 1;
      y = n + 1;
    } else {
      x = n;
      y = n + 2;
    }
    while (!check(x)) x = x - 2;
    while (!check(y)) y = y + 2;
    a = (long long)x * y - 2 * y + 2 * n - 2 * x + 2;
    b = x * (long long)2 * y;
    reduce(a, b);
  }
  printf("");
  return 0;
}
