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 N = 1e5 + 10;
int cnt, prime[N], flag[N];
void init() {
  cnt = 0;
  memset(flag, 0, sizeof(flag));
  for (int i = 2; i < N; i++)
    if (!flag[i]) {
      prime[cnt++] = i;
      for (int j = i * 2; j < N; j += i) flag[j] = 1;
    }
}
bool isPrime(int k) {
  if (k < N) return !flag[k];
  for (int i = 0; i < cnt && prime[i] <= k; i++)
    if (k % prime[i] == 0) return false;
  return true;
}
long long under(int n) {
  for (int i = n; i >= 2; i--)
    if (isPrime(i)) return i;
  return 0;
}
long long up(int n) {
  for (int i = n + 1; i; i++)
    if (isPrime(i)) return i;
  return 0;
}
int gcd(long long p, long long q) {
  if (!q)
    return p;
  else
    return gcd(q, p % q);
}
int main() {
  init();
  int cas, n;
  scanf("%d", &cas);
  while (cas--) {
    scanf("%d", &n);
    long long v = under(n);
    long long u = up(n);
    long long p = u * v + 2 * (n - v - u + 1);
    long long q = 2 * u * v;
    long long d = gcd(p, q);
    cout << p / d << "/" << q / d << endl;
  }
  return 0;
}
