#include <bits/stdc++.h>
using namespace std;
int bPow(int v, int u, int mod) {
  if (!u) return 1;
  int res = bPow(v, u / 2, mod);
  res = (res * 1ll * res) % mod;
  if (u & 1) res = (res * 1ll * v) % mod;
  return res;
}
bool fb(long long x) { return 0; }
int bSearch(int l, int r) {
  while (r - l > 1) {
    int m = (l + r) / 2;
    if (fb(m))
      l = m;
    else
      r = m;
  }
  if (fb(l + 1)) l++;
  if (!fb(l)) l = 0;
  return l;
}
void faster() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  if (0) {
    freopen(
        "input"
        ".in",
        "r", stdin);
    freopen(
        "input"
        ".out",
        "w", stdout);
  }
}
void factor() {}
bool prime(int p) {
  if (p == 2) return 1;
  for (int i = 2; i * i <= p; i++)
    if (p % i == 0) return 0;
  return 1;
}
pair<long long, long long> f(int n) {
  int p = n, q = n + 1;
  while (!prime(p)) p--;
  while (!prime(q)) q++;
  long long a = 1ll * p * q - 2 * p - 2 * q + 2 * n + 2, b = 2ll * p * q;
  if (a % 2 == 0) a /= 2, b /= 2;
  if (a % p == 0) a /= p, b /= p;
  if (a % q == 0) a /= q, b /= q;
  return {a, b};
}
int main() {
  faster();
  int t;
  int n;
  pair<long long, long long> ans;
  cin >> t;
  while (t--) {
    cin >> n;
    ans = f(n);
    cout << ans.first << '/' << ans.second << endl;
  }
  return 0;
}
