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 long long N = 1 << 15;
bool primeMark[N];
vector<long long> p;
inline void calcPrime() {
  memset(primeMark, true, sizeof(primeMark));
  for (long long x = 2; x < N; x++) {
    if (primeMark[x]) p.push_back((long long)x);
    for (long long j = 0; j < (long long)p.size() && p[j] * x < N; j++) {
      primeMark[x * p[j]] = false;
      if (x % p[j] == 0) break;
    }
  }
}
inline bool isPrime(long long n) {
  if (n < N) return primeMark[n];
  for (long long i = 0; i < (long long)p.size() && p[i] * p[i] <= n; i++) {
    if (n % p[i] == 0) return false;
  }
  return true;
}
inline long long prevPrime(long long n) {
  while (!isPrime(n)) n--;
  return n;
}
inline long long nextPrime(long long n) {
  n++;
  while (!isPrime(n)) n++;
  return n;
}
inline long long gcd(long long a, long long b) {
  while (b % a != 0) {
    long long c = b % a;
    b = a;
    a = c;
  }
  return a;
}
inline void out(long long a, long long b) {
  long long g = gcd(a, b);
  a /= g;
  b /= g;
  cout << a << "/" << b << endl;
}
int main() {
  calcPrime();
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long b = nextPrime(n);
    if (b == n + 1) {
      out(b - 2, 2 * b);
    } else {
      long long a = prevPrime(n);
      out(a * b - 2 * (a + b - n) + 2, 2 * a * b);
    }
  }
  return 0;
}
