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 = 4e4;
bool visited[N];
vector<int> primes;
void sieve() {
  for (int i = 2; i < N; i++) {
    if (visited[i]) continue;
    primes.push_back(i);
    for (int j = i + i; j < N; j += i) visited[j] = true;
  }
}
bool test(int n) {
  for (int i = 0; i < primes.size(); i++) {
    if (n != primes[i] && n % primes[i] == 0) return false;
  }
  return true;
}
int lower(int n) {
  for (int i = n; i >= 2; i--) {
    if (test(i)) return i;
  }
}
int upper(int n) {
  for (int i = n + 1;; i++) {
    if (test(i)) return i;
  }
}
long long gcd(long long a, long long b) {
  if (b > a) {
    long long t = b;
    b = a;
    a = t;
  }
  long long r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
int main() {
  sieve();
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long long p1 = lower(n), p2 = upper(n);
    long long num = p1 * p2 - 2 * (p1 + p2) + 2 * n + 2;
    long long den = 2 * p1 * p2;
    long long hcf = gcd(num, den);
    cout << num / hcf << "/" << den / hcf << endl;
  }
  return 0;
}
