#include <bits/stdc++.h>
using namespace std;
bool prime(int x) {
  if (x % 2 == 0) return false;
  for (int j = 3; j * j <= x; j += 2)
    if (x % j == 0) return false;
  return true;
}
long long gcd(long long a, long long b) { return !b ? a : gcd(b, a % b); }
int main(void) {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    long long p2 = n + 1, p1 = n;
    while (!prime(p1)) p1--;
    while (!prime(p2)) p2++;
    long long b = p1 * p2 * 2;
    long long a = p1 * p2 - 2 * p1 - 2 * (p2 - n - 1);
    long long g = gcd(a, b);
    a /= g, b /= g;
    cout << a << "/" << b << endl;
  }
  return 0;
}
