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;
bool is_prime(long long n) {
  bool b = true;
  for (int i = 2; i < sqrt(n) + 1; i++) {
    if (n % i == 0) {
      b = false;
      break;
    }
  }
  return b;
}
long long find_smaller_prime(long long n) {
  while (!is_prime(n)) {
    n--;
  }
  return n;
}
long long find_larger_prime(long long n) {
  while (!is_prime(n)) {
    n++;
  }
  return n;
}
long long gcd(long long p, long long q) {
  if (0) {
    cerr << "p"
         << " : " << p << " :: "
         << "q"
         << " : " << q << endl;
  };
  if (q % p == 0)
    return p;
  else
    return gcd(q % p, p);
}
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    long long n;
    long long p;
    long long q;
    long long p1, q1;
    cin >> n;
    if (is_prime(n + 1)) {
      p = n - 1;
      q = 2 * (n + 1);
    } else {
      p1 = find_smaller_prime(n);
      q1 = find_larger_prime(n + 2);
      p = p1 * q1 + 2 * (0 - p1 - q1 + n + 1);
      q = 2 * p1 * q1;
      if (0) {
        cerr << "p"
             << " : " << p << " :: "
             << "q"
             << " : " << q << endl;
      };
    }
    long long gcd1 = gcd(p, q);
    if (0) {
      cerr << "gcd1"
           << " : " << gcd1 << endl;
    };
    cout << p / gcd1 << "/" << q / gcd1 << "\n";
  }
}
