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;
struct Fraction {
  int64_t p, q;
  Fraction(int64_t a, int64_t b) {
    int nd = gcd(a, b);
    p = a / nd;
    q = b / nd;
  }
  int64_t gcd(int64_t a, int64_t b) { return (a ? gcd(b % a, a) : b); }
  int64_t nok(int64_t a, int64_t b) { return a / gcd(a, b) * b; }
  Fraction operator+(const Fraction &other) {
    int64_t nk = nok(q, other.q);
    return Fraction(p * (nk / q) + (nk / other.q) * other.p, nk);
  }
  friend ostream &operator<<(ostream &os, const Fraction &fraction) {
    return os << fraction.p << "/" << fraction.q;
  }
};
const int MAXLEN = 1e5;
vector<int64_t> p, reh(MAXLEN);
unordered_set<int> pr;
int64_t Next(int64_t n) {
  int64_t i = n;
  while (true) {
    ++i;
    bool flag = true;
    if (pr.count(i)) {
      return i;
    }
    size_t j;
    for (j = 0; (j < p.size() && p[j] * p[j] <= i) && flag; ++j) {
      flag &= (i % p[j] != 0);
    }
    if (flag) {
      return i;
    }
  }
}
int64_t Previous(int n) {
  for (int64_t i = n; true; --i) {
    bool flag = true;
    if (pr.count(i)) {
      return i;
    }
    for (size_t j = 0; j < p.size() && p[j] * p[j] <= i && flag; ++j) {
      flag &= (i % p[j] != 0);
    }
    if (flag) {
      return i;
    }
  }
}
Fraction Solve(int n) {
  int64_t next = Next(n);
  int64_t previous = Previous(n);
  if (n + 1 == next) {
    return Fraction(next - 2, next * 2);
  }
  return Solve(previous - 1) + Fraction((n - (previous - 1)), next * previous);
}
int main() {
  for (int64_t i = 2; i < MAXLEN; ++i) {
    if (reh[i] == 0) {
      p.push_back(i);
      pr.insert(i);
      for (int64_t j = i * i; j < MAXLEN; j += i) {
        reh[j] = 1;
      }
    }
  }
  int64_t t;
  cin >> t;
  for (int q = 1; q <= t; ++q) {
    int64_t n;
    cin >> n;
    cout << Solve(n) << endl;
  }
  return 0;
}
