#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
const int mod = 1e9 + 7;
bool prime(long long x) {
  for (long long i = 2; i <= (long long)sqrt(x + 0.5); i++)
    if (x % i == 0) return false;
  return true;
}
long long gcd(long long a, long long b) { return (b == 0) ? a : gcd(b, a % b); }
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long u = n, v = n + 1;
    while (!prime(u)) u--;
    while (!prime(v)) v++;
    long long a = (u * v - 2 * v + 2 * (n - u + 1)), b = 2 * u * v;
    long long c = gcd(a, b);
    cout << a / c << "/" << b / c << endl;
  }
  return 0;
}
