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;
vector<long long> primos;
long long med;
long long PrimoMenor(long long n) {
  bool r = true;
  long long i = 0;
  while (r && i < med && primos[i] * primos[i] <= n) {
    if (n % primos[i] == 0)
      r = false;
    else
      i++;
  }
  if (r) return n;
  return PrimoMenor(n - 1);
}
long long PrimoMayor(long long n) {
  bool r = true;
  long long i = 0;
  while (r && i < med && primos[i] * primos[i] <= n) {
    if (n % primos[i] == 0)
      r = false;
    else
      i++;
  }
  if (r) return n;
  return PrimoMayor(n + 1);
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  long long limit = 32000;
  vector<bool> esPrimo(limit, 1);
  for (long long i = 2; i < limit; i++) {
    if (esPrimo[i]) {
      primos.push_back(i);
      for (long long j = i * 2; j < limit; j = j + i) esPrimo[j] = 0;
    }
  }
  med = primos.size();
  int t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long men = PrimoMenor(n);
    long long may = PrimoMayor(n + 1);
    long long p, q;
    if (n + 1 == may) {
      p = n - 1;
      q = 2 * (n + 1);
    } else {
      p = may * (men - 2) + 2 * (n - men + 1);
      q = 2 * men * may;
    }
    long long mcd = gcd(p, q);
    p = p / mcd;
    q = q / mcd;
    cout << p << "/" << q << endl;
  }
  return 0;
}
