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>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
long long int power(long long int x, long long int n) {
  long long int result = 1;
  while (n) {
    if (n % 2 == 1) result = result * x;
    n = n / 2;
    x = x * x;
  }
  return result;
}
long long int gcd(long long int a, long long int b) {
  if (!b) return a;
  return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
long long int BS(long long int a[], long long int s, long long int n,
                 long long int val) {
  long long int mid, beg = s, end = n - 1;
  while (beg <= end) {
    mid = (beg + end) / 2;
    if (val == a[mid]) {
      break;
    } else if (val > a[mid]) {
      beg = mid + 1;
    } else {
      end = mid - 1;
    }
  }
  return mid;
}
inline long long int mul(long long int x, long long int y, long long int m) {
  long long int z = 1LL * x * y;
  if (z >= m) {
    z %= m;
  }
  return z;
}
long long int powmod(long long int x, long long int y, long long int m) {
  long long int r = 1;
  while (y) {
    if (y & 1) {
      r = mul(r, x, m);
    }
    y >>= 1;
    x = mul(x, x, m);
  }
  return r;
}
using namespace std;
void start() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
}
long long int check(long long int n) {
  for (long long int i = 2; i * i <= n; i++) {
    if (n % i == 0) return 0;
  }
  return 1;
}
long long int solve1(long long int n) {
  for (long long int i = n; i >= 2; i--) {
    if (check(i)) return i;
  }
}
long long int solve2(long long int n) {
  long long int x = n + 1;
  while (1) {
    if (check(x)) return x;
    x++;
  }
}
int main() {
  start();
  long long int t;
  cin >> (t);
  while (t--) {
    long long int n;
    cin >> n;
    long long int x1 = solve1(n);
    long long int x2 = solve2(n);
    if (n == 2) {
      cout << "1/6\n";
      continue;
    }
    if (n == 3) {
      cout << "7/30\n";
      continue;
    }
    if (n == 4) {
      cout << "3/10\n";
      continue;
    }
    long long int d = 2 * x1 * x2;
    long long int n1 = (x1 - 2) * x2 + 2 + 2 * (n - x1);
    long long int g = gcd(n1, d);
    d /= g;
    n1 /= g;
    cout << n1 << "/" << d << "\n";
  }
  return 0;
}
