#include <bits/stdc++.h>
using namespace std;
bool isprime(long long n) {
  for (int i = 2; i <= n / i; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
long long gcd(long long a, long long b) {
  while (b) {
    long long c = a % b;
    a = b;
    b = c;
  }
  return a;
}
int main() {
  cin.sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int T;
  cin >> T;
  while (T--) {
    long long n;
    cin >> n;
    long long v = n;
    while (!isprime(v)) v--;
    long long u = n + 1;
    while (!isprime(u)) u++;
    long long a = (u - 2) * (v - 2) - 2 + 2 * n;
    long long b = 2 * u * v;
    long long c = gcd(a, b);
    a /= c;
    b /= c;
    cout << a << "/" << b << endl;
  }
}
