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 Pow(int a, int b, int p) {
  if (!b) return 1;
  int tmp = Pow(a, b >> 1, p);
  tmp = ((long long)tmp * (long long)tmp) % p;
  if (b & 1) tmp = ((long long)tmp * (long long)a) % p;
  return tmp;
}
bool prime(int x) {
  if (x == 2 || x == 3 || x == 5 || x == 7) return true;
  if (x <= 7) return false;
  return (Pow(2, x - 1, x) == 1 && Pow(3, x - 1, x) == 1 &&
          Pow(5, x - 1, x) == 1 && Pow(7, x - 1, x) == 1);
}
int T;
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
struct FS {
  long long fz, fm;
  FS(long long fz = 0, long long fm = 1) : fz(fz), fm(fm) {}
  void maintain() {
    long long gd = gcd(fz, fm);
    fz /= gd;
    fm /= gd;
  }
  FS operator-(const FS &b) const {
    FS ret;
    long long gd = gcd(fm, b.fm);
    ret.fz = fz * (b.fm / gd) - b.fz * (fm / gd);
    ret.fm = fm * (b.fm / gd);
    ret.maintain();
    return ret;
  }
  FS operator+(const FS &b) const {
    FS ret;
    long long gd = gcd(fm, b.fm);
    ret.fz = fz * (b.fm / gd) + b.fz * (fm / gd);
    ret.fm = fm * (b.fm / gd);
    ret.maintain();
    return ret;
  }
} ans;
int n, last, nxt;
int findLast(int v) {
  for (int i = v; i >= 2; --i)
    if (prime(i)) return i;
  return 0;
}
int findNext(int v) {
  for (int i = v;; ++i)
    if (prime(i)) return i;
  return 0;
}
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    last = findLast(n);
    nxt = findNext(n + 1);
    ans = FS(1, 2) - FS(1, last);
    for (int i = last; i <= n; ++i)
      ans = ans + FS(1, (long long)last * (long long)nxt);
    cout << ans.fz << "/" << ans.fm << endl;
  }
  return 0;
}
