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;
int prime[500100], vis[500100], cnt;
bool check(int l, int x) {
  for (int i = 1; i <= x; i++)
    if (l % prime[i] == 0 && l != prime[i]) return 0;
  return 1;
}
int main() {
  int i, j, t, n;
  long long p, q;
  vis[0] = vis[1] = 1;
  for (i = 2; i <= 500000; i++)
    if (!vis[i]) {
      prime[++cnt] = i;
      for (j = i + i; j <= 500000; j += i) vis[j] = 1;
    }
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    int l, r;
    int x = *lower_bound(prime + 1, prime + 1 + cnt, (int)sqrt(n));
    for (l = n; check(l, x) == 0; l--)
      ;
    x = *upper_bound(prime + 1, prime + 1 + cnt, (int)sqrt(n));
    for (r = n + 1; check(r, x + 1) == 0; r++)
      ;
    if (check(n + 1, x)) {
      printf("%d/%d\n", r - 2, 2 * r);
      continue;
    }
    p = 2LL * (n - l + 1) + (1LL * l - 2) * r;
    q = 2LL * l * r;
    printf("%I64d/%I64d\n", p, q);
  }
}
