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;
vector<int> Primes;
bool sieve[100001 + 6];
void primeTable() {
  int i, j;
  Primes.clear();
  Primes.push_back(2);
  int lim = sqrt((double)100001) + 2;
  for (i = 4; i < 100001; i += 2) sieve[i] = true;
  for (i = 3; i < lim; i += 2) {
    if (!sieve[i]) {
      Primes.push_back(i);
      for (j = i * i; j <= 100001; j += (i << 1)) sieve[j] = true;
    }
  }
  for (; i < 100001; i += 2) {
    if (!sieve[i]) Primes.push_back(i);
  }
}
bool isprime(int N) {
  int n = N, p;
  int freq, i;
  for (i = 0; n != 1 && i < Primes.size(); ++i) {
    p = Primes[i];
    if (Primes[i] > sqrt((double)n) + 1) break;
    if (n % p == 0) return false;
  }
  return true;
}
int findlp(int n) {
  while (!isprime(n)) --n;
  return n;
}
int findgp(int n) {
  while (!isprime(++n))
    ;
  return n;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  primeTable();
  int T, N, lp, gp;
  long long num, den, g;
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &N);
    lp = findlp(N), gp = findgp(N);
    den = 2 * (long long)lp * gp;
    num = (long long)lp * gp - 2 * gp + 2 * (N - lp + 1);
    g = gcd(num, den);
    num /= g, den /= g;
    printf("%I64d/%I64d\n", num, den);
  }
  return 0;
}
