#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  return b == 0 ? a : gcd(b, a % b);
}
bool isPrime(long long int n) {
  if (n <= 3) {
    return true;
  }
  for (int i = 2; i < sqrt(n) + 1; i++)
    if (n % i == 0) return false;
  return true;
}
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    long long int n;
    cin >> n;
    long long int d = n, u = n + 1;
    while (!isPrime(d)) d--;
    while (!isPrime(u)) u++;
    long long int chil = u * d + 2 * (-u - d + n + 1);
    long long int moth = 2LL * d * u;
    long long int cm = gcd(chil, moth);
    cout << (chil / cm) << "/" << (moth / cm) << endl;
  }
  return 0;
}
