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 ms = int(1.5e4) + 100;
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  if (b == 0) return a;
  a %= b;
  return gcd(b, a);
}
struct frac {
  long long p, q;
  void norm() {
    long long g = gcd(p, q);
    p /= g;
    q /= g;
  }
  frac operator+(frac b) {
    frac ret;
    long long g = gcd(q, b.q);
    ret.p = p * (b.q / g) + b.p * (q / g);
    ret.q = q / g * b.q;
    ret.norm();
    return ret;
  }
  void print() { cout << p << "/" << q << endl; }
};
unsigned long long fmul(unsigned long long a, unsigned long long b,
                        unsigned long long m) {
  unsigned long long q = (long double)a * (long double)b / (long double)m;
  unsigned long long r = a * b - q * m;
  return (r + m) % m;
}
unsigned long long fexp(unsigned long long a, unsigned long long b,
                        unsigned long long m) {
  unsigned long long ans = 1;
  while (b) {
    if (b & 1) ans = fmul(ans, a, m);
    a = fmul(a, a, m);
    b >>= 1;
  }
  return ans;
}
bool miller(unsigned long long p, unsigned long long a) {
  unsigned long long s = p - 1;
  while (s % 2 == 0) s >>= 1;
  while (a >= p) a >>= 1;
  unsigned long long mod = fexp(a, s, p);
  while (s != p - 1 && mod != 1 && mod != p - 1) {
    mod = fmul(mod, mod, p);
    s <<= 1;
  }
  if (mod != p - 1 && s % 2 == 0)
    return false;
  else
    return true;
}
vector<unsigned long long> primes;
bool prime(unsigned long long p, int m = 1) {
  if (p <= 3) return true;
  if (p % 2 == 0) return false;
  if (m == 0) {
    for (long long i = 2; i * i <= p; i++)
      if (p % i == 0) return 0;
    return 1;
  } else if (m == 1) {
    for (auto x : primes) {
      if (x * x > p) break;
      if (p % x == 0) return 0;
    }
    return 1;
  }
  return miller(p, 2) && miller(p, 3) && miller(p, 5) && miller(p, 7) &&
         miller(p, 11);
}
int main() {
  frac sum;
  int n;
  cin >> n;
  int lp = 0, md = 0;
  for (int i = 2; i < 1e5; i++)
    if (prime(i, 2)) primes.push_back(i);
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    unsigned long long L = a, R = a + 1;
    while (!prime(L)) L--;
    while (!prime(R)) R++;
    frac aux;
    aux.p = 1;
    aux.q = L * R;
    sum.p = L - 2;
    sum.q = 2 * L;
    for (int i = L; i < a + 1; i++) {
      sum = sum + aux;
    }
    sum.print();
  }
}
