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) {
  if (n == 1) return false;
  if (n == 2) return true;
  long long i;
  if (n % 2 == 0)
    return false;
  else {
    for (i = 3; i <= sqrt(n); i += 2) {
      if (n % i == 0) return false;
    }
  }
  return true;
}
long long pb(long long n) {
  long long i;
  for (i = n; i > 1; i--) {
    if (is_prime(i) == true) return i;
  }
}
long long pa(long long n) {
  long long i;
  for (i = n + 1;; i++) {
    if (is_prime(i) == true) return i;
  }
}
long long gcd(long long a, long long b) {
  if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}
int main() {
  long long t, n, i, j, k, l, de, ne, p1, p2;
  scanf("%lld", &t);
  while (t--) {
    scanf("%lld", &n);
    if (is_prime(n + 1) == true) {
      de = n - 1;
      ne = 2 * (n + 1);
    } else if (is_prime(n) == true) {
      p1 = pb(n);
      p2 = pa(n);
      de = (n * p2) - (2 * p2) + 2;
      ne = 2 * n * p2;
    } else {
      p1 = pb(n);
      p2 = pa(n);
      de = (p1 * p2) - 2 * p1 - 2 * (p2 - n - 1);
      ne = 2 * p1 * p2;
    }
    long long k = gcd(ne, de);
    de = de / k;
    ne = ne / k;
    printf("%lld/%lld\n", de, ne);
  }
  return 0;
}
