#include <bits/stdc++.h>
using namespace std;
long long GCD(long long a, long long b) { return b ? GCD(b, a % b) : a; }
bool is_prime(int n) {
  for (int i = 2; i * i <= n; ++i) {
    if (n % i == 0) return false;
  }
  return true;
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    int n;
    scanf("%d", &n);
    int p1 = n, p2 = n + 1;
    while (!is_prime(p1)) p1--;
    while (!is_prime(p2)) p2++;
    long long a = (long long)p2 * (p1 - 2) + 2LL * (n - p1 + 1);
    long long b = 2LL * p1 * p2;
    long long c = GCD(a, b);
    printf("%I64d/%I64d\n", a / c, b / c);
  }
  return 0;
}
