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;
long long power_mod(long long a, long long m, long long n) {
  long long tmp = 1;
  a %= n;
  while (m != 0) {
    if (m & 1) tmp = ((tmp * a) % n);
    a = ((a * a) % n);
    m >>= 1;
  }
  return tmp;
}
long long base[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47};
bool miller_rabin(long long n) {
  if (n < 2) return false;
  if (n == 2) return true;
  if (!(n & 1)) return false;
  long long k = 0, i, j, m, a;
  m = n - 1;
  while (!(m & 1)) m >>= 1, k++;
  for (i = 0; i < 10; i++) {
    if (base[i] >= n) return true;
    a = power_mod(base[i], m, n);
    if (a == 1) continue;
    for (j = 0; j < k; j++) {
      if (a == n - 1) break;
      a = ((a * a) % n);
    }
    if (j == k) return false;
  }
  return true;
}
long long get_small(int x) {
  for (long long i = x; i >= 2; i--)
    if (miller_rabin(i)) return i;
}
long long get_large(int x) {
  for (long long i = x + 1;; i++)
    if (miller_rabin(i)) return i;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  int cas, n;
  scanf("%d", &cas);
  while (cas--) {
    scanf("%d", &n);
    long long p = get_small(n);
    long long q = get_large(n);
    long long up = p * q - 2 * p - 2 * (q - n - 1);
    long long down = 2 * p * q;
    long long g = gcd(up, down);
    printf("%I64d/%I64d\n", up / g, down / g);
  }
  return 0;
}
