#include <bits/stdc++.h>
using namespace std;
int panduan(int n) {
  int i;
  for (i = 2; i * i <= n; i++) {
    if (n % i == 0) return 0;
  }
  return 1;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int i, n, p = 0, p1 = 0, t;
  cin >> t;
  while (t--) {
    scanf("%d", &n);
    for (i = n; i >= 1; i--) {
      if (panduan(i)) {
        p = i;
        break;
      }
    }
    for (i = n + 1; 1; i++) {
      if (panduan(i)) {
        p1 = i;
        break;
      }
    }
    long long x, y;
    x = (long long)p * p1 - 2 * p - 2 * p1 + 2 * n + 2;
    y = (long long)2 * p1 * p;
    long long f = gcd(x, y);
    printf("%I64d/%I64d\n", x / f, y / f);
  }
}
