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>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
bool isprime(long long x) {
  long long t = sqrt(x);
  for (int i = 2; i <= t; i++) {
    if (x % i == 0) return false;
  }
  return true;
}
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    long long up, down;
    if (isprime(n)) {
      long long r;
      for (r = n + 1;; r++) {
        if (isprime(r)) {
          break;
        }
      }
      up = (n - 2) * r + 2;
      down = n * 2 * r;
    } else {
      long long l, r;
      for (l = n - 1; l >= 1; l--) {
        if (isprime(l)) {
          break;
        }
      }
      for (r = n + 1;; r++) {
        if (isprime(r)) {
          break;
        }
      }
      up = l * r - 2 * l - 2 * (r - n - 1);
      down = 2 * l * r;
    }
    long long ll = gcd(up, down);
    up /= ll;
    down /= ll;
    cout << up << "/" << down << endl;
  }
  return 0;
}
