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;
class Dropka {
 public:
  unsigned long long a, b;
  Dropka(unsigned long long _a, unsigned long long _b) {
    a = _a;
    b = _b;
  }
  unsigned long long gcd(unsigned long long c, unsigned long long d) {
    if (d == 0) {
      return c;
    } else {
      return gcd(d, c % d);
    }
  }
  void skrati() {
    unsigned long long tmp = gcd(a, b);
    a = a / tmp;
    b = b / tmp;
  }
  void dodadi(Dropka c) {
    unsigned long long nzd = gcd(b, c.b);
    unsigned long long imenitel = b / nzd;
    imenitel = imenitel * c.b;
    a = a * (imenitel / b) + c.a * (imenitel / c.b);
    b = imenitel;
    skrati();
  }
  void odzemi(Dropka c) {
    unsigned long long nzd = gcd(b, c.b);
    unsigned long long imenitel = b / nzd;
    imenitel = imenitel * c.b;
    a = a * (imenitel / b) - c.a * (imenitel / c.b);
    b = imenitel;
    skrati();
  }
  void pecati() { cout << a << "/" << b << endl; }
};
unsigned long long findPrime(unsigned long long n, int dir) {
  unsigned long long koren = sqrt(n);
  for (int k = 2; k <= koren; k++) {
    if (n % k == 0) {
      return findPrime(n + dir, dir);
    }
  }
  return n;
}
int main() {
  int t;
  cin >> t;
  while (t > 0) {
    unsigned long long n;
    cin >> n;
    unsigned long long prevPrime = findPrime(n, -1);
    unsigned long long nextPrime = findPrime(n + 1, 1);
    Dropka rez(1, 2);
    Dropka tmp(1, (unsigned long long)prevPrime);
    rez.odzemi(tmp);
    tmp.a = n - prevPrime + 1;
    tmp.b = nextPrime * prevPrime;
    tmp.skrati();
    rez.dodadi(tmp);
    rez.pecati();
    t--;
  }
  return 0;
}
