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> genPrimes() {
  std::vector<long long> primes;
  primes.push_back(2);
  for (long long i = 3; i <= 32000; i++) {
    bool isPrime = true;
    long long cap = sqrt(i) + 1;
    for (auto prNum = primes.begin(); prNum != primes.end(); prNum++) {
      if (*prNum > cap) {
        break;
      }
      if (i % *prNum == 0) {
        isPrime = false;
        break;
      }
    }
    if (isPrime) {
      primes.push_back(i);
    }
  }
  return primes;
}
bool isPrime(vector<long long>& primes, long long num) {
  long long cap = sqrt(num) + 1;
  for (auto i = primes.begin(); i != primes.end(); i++) {
    if (*i > cap) {
      break;
    }
    if ((num % *i) == 0) {
      return false;
    }
  }
  return true;
}
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
int main(int argc, char** argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int Num_Cases;
  cin >> Num_Cases;
  vector<long long> primes = genPrimes();
  while (Num_Cases--) {
    long long n;
    cin >> n;
    long long u = n;
    while (!isPrime(primes, u)) {
      u--;
    }
    long long v = n + 1;
    while (!isPrime(primes, v)) {
      v++;
    }
    long long num = (u * v - 2 * v + 2 * n - 2 * u + 2);
    long long den = 2 * u * v;
    long long hcf = gcd(num, den);
    num /= hcf;
    den /= hcf;
    cout << num << "/" << den << '\n';
  }
  return 0;
}
