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>
long long int gcd(long long int a, long long int b) {
  long long int c;
  while (a != 0) {
    c = a;
    a = b % a;
    b = c;
  }
  return b;
}
long long int power(long long int a, long long int n, long long int mod) {
  long long int power = a;
  long long int result = 1;
  while (n) {
    if (n & 1) result = (result * power) % mod;
    power = (power * power) % mod;
    n >>= 1;
  }
  return result;
}
bool witness(long long int n, long long int s, long long int d,
             long long int a) {
  long long int x = power(a, d, n);
  long long int y;
  while (s) {
    y = (x * x) % n;
    if (y == 1 && x != 1 && x != n - 1) return false;
    x = y;
    --s;
  }
  if (y != 1) return false;
  return true;
}
bool is_prime_mr(long long int n) {
  if (((!(n & 1)) && n != 2) || (n < 2) || (n % 3 == 0 && n != 3)) return false;
  if (n <= 3) return true;
  long long int d = n / 2;
  long long int s = 1;
  while (!(d & 1)) {
    d /= 2;
    ++s;
  }
  if (n < 1373653) return witness(n, s, d, 2) && witness(n, s, d, 3);
  if (n < 9080191) return witness(n, s, d, 31) && witness(n, s, d, 73);
  if (n < 4759123141)
    return witness(n, s, d, 2) && witness(n, s, d, 7) && witness(n, s, d, 61);
  if (n < 1122004669633)
    return witness(n, s, d, 2) && witness(n, s, d, 13) &&
           witness(n, s, d, 23) && witness(n, s, d, 1662803);
  if (n < 2152302898747)
    return witness(n, s, d, 2) && witness(n, s, d, 3) && witness(n, s, d, 5) &&
           witness(n, s, d, 7) && witness(n, s, d, 11);
  if (n < 3474749660383)
    return witness(n, s, d, 2) && witness(n, s, d, 3) && witness(n, s, d, 5) &&
           witness(n, s, d, 7) && witness(n, s, d, 11) && witness(n, s, d, 13);
  return witness(n, s, d, 2) && witness(n, s, d, 3) && witness(n, s, d, 5) &&
         witness(n, s, d, 7) && witness(n, s, d, 11) && witness(n, s, d, 13) &&
         witness(n, s, d, 17);
}
using namespace std;
int main(int argc, char* argv[]) {
  long long int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    long long int m, p, q;
    cin >> m;
    for (p = m; !is_prime_mr(p); --p)
      ;
    for (q = m + 1; !is_prime_mr(q); ++q)
      ;
    long long int num = 2 * (m - p + 1) + p * q - 2 * q;
    long long int den = 2 * p * q;
    long long int g = gcd(num, den);
    cout << num / g << "/" << den / g << endl;
  }
  return 0;
}
