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 MOD = 1e9 + 7;
const long long INF = 1e18;
const int MAXN = 1e6 + 5;
const int T = 1e3 + 1;
int i, j, m, n, k;
long long ans;
long long fact[MAXN];
int phi(int n) {
  int result = n;
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      while (n % i == 0) n /= i;
      result -= result / i;
    }
  }
  if (n > 1) {
    result -= result / n;
  }
  return result;
}
int gcdex(int a, int b, int &x, int &y) {
  if (a == 0) {
    x = 0, y = 1;
    return b;
  }
  int x1, y1;
  int d = gcdex(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
}
void initfact() {
  fact[0] = 1;
  for (int i = 1; i < MAXN; i++) {
    fact[i] = (fact[i - 1] * i);
    fact[i] %= MOD;
  }
}
long long binpow(long long val, long long deg) {
  if (!deg) return 1;
  if (deg & 1) return binpow(val, deg - 1) * val % MOD;
  long long res = binpow(val, deg >> 1);
  return (res * res) % MOD;
}
long long C(int n, int i) {
  long long res = fact[n];
  long long div = fact[n - i] * fact[i];
  div %= MOD;
  div = binpow(div, MOD - 2);
  return (res * div) % MOD;
}
long long inv(long long a, long long m) { return binpow(a, phi(m) - 1); }
bool isGood(long long s, int a, int b) {
  while (s > 0) {
    if (s % 10 == a || s % 10 == b) {
      s /= 10;
    } else
      return false;
  }
  return true;
}
typedef struct point {
  double x, y;
} point;
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
bool isPrime(int n) {
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int p, q;
    long long a, b, d;
    cin >> n;
    p = n, q = n + 1;
    while (!isPrime(p)) p--;
    while (!isPrime(q)) q++;
    a = 1ll * p * q - 2 * q + (n - p + 1) * 2;
    b = 2ll * p * q;
    d = gcd(a, b);
    a /= d, b /= d;
    cout << a << "/" << b << "\n";
  }
  return 0;
}
