#include <bits/stdc++.h>
using namespace std;
long long n, u, v, p, q, g, a;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long power(long long x, long long p, long long MOD) {
  long long res = 1;
  while (p) {
    if (p & 1) res = res * x % MOD;
    x = x * x % MOD;
    p >>= 1;
  }
  return res;
}
bool check(long long x) {
  for (int i = 1; i <= 5; i++) {
    a = rand() * rand() % (x - 1) + 1;
    if (power(a, x - 1, x) != 1) return false;
  }
  return true;
}
int main() {
  srand(20170813);
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%I64d", &n);
    v = n;
    while (!check(v)) v--;
    u = n + 1;
    while (!check(u)) u++;
    p = u * v + 2 * (n - v - u + 1);
    q = 2 * u * v;
    g = gcd(p, q);
    printf("%I64d/%I64d\n", p / g, q / g);
  }
  return 0;
}
