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;
void debug() { cout << endl; }
template <class FIRST, class... REST>
void debug(FIRST arg, REST... rest) {
  cout << arg << " ";
  debug(rest...);
}
template <class T>
void showary(T begin, T end) {
  while (begin != end) {
    cout << *begin << " ";
    begin++;
  }
  cout << endl;
}
int T, N;
bool if_prime(long long a) {
  for (int i = 2; i * i <= a; i++) {
    if (a % i == 0) return false;
  }
  return true;
}
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &N);
    long long p = N, q = N + 1;
    while (!if_prime(p)) p--;
    while (!if_prime(q)) q++;
    long long c = p * q - 2 * q + 2 * (N - p + 1);
    long long d = 2 * p * q;
    long long v = gcd(c, d);
    cout << c / v << "/" << d / v << endl;
  }
}
