#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define Pi acos(-1.)
typedef long long ll;
typedef unsigned long long ull;
const int MOD=1e9+7;
const ll INF=1e18;
const int MAXN=1e6+5;
const int T=1e3+1;
int i,j,m,n,k;
ll ans;
//vector <pair<int,int> > g[MAXN];
//int w[MAXN];
long long fact[MAXN];
 //bool can[T][T];

int phi(int n)
{
    int result = n;

    for(int i=2; i*i<=n; i++){
        if(n%i==0){
            while(n%i==0)
                n/=i;
            result -= result / i;
        }
    }

    if(n>1)
    {
        result -= result/n;
    }
    return result;
}

int gcdex (int a,int b,int &x, int &y)
{
    if(a==0){
        x = 0 , y = 1;
        return b;
    }
    int x1, y1;
    int d = gcdex(b%a,a ,x1 ,y1);
    x = y1 - (b / a) * x1;
    y = x1;

}

//------------------------------------------------------
void initfact() {
        fact[0] = 1;
        for(int i = 1; i < MAXN; i++) {
                fact[i] = (fact[i-1] * i);
                fact[i] %= MOD;
        }
}

ll binpow(ll val, ll deg) {
        if (!deg) return 1;
        if (deg & 1) return binpow(val, deg - 1) * val % MOD;
        ll res = binpow(val ,deg >> 1);
        return (res*res) % MOD;
}

ll C(int n, int i) {
        ll res = fact[n];
        ll div = fact[n-i] * fact[i];
        div %= MOD;  div = binpow(div, MOD - 2); // inv(div)
        return (res * div) % MOD;
}

ll inv(ll a,ll m)
{
    return binpow(a, phi(m) - 1);
}

bool isGood(ll s, int a, int b) {
        while (s > 0)
        {
            if (s % 10 == a || s % 10 == b) {
                    s /= 10;
            }
            else return false;
        }
        return true;
}

typedef struct point{
 double x,y;
}point;

//int a[MAXN];
 //map <int,int> mappy;

ll gcd(ll a,ll b)
{
    if(b==0) return a;
    else return gcd(b,a%b);
}

bool isPrime(int n)
{
    for(int i=2;i*i<=n;i++)
    {
        if(n%i==0) return false;
    }
    return true;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    //cout << fixed;cout.precision(15);

    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    // {a,b}
    //initfact();

    int t;
    cin>>t;

    while(t--)
    {
        int p,q;
        ll a,b,d;
        cin>>n;
        p = n, q = n+1;

        while(!isPrime(p)) p--;
        while(!isPrime(q)) q++;

        a = 1ll*p*q - 2*q + (n-p+1)*2;
        b = 2ll*p*q;
        d=gcd(a,b);
        a/=d , b/=d;
        cout<<a<<"/"<<b<<"\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int N = 4e4;
vector<long long int> prime;
bool b[N];

pair<long long int, long long int> operator+(pair<long long int, long long int>p1,pair<long long int, long long int>p2) {
    pair<long long int, long long int> ret;
    ret.second=p1.second*p2.second;
    ret.first=(p1.first*p2.second)+(p1.second*p2.first);
    long long int x = __gcd(ret.first,ret.second);
    ret.first/=x;
    ret.second/=x;
    return ret;
}

int main () {
    long long int t;
    cin >> t;
    for(int i = 2 ; i <= 3e4+2000 ; i++ ) {
        for(int j = i*i ; j <= 3e4+2000 ; j+=i) {
            b[j]=1;
        }
        if(!b[i])prime.push_back(i);
    }
    while(t--) {
        long long int n, las, las2;
        cin >> n;
        if(n==2) {
            cout << "1/6" << '\n';
            continue;
        }
        for(int i = n ; i >= 0 ; i--) {
            bool ok=0;
            for(int u: prime) {
                if(i%u==0&&i!=u) {
                    ok=1;
                    break;
                }
            }
            if(!ok) {
                las=i;
                break;
            }
        }
        for(int i = n+1 ; true ; i++) {
            bool ok=0;
            for(int u: prime) {
                if(i%u==0&&i!=u) {
                    ok=1;
                    break;
                }
            }
            if(!ok) {
                las2=i;
                break;
            }
        }
        pair<long long int, long long int>ans;
        ans.first=las2*(las-2)+(n-las+1)*2;
        ans.second = 2*las*las2;
        long long int gc=__gcd(ans.first,ans.second);
        ans.first/=gc;
        ans.second/=gc;
        cout << ans.first << '/' << ans.second << '\n';
    }
}


//By Tushar Gautam
#pragma GCC optimize ("-O2")
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define memreset(a) memset(a,0,sizeof(a))
#define testcase(t) int t;cin>>t;while(t--)
#define forstl(i,v) for(auto &i: v)
#define forn(i,e) for(int i = 0; i < e; i++)
#define forsn(i,s,e) for(int i = s; i < e; i++)
#define rforn(i,s) for(int i = s; i >= 0; i--)
#define rforsn(i,s,e) for(int i = s; i >= e; i--)
#define leadzero(a) __builtin_clz(a) // count leading zeroes
#define trailzero(a) __builtin_ctz(a) // count trailing zeroes
#define bitcount(a) __builtin_popcount(a) // count set bits (add ll)
#define ln "\n"
#define dbgarr(v,s,e) cerr<<#v<<" = "; forsn(i,s,e) cerr<<v[i]<<", "; cerr<<endl
#define inputfile freopen("input.txt", "r", stdin)
#define outputfile freopen("output.txt", "w", stdout)
#define dbg(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); \
stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) { cerr<<endl; }
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << "\t"; err(++it, args...);
}
template<typename T1,typename T2>
ostream& operator <<(ostream& c,pair<T1,T2> &v){
	c<<"("<<v.fi<<","<<v.se<<")"; return c;
}
template <template <class...> class TT, class ...T>
ostream& operator<<(ostream& out,TT<T...>& c){
    out<<"{ ";
    forstl(x,c) out<<x<<" ";
    out<<"}"; return out;
}
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double  ld;
typedef pair<ll,ll> p64;
typedef pair<int,int> p32;
typedef pair<int,p32> p96;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<v32> vv32;
typedef vector<v64> vv64;
typedef vector<p32> vp32;
typedef vector<vp32> vvp32;
typedef map<int,int> m32;
const int LIM = 1e5+5, MOD = 1e9+7;
int t,n,m,k,x,y;
ull mulm(ull a,ull b,ull MOD){
	ull res=0;
	a%=MOD,b%=MOD;
	while(b){
		if(b&1LL) res=(res+a)%MOD;
		b>>=1;
		a=(a+a)%MOD;
	}
	return res;
}
ull powm(ull x,ull pw,ull MOD){ //return x^pw % MOD
	x%=MOD;
	ull res=1;
	while(pw){
		if(pw&1LL) res=mulm(res,x,MOD);
		pw>>=1;
		x=mulm(x,x,MOD);
	}
	return res;
}
inline ull inv(ull x,ull MOD){
	return powm(x,MOD-2,MOD);
}
bool prime(ull p){
	if(p==2) return 1;
	if(p==1 || !(p&1LL)) return 0;
	ull s=p-1;
	while(!(s&1LL)) s/=2;
	forn(i,15){
		ull a=rand()%(p-1)+1,tmp=s;
		ull mod=powm(a,tmp,p);
		while(tmp!=p-1 && mod!=1 && mod!=p-1){
			mod=mulm(mod,mod,p);
			tmp<<=1;
		}
		if(mod!=p-1 && !(tmp&1LL)) return 0;
	}
	return 1;
}
int main(){
	fastio; srand(time(0));
	cin>>t;
	while(t--){
		cin>>n
		int lwr=n+1,upr=n+1;
		while(!prime(lwr)) lwr--;
		while(!prime(upr)) upr++;
		//dbg(lwr,upr);
		ll num = upr*(ll)(lwr-2)+ 2*(ll)(n+1-lwr);
		ll den = 2*(ll)lwr*upr;
		ll g = __gcd(num,den);
		num/=g, den/=g;
		cout<< num<<"/"<<den<<ln;
	}
	return 0;
}


//By Tushar Gautam
#pragma GCC optimize ("-O2")
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define memreset(a) memset(a,0,sizeof(a))
#define testcase(t) int t;cin>>t;while(t--)
#define forstl(i,v) for(auto &i: v)
#define forn(i,e) for(int i = 0; i < e; i++)
#define forsn(i,s,e) for(int i = s; i < e; i++)
#define rforn(i,s) for(int i = s; i >= 0; i--)
#define rforsn(i,s,e) for(int i = s; i >= e; i--)
#define leadzero(a) __builtin_clz(a) // count leading zeroes
#define trailzero(a) __builtin_ctz(a) // count trailing zeroes
#define bitcount(a) __builtin_popcount(a) // count set bits (add ll)
#define ln "\n"
#define dbgarr(v,s,e) cerr<<#v<<" = "; forsn(i,s,e) cerr<<v[i]<<", "; cerr<<endl
#define inputfile freopen("input.txt", "r", stdin)
#define outputfile freopen("output.txt", "w", stdout)
#define dbg(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); \
stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) { cerr<<endl; }
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << "\t"; err(++it, args...);
}
template<typename T1,typename T2>
ostream& operator <<(ostream& c,pair<T1,T2> &v){
	c<<"("<<v.fi<<","<<v.se<<")"; return c;
}
template <template <class...> class TT, class ...T>
ostream& operator<<(ostream& out,TT<T...>& c){
    out<<"{ ";
    forstl(x,c) out<<x<<" ";
    out<<"}"; return out;
}
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double  ld;
typedef pair<ll,ll> p64;
typedef pair<int,int> p32;
typedef pair<int,p32> p96;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<v32> vv32;
typedef vector<v64> vv64;
typedef vector<p32> vp32;
typedef vector<vp32> vvp32;
typedef map<int,int> m32;
const int LIM = 1e5+5, MOD = 1e9+7;
int t,n,m,k,x,y;
ull mulm(ull a,ull b,ull MOD){
	// ull res=0;
	// a%=MOD,b%=MOD;
	// while(b){
	// 	if(b&1LL) res=(res+a)%MOD;
	// 	b>>=1;
	// 	a=(a+a)%MOD;
	// }
	return (a*b)%MOD;
}
ull powm(ull x,ull pw,ull MOD){ //return x^pw % MOD
	x%=MOD;
	ull res=1;
	while(pw){
		if(pw&1LL) res=mulm(res,x,MOD);
		pw>>=1;
		x=mulm(x,x,MOD);
	}
	return res;
}
inline ull inv(ull x,ull MOD){
	return powm(x,MOD-2,MOD);
}
bool prime(ull p){
	if(p==2) return 1;
	if(p==1 || !(p&1LL)) return 0;
	ull s=p-1;
	while(!(s&1LL)) s/=2;
	forn(i,15){
		ull a=rand()%(p-1)+1,tmp=s;
		ull mod=powm(a,tmp,p);
		while(tmp!=p-1 && mod!=1 && mod!=p-1){
			mod=mulm(mod,mod,p);
			tmp<<=1;
		}
		if(mod!=p-1 && !(tmp&1LL)) return 0;
	}
	return 1;
}
int main(){
	fastio; srand(time(0));
	cin>>t;
	while(t--){
		cin>>n;
		int lwr=n+1,upr=n+1;
		while(!prime(lwr)) lwr--;
		while(!prime(upr)) upr++;
		//dbg(lwr,upr);
		ll num = upr*(ll)(lwr-2)+ 2*(ll)(n+1-lwr);
		ll den = 2*(ll)lwr*upr;
		ll g = __gcd(num,den);
		num/=g, den/=g;
		cout<< num<<"/"<<den<<ln;
	}
	return 0;
}


//By Tushar Gautam
#pragma GCC optimize ("-O2")
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define memreset(a) memset(a,0,sizeof(a))
#define testcase(t) int t;cin>>t;while(t--)
#define forstl(i,v) for(auto &i: v)
#define forn(i,e) for(int i = 0; i < e; i++)
#define forsn(i,s,e) for(int i = s; i < e; i++)
#define rforn(i,s) for(int i = s; i >= 0; i--)
#define rforsn(i,s,e) for(int i = s; i >= e; i--)
#define leadzero(a) __builtin_clz(a) // count leading zeroes
#define trailzero(a) __builtin_ctz(a) // count trailing zeroes
#define bitcount(a) __builtin_popcount(a) // count set bits (add ll)
#define ln "\n"
#define dbgarr(v,s,e) cerr<<#v<<" = "; forsn(i,s,e) cerr<<v[i]<<", "; cerr<<endl
#define inputfile freopen("input.txt", "r", stdin)
#define outputfile freopen("output.txt", "w", stdout)
#define dbg(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); \
stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) { cerr<<endl; }
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << "\t"; err(++it, args...);
}
template<typename T1,typename T2>
ostream& operator <<(ostream& c,pair<T1,T2> &v){
	c<<"("<<v.fi<<","<<v.se<<")"; return c;
}
template <template <class...> class TT, class ...T>
ostream& operator<<(ostream& out,TT<T...>& c){
    out<<"{ ";
    forstl(x,c) out<<x<<" ";
    out<<"}"; return out;
}
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double  ld;
typedef pair<ll,ll> p64;
typedef pair<int,int> p32;
typedef pair<int,p32> p96;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<v32> vv32;
typedef vector<v64> vv64;
typedef vector<p32> vp32;
typedef vector<vp32> vvp32;
typedef map<int,int> m32;
const int LIM = 1e5+5, MOD = 1e9+7;
int t,n,m,k,x,y;
ull mulm(ull a,ull b,ull MOD){
	ull res=0;
	a%=MOD,b%=MOD;
	while(b){
		if(b&1LL) res=(res+a)%MOD;
		b>>=1;
		a=(a+a)%MOD;
	}
	return res;
}
ull powm(ull x,ull pw,ull MOD){ //return x^pw % MOD
	x%=MOD;
	ull res=1;
	while(pw){
		if(pw&1LL) res=mulm(res,x,MOD);
		pw>>=1;
		x=mulm(x,x,MOD);
	}
	return res;
}
inline ull inv(ull x,ull MOD){
	return powm(x,MOD-2,MOD);
}
bool prime(ull p){
	if(p==2) return 1;
	if(p==1 || !(p&1LL)) return 0;
	ull s=p-1;
	while(!(s&1LL)) s/=2;
	forn(i,15){
		ull a=rand()%(p-1)+1,tmp=s;
		ull mod=powm(a,tmp,p);
		while(tmp!=p-1 && mod!=1 && mod!=p-1){
			mod=mulm(mod,mod,p);
			tmp<<=1;
		}
		if(mod!=p-1 && !(tmp&1LL)) return 0;
	}
	return 1;
}
int main(){
	fastio; srand(time(0));
	cin>>t;
	while(t--){
		cin>>n;
		int lwr=n+1,upr=n+1;
		while(!prime(lwr)) lwr--;
		while(!prime(upr)) upr++;
		//dbg(lwr,upr);
		ll num = upr*(ll)(lwr-2)+ 2*(ll)(n+1-lwr);
		ll den = 2*(ll)lwr*upr;
		ll g = __gcd(num,den);
		num/=g, den/=g;
		cout<< num<<"/"<<den<<ln;
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<iterator>
#include<stack>
#include<queue>
#include<utility>
#include<functional>
#include<bitset>
#include<numeric>
#include<cstring>
#include<tuple>
using namespace std;

int t;
long long n, a = 2, d, x, num, den;

bool prime( int n )
{
	if( n <= 1 )
	{
		return false;
	}
	for( int i = 2; i * i <= n; ++i )
	{
		if( n % i == 0 )
		{
			return false;
		}
	}
	return true;
}

long long pre( void )
{
	for( int i = n; ; --i )
	{
		if( prime( i ) )
		{
			return i;
		}
	}
}

long long nxt( void )
{
	for( int i = n + 1; ; ++i )
	{
		if( prime( i ) )
		{
			return i;
		}
	}
}

int main( void )
{
	ios :: sync_with_stdio( 0 );
	cin.tie( 0 );

	cin >> t;
	for( int z = 1; z <= t; ++z )
	{
		cin >> n;
		d = pre();
		x = nxt();
		num = d * x - a * x + a * ( n - d + 1 );
		den = a * d * x;
		d = __gcd( num, den );
		cout << num / d << "/" << den / d << "\n";
	}
	return 0;
}


#include <bits/stdc++.h>
#define pb emplace_back
#define int long long
#define mp make_pair

using namespace std;

bool found(int x)
{
	for (int i = 2; i * i <= x; ++i)
		if(x % i == 0)
			return false;
	return true;
}

int gcd(int a, int b)
{
	if(a == 0)
		return b;
	return gcd(b % a, a);
}

pair<int, int> getans(int n, int p1, int p2)
{
	int num = 2ll * (n + 1ll) + p1 * p2 - 2ll * (p1 + p2);
	int den = 2ll * (p1) * (p2);
	int g = gcd(num, den);
	num /= g;
	den /= g;
	return {num, den};
}

int32_t main()
{
	ios::sync_with_stdio(false); cin.tie(NULL); cout.precision(10);
	#ifdef PIYUSH_HOME
	I_O;
	#else
	#define print(...) 0
	#endif
	int t; cin >> t;
	while(t--) {
		int n; cin >> n;
		int prprime = n;
		bool f = false;
		while(!f) {
			if(found(prprime))
				f = true;
			else
				prprime--;
		}
		int peprime = n+1;
		f = false;
		while(!f) {
			if(found(peprime))
				f = true;
			else
				peprime++;
		}
		auto ans = getans(n, prprime, peprime);
		cout << ans.first << "/" << ans.second << "\n";
	}
}


//Jai Shree Krishna
#include <bits/stdc++.h>
using namespace std;
#define PI acos(-1)
#define MOD (ll)1000000007
#define pii pair<long long ,long long >
#define ll  long long int
#define loop(i,n) for(ll i=0;i<n;i++)
#define loop2(i,n) for(ll i = 1;i<=n;i+=1)
#define pb push_back
#define mp make_pair
#define EPS 1e-8
void display(vector<int> v1){loop(i,v1.size()){cout<<v1[i]<<" ";}cout<<endl;}
ll dx[8] = {0,1,0,-1,1,1,-1,-1};
ll dy[8] = {1,0,-1,0,1,-1,1,-1};
//One More Time

bool isitprime(ll x)
{
    for(ll i = 2;i*i<=x;i+=1)
    {
        if(x%i==0)
            return false;
    }
    return true;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t;
    cin>>t;
    while (t--) {
        ll n;
        cin>>n;
        ll a = n+1;
        ll b = n+1;
        while (isitprime(b)==false) {
            b+=1;
        }
        while (isitprime(a)==false) {
            a-=1;
        }
        ll num = a*b -2*b +2*(n-a+1);
        ll g = __gcd(num,2*a*b);
        cout<<num/g<<"/"<<2*a*b/g<<endl;
    }

    return 0;

}


//Jai Shree Krishna
#include <bits/stdc++.h>
using namespace std;
#define PI acos(-1)
#define MOD (ll)1000000007
#define pii pair<long long ,long long >
#define ll  long long int
#define loop(i,n) for(ll i=0;i<n;i++)
#define loop2(i,n) for(ll i = 1;i<=n;i+=1)
#define pb push_back
#define mp make_pair
#define EPS 1e-8
void display(vector<int> v1){loop(i,v1.size()){cout<<v1[i]<<" ";}cout<<endl;}
ll dx[8] = {0,1,0,-1,1,1,-1,-1};
ll dy[8] = {1,0,-1,0,1,-1,1,-1};
//One More Time

bool isitprime(int x)
{
    for(int i = 2;i*i<=x;i+=1)
    {
        if(x%i==0)
            return false;
    }
    return true;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t;
    cin>>t;
    while (t--) {
        int n;
        cin>>n;
        int a = n+1;
        int b = n+1;
        while (isitprime(b)==false) {
            b+=1;
        }
        while (isitprime(a)==false) {
            a-=1;
        }
        int num = a*b -2*b +2*(n-a+1);
        int g = __gcd(num,2*a*b);
        cout<<num/g<<"/"<<2*a*b/g<<endl;
    }

    return 0;

}


#include <bits/stdc++.h>
using namespace std;
typedef int int__;
#define int long long
#define pb push_back
#define pi pair<int,int>
#define vpi vector<pi>
#define vi vector<int>
#define vvi vector<vi>
#define fi first
#define se second
#define forn(i, n)for(int i=0;i<int__(n);i++)
#define sz(a)int__(a.size())
template <class A, class B> ostream& operator << (ostream& out, const pair<A, B> &a){return out << "(" << a.first << ", " << a.second << ")";}
template<class A>ostream& operator<<(ostream& out,const vector<A>&v){out<<"[";forn(i,sz(v)){if(i)out<<", ";out<<v[i];}return out<<"]";}
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
int mod = 1e9 + 7;
int Mod(int x){x%=mod;if(x<0)x+=mod;return x;}
int Pow(int x,int n){if(n==0)return 1;int t=Pow(x,n/2);t=Mod(t*t);if(n&1)t=Mod(t*x);return t;}
#define watch(x) cout << #x << " : " << x << endl;
int gcd(int a,int b){if(b==0)return a;return gcd(b,a%b);}
#define all(x) x.begin(), x.end()
#define db double

int is_prime(int x) {
	for(int i=2;i*i <= x;i++) {
		if(x%i==0) return 0;
	}
	return 1;
}

int__ main() {
	fast;

	int te; cin >> te;
	while(te--) {
		int n; cin >> n;
		int front,back;
		for(int i=1;i<500;i++) {
			int x = n+i;
			if(is_prime(x)) {
				front = x; break;
			}
		}

		for(int i=0;i<500;i++) {
			int x = n-i;
			if(is_prime(x)) {
				back = x; break;
			}
		}

		// watch(front); watch(back);

		int num = front-2;
		int denom = 2*front;
		int g = gcd(num,denom);

		num /= g; denom /= g;

		int tn = front-n-1;
		int td = front*back;
		g = gcd(tn,td);

		tn/=g; td/=g;

		int N = num*td - tn*denom;
		int D = td*denom;
		g = gcd(N,D);
		cout << N/g << "/" << D/g << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
typedef int int__;
#define int long long
#define pb push_back
#define pi pair<int,int>
#define vpi vector<pi>
#define vi vector<int>
#define vvi vector<vi>
#define fi first
#define se second
#define forn(i, n)for(int i=0;i<int__(n);i++)
#define sz(a)int__(a.size())
template <class A, class B> ostream& operator << (ostream& out, const pair<A, B> &a){return out << "(" << a.first << ", " << a.second << ")";}
template<class A>ostream& operator<<(ostream& out,const vector<A>&v){out<<"[";forn(i,sz(v)){if(i)out<<", ";out<<v[i];}return out<<"]";}
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
int mod = 1e9 + 7;
int Mod(int x){x%=mod;if(x<0)x+=mod;return x;}
int Pow(int x,int n){if(n==0)return 1;int t=Pow(x,n/2);t=Mod(t*t);if(n&1)t=Mod(t*x);return t;}
#define watch(x) cout << #x << " : " << x << endl;
int gcd(int a,int b){if(b==0)return a;return gcd(b,a%b);}
#define all(x) x.begin(), x.end()
#define db double

int is_prime(int x) {
	for(int i=2;i*i <= x;i++) {
		if(x%i==0) return 0;
	}
	return 1;
}

int__ main() {
	fast;

	int te; cin >> te;
	while(te--) {

		int n; cin >> n;

		int L=n,R=n+1;

		while(!is_prime(L)) L--;
		while(!is_prime(R)) R++;

		// 1/2 - 1/L + (n-L+1)/(L*R)
		int num = L*R - 2*R + 2*(n-L+1);
		int den = 2*L*R;
		int G = gcd(num, den);
		// printf("%lld %lld\n", L, R);
		cout << num/G << "/" << den/G << endl;
	}
}


#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;

#if DEBUG && !ONLINE_JUDGE
    #include "debug.h"
#else
    #define debug(...)
#endif

using namespace std;

/*******  All Required define Pre-Processors and typedef Constants *******/
#define mem(a, b) memset(a, (b), sizeof(a))
#define repd(i,k) for(int i=k;i>=0;i--)
#define rep(i,k) for(int i=0;i<k;i++)
#define repn(i,k1,k2) for(ll i=k1;i<k2;i++)
#define sz(x) (ll)(x).size()
#define ff first
#define ss second

#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define INF (int)1e9
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
#define ee6 (ll)1000001
#define ee5 (ll)100001

#define trav(a, v) for(auto& a : v)

#define tt ll t;cin>>t; while(t--)
typedef long long int ll;

typedef pair<ll, ll> pr;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef vector<pr> vpr;
typedef vector<vpr>vvpr;
typedef vector<vi> vvi;
typedef map<ll,ll> MPII;
typedef set<ll> SETI;
typedef multiset<ll> MSETI;
//*X.find_by_order(2) element at index=2
//X.order_of_key(1) how many elements strictly less than 1

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,
    tree_order_statistics_node_update>;

ll powmod(ll x, ll y)
{
    ll res = 1;
    x = x % MOD;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % MOD;
        y = y>>1; // y = y/2
        x = (x*x) % MOD;
    }
    return res;
}

const int N=ee5;
int phi[N],spf[N],mob[N];
vi primes;
bool iscomposite[N];

void pre()
{
    mob[1]=phi[1]=1;

    for(ll i=2;i<N;i++)
    {
        if(!iscomposite[i]){primes.pb(i);phi[i]=i-1;mob[i]=-1;spf[i]=i;}
        for(ll j=0;j<primes.size() and i*primes[j]<N;j++)
        {
            iscomposite[i*primes[j]]=true;
            spf[i*primes[j]]=primes[j];

            if(i%primes[j]==0){
                phi[i*primes[j]]=primes[j]*phi[i];
                mob[i*primes[j]]=0;
                break;
            }
            else
            {
                phi[i*primes[j]]=phi[primes[j]]*phi[i];
                mob[i*primes[j]]=-mob[i];
            }
        }
    }
/*
    for(ll i=2;i<=30;i++)
        cout<<i<<" "<<phi[i]<<" "<<mob[i]<<" "<<spf[i]<<"\n";*/
}

bool checkprime(ll n){
    for(auto e:primes){
        if(e>=n)break;
        if(n%e==0)return 0;
    }
    return 1;
}

int main()
{
    #if !ONLINE_JUDGE
    freopen("in.txt","r",stdin);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    pre();
    tt{
        ll n;cin>>n;ll x;
        for(x=n;;x--){
            if(checkprime(x))break;

        }
        ll y=n+1;
        for(;;y++){
            if(checkprime(y))break;
        }
        ll temp=(x*y-2*y+2*n-2*x+2);
        ll temp2=2*x*y;
        ll gcd=__gcd(temp,temp2);
        temp/=gcd;
        temp2/=gcd;
        cout<<temp<<"/"<<temp2<<"\n";

    }
}


#include<bits/stdc++.h>
using namespace std;

long long prm(long long n){
        for(long long i=2; i*i<=n; i++)
                if(n%i == 0)return false;
        return true;
}
long long pre_prime(long long n){
	for(long long i=n; i>=2; i--)
		if(prm(i))return i;
}
long long nxt_prime(long long n){
	for(long long i=n+1; ;i++)
		if(prm(i))return i;
}
void gcd(long long a, long long b){
	long long x = __gcd(a,b);
	printf("%lld/%lld\n", a/x, b/x);
}

int main()
{
	int t;
	long long n, apre, anxt, i, ans, num, den;
	scanf("%d",&t);
	while(t--){
		scanf("%lld",&n);
		apre = pre_prime(n);
		anxt = nxt_prime(n);
		num = 2*(n + 1 -apre -anxt) + (apre*anxt);
		den = 2*apre*anxt;
		gcd(num,den);
	}
	return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;

int isprime(int n)
{
	for(int i=2; i*i<=n; i++){
		if(!(n%i))
			return false;
	}
	return true;
}

int find1(int n)
{
	for(; n>=2; n--){
		if(isprime(n))
			return n;
	}
}

int find2(int n)
{
	for(n++; ;n++){
		if(isprime(n))
			return n;
	}
}

long long gcd(long long a,long long b)
{
	if(a < b)
	    swap(a, b);
    long long tmp = a % b;
    while(tmp)
    {
         a=b;
         b=tmp;
         tmp = a % b;
    }
    return b;
}

int main ()
{
	int T, n;
	scanf("%d", &T);
	while(T--){
		scanf("%d", &n);
		long long v=find1(n);
		long long u=find2(n);
		long long a=u*(v-2)+2*(n-v+1);
		long long b=2*u*v;
		long long t=gcd(a,b);
		printf("%I64d/%I64d\n", a/t, b/t);
	}
	return 0;
}


//package codeforces;

import java.io.PrintWriter;
import java.util.Scanner;

public class OnSumofFractions {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int t = in.nextInt();

        while (t-- > 0) {
            long n = in.nextLong();
            long vn = v(n),
                 un = u(n);

            long num = vn*un + 2*n - 2*(un + vn) + 2; // numerator
            long den = 2 * un * vn; // denominator
            long gcd = gcd(num, den);
            num /= gcd;
            den /= gcd;
            out.println(num + "/" + den);
        }

        out.flush();
    }

    private static boolean isPrime(long x) {
        if (x < 2) return false;
        if (x == 2) return true;
        long max = (long) Math.sqrt(x);
        for (long i = 2; i <= max; i++)
            if (x % i == 0) return false;
        return true;
    }

    private static long v(long n) {
        while(!isPrime(n)) n--;
        return n;
    }

    private static long u(long n) {
        while(!isPrime(++n));
        return n;
    }

    private static long gcd(long x, long y) {
        while (x > 0 && y > 0) {
            if (x < y) y %= x;
            else x %= y;
        }
        return x + y;
    }

}


import java.io.*;
import java.util.*;

public class p397d {
    BufferedReader in;
    PrintWriter out;
    StringTokenizer st;

    String next() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(in.readLine());
            } catch (Exception e) {
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    public boolean isprime(long x) {
        for (long i = 2; i * i <= x; i++)
            if (x % i == 0)
                return false;
        return true;
    }

    public long gcd(long a, long b) {
        while (a > 0 && b > 0) {
            if (a > b) {
                a %= b;
            } else {
                b %= a;
            }
        }
        return a + b;
    }

    public void run() throws Exception {
        in = new BufferedReader(new InputStreamReader(System.in));
        // in = new BufferedReader(new FileReader(new File("input.txt")));
        out = new PrintWriter(System.out);

        int t = nextInt();

        for (int i = 0; i < t; i++) {
            long n = nextLong();

            long l = n, r = n + 1;

            while (!isprime(l))
                l--;
            while (!isprime(r))
                r++;

            long num = r*l-2*r+2*n-2*l+2;
            long den = 2*l*r;
            long g = gcd(num, den);

            out.println(num/g+"/"+den/g);
        }

        out.close();
    }

    public static void main(String[] args) throws Exception {
        new p397d().run();
    }

}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.StringTokenizer;

public class cf397d {
  static FastIO in = new FastIO(), out = in;

  public static void main(String[] args) {
    int T = in.nextInt();
    for(int t=1; t<=T; t++) {
      int n = in.nextInt();
      int higherPrime = n+1;
      while(!isPrime(higherPrime)) higherPrime++;
      int lowerPrime = n;
      while(!isPrime(lowerPrime)) lowerPrime--;

      Fraction ans = new Fraction(1, 2);
      ans = ans.subtract(new Fraction(1, lowerPrime));
      ans = ans.add(new Fraction(n - lowerPrime + 1, higherPrime*1L*lowerPrime));
      out.println(ans);
    }
    out.close();
  }
  static class Fraction {
    BigInteger num, den;
    Fraction(long a, long b) {
      this(BigInteger.valueOf(a), BigInteger.valueOf(b));
    }
    Fraction(BigInteger a, BigInteger b) {
      num = a;
      den = b;
      reduce();
    }
    Fraction negate() {
      return new Fraction(num.negate(), den);
    }
    Fraction add(Fraction rhs) {
      return new Fraction(num.multiply(rhs.den).add(den.multiply(rhs.num)), den.multiply(rhs.den));
    }
    Fraction subtract(Fraction rhs) {
      return add(rhs.negate());
    }
    void reduce() {
      if(den.signum() < 0) {
        num = num.negate();
        den = den.negate();
      }
      BigInteger g = num.abs().gcd(den.abs());
      num = num.divide(g);
      den = den.divide(g);
    }
    public String toString() {
      return num+"/"+den;
    }
  }
  static boolean isPrime(int x) {
    for(int i=2; i*i <= x; i++)
      if(x % i == 0)
        return false;
    return true;
  }

  static class FastIO extends PrintWriter {
    BufferedReader br;
    StringTokenizer st;

    public FastIO() {
      this(System.in, System.out);
    }

    public FastIO(InputStream in, OutputStream out) {
      super(new BufferedWriter(new OutputStreamWriter(out)));
      br = new BufferedReader(new InputStreamReader(in));
      scanLine();
    }

    public void scanLine() {
      try {
        st = new StringTokenizer(br.readLine().trim());
      } catch (Exception e) {
        throw new RuntimeException(e.getMessage());
      }
    }

    public int numTokens() {
      if (!st.hasMoreTokens()) {
        scanLine();
        return numTokens();
      }
      return st.countTokens();
    }

    public String next() {
      if (!st.hasMoreTokens()) {
        scanLine();
        return next();
      }
      return st.nextToken();
    }

    public double nextDouble() {
      return Double.parseDouble(next());
    }

    public long nextLong() {
      return Long.parseLong(next());
    }

    public int nextInt() {
      return Integer.parseInt(next());
    }
  }
}


import java.io.PrintWriter;
import java.util.Scanner;

public class D {

	static Scanner sc = new Scanner(System.in);
	static PrintWriter out = new PrintWriter(System.out);

    static void exit() {
    	sc.close();
    	out.close();
    	System.exit(0);
    }

    public static void main(String[] args) {
    	int t = sc.nextInt();
    	while(t > 0) {
    		t--;
    		long n = sc.nextLong();
    		long v = v(n);
    		long u = u(n);
        	long nu = v*u + 2*(n-u-v+1);
        	long de = 2*u*v;
        	if(nu % 2 == 0) {
        		nu /= 2;
        		de /= 2;
        	}
        	if(nu % v == 0) {
        		nu /= v;
        		de /= v;
        	}
        	if(nu % u == 0) {
        		nu /= u;
        		de /= u;
        	}
        	out.println(nu+"/"+de);
    	}
        exit();
    }
    static long v(long n) {
    	for(long i = n; i >= 2; i--) {
    		if(prime(i)) return i;
    	}
    	return 0;
    }
    static long u(long n) {
    	for(long i = n+1; ; i++) {
    		if(prime(i)) return i;
    	}
    }
    static boolean prime(long n) {
    	long m = (long) Math.sqrt(n);
    	for(int i = 2; i <= m; i++) {
    		if(n % i == 0) return false;
    	}
    	return true;
    }
}


import java.io.*;
import java.util.*;
import java.math.BigInteger;

public class Main{
    final boolean isFileIO =  false;
    BufferedReader in;
    PrintWriter out;
    StringTokenizer st = new StringTokenizer("");
    String delim = " ";

    public static void main(String[] args) throws IOException {
        Main m = new Main();
        m.initIO();
        m.solve();
        m.in.close();
        m.out.close();
    }

    public void initIO() throws IOException {
        if(!isFileIO) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            in = new BufferedReader(new FileReader("laser_maze.txt"));
            out = new PrintWriter("output.txt");
        }
    }

    String nextToken() throws IOException {
        if(!st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken(delim);
    }

    String readLine() throws IOException {
        return in.readLine();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    class Pair {
        public long a, b;
        public Pair(long a, long b) {
            this.a = a;
            this.b = b;
        }
    }

    public void solve() throws IOException {
        int t = nextInt();
        while(t-- > 0) {
            long n = nextLong();
            if(n == 2) {
                out.println("1/6");
                continue;
            }
            if(n == 3) {
                out.println("7/30");
                continue;
            }
            long leftPrime, rightPrime;
            leftPrime = nearestPrime(n, -1);
            rightPrime = nearestPrime(n + 1, 1);
            long prev_p = (leftPrime - 2);
            long prev_q = (2 * leftPrime);
            long diff = (n - leftPrime + 1);
            long ans_p = prev_p * rightPrime + diff * 2;
            long ans_q = 2 * leftPrime * rightPrime;
            long gcd = Utils.gcd(ans_p, ans_q);
            out.println((ans_p / gcd) + "/" + (ans_q / gcd));
        }
    }

    public long nearestPrime(long start, long dir) {
        boolean found = false;
        for(long i = start; ; i += dir) {
            found = true;
            for(long j = 2; j * j <= start; j++) {
                if(i % j == 0) {
                    found = false;
                    break;
                }
            }
            if(found) {
                return i;
            }
        }
    }

}

class Utils {

    public static long binpow(long a, long exp, long mod) {
        if(exp == 0) {
            return 1;
        }
        if(exp % 2 == 0) {
            long temp = binpow(a, exp / 2, mod);
            return (temp * temp) % mod;
        } else {
            return (binpow(a, exp - 1, mod) * a) % mod;
        }
    }

    public static long inv(long a, long mod) {
        return binpow(a, mod - 2, mod);
    }

    public static long addmod(long a, long b, long mod) {
        return ((a + b) % mod + mod) % mod;
    }

    public static long gcd(long a, long b) {
        if(b == 0)
            return a;
        return gcd(b, a % b);
    }

    //mul must be < 10^18
    public static long mulmod(long a, long b, long mod) {
        return (a * b + (((a * b) / mod) + 1) * mod) % mod;
    }
}


import java.io.*;
import java.util.*;
import java.math.BigInteger;

public class Main{
    final boolean isFileIO =  false;
    BufferedReader in;
    PrintWriter out;
    StringTokenizer st = new StringTokenizer("");
    String delim = " ";

    public static void main(String[] args) throws IOException {
        Main m = new Main();
        m.initIO();
        m.solve();
        m.in.close();
        m.out.close();
    }

    public void initIO() throws IOException {
        if(!isFileIO) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            in = new BufferedReader(new FileReader("laser_maze.txt"));
            out = new PrintWriter("output.txt");
        }
    }

    String nextToken() throws IOException {
        if(!st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken(delim);
    }

    String readLine() throws IOException {
        return in.readLine();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    class Pair {
        public long a, b;
        public Pair(long a, long b) {
            this.a = a;
            this.b = b;
        }
    }

    public void solve() throws IOException {
        int t = nextInt();
        while(t-- > 0) {
            long n = nextLong();
            if(n == 2) {
                out.println("1/6");
                continue;
            }
            if(n == 3) {
                out.println("7/30");
                continue;
            }
            long leftPrime, rightPrime;
            leftPrime = nearestPrime(n, -1);
            rightPrime = nearestPrime(n + 1, 1);
            long prev_p = (leftPrime - 2);
            long prev_q = (2 * leftPrime);
            long diff = (n - leftPrime + 1);
            long ans_p = prev_p * rightPrime + diff * 2;
            long ans_q = 2 * leftPrime * rightPrime;
            long gcd = Utils.gcd(ans_p, ans_q);
            out.println((ans_p / gcd) + "/" + (ans_q / gcd));
        }
    }

    public long nearestPrime(long start, long dir) {
        boolean found = false;
        for(long i = start; ; i += dir) {
            found = true;
            for(long j = 2; j * j <= i; j++) {
                if(i % j == 0) {
                    found = false;
                    break;
                }
            }
            if(found) {
                return i;
            }
        }
    }

}

class Utils {

    public static long binpow(long a, long exp, long mod) {
        if(exp == 0) {
            return 1;
        }
        if(exp % 2 == 0) {
            long temp = binpow(a, exp / 2, mod);
            return (temp * temp) % mod;
        } else {
            return (binpow(a, exp - 1, mod) * a) % mod;
        }
    }

    public static long inv(long a, long mod) {
        return binpow(a, mod - 2, mod);
    }

    public static long addmod(long a, long b, long mod) {
        return ((a + b) % mod + mod) % mod;
    }

    public static long gcd(long a, long b) {
        if(b == 0)
            return a;
        return gcd(b, a % b);
    }

    //mul must be < 10^18
    public static long mulmod(long a, long b, long mod) {
        return (a * b + (((a * b) / mod) + 1) * mod) % mod;
    }
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

ll GCD(ll a, ll b) {
    return b ? GCD(b, a%b) : a;
}

bool is_prime(int n) {
    for (int i=2; i*i<=n; ++i) {
        if (n % i == 0) return false;
    }
    return true;
}

int main() {
    int T;
    scanf("%d", &T);
    while (T--) {
        int n;
        scanf("%d", &n);
        int p1 = n, p2 = n+1;
        while (!is_prime(p1)) p1--;
        while (!is_prime(p2)) p2++;
        ll a = (ll)p2*(p1-2) + 2LL*(n-p1+1);
        ll b = 2LL * p1 * p2;
        ll c = GCD(a, b);
        printf("%I64d/%I64d\n", a/c, b/c);
    }
    return 0;
}


/*               ______  ______
 \      / |\   |    |    |       |    |  |   |
  \    /  | \  |    |    |____   |____|  |___|
   \  /   |  \ |    |        |   |    |  |   |
    \/    |   \|    |   _____|   |    |  |   |

  -----------IIT Indore----------*/
#include<bits/stdc++.h>
#define rep(i,start,lim) for(long long i=start;i<lim;i++)
#define repd(i,start,lim) for(long long i=start;i>=lim;i--)
#define scan(x) scanf("%lld",&x)
#define print(x) printf("%lld ",x)
#define sz(a) lld((a).size())
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define YES printf("YES\n")
#define NO printf("NO\n")
#define all(c) (c).begin(),(c).end()
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define tr(it,c) for(__typeof(c.begin()) it = c.begin(); it!=c.end(); ++it)
#define br printf("\n")
#define checkbit(n,b) ((n>>b)&1)
#define TRACE
#ifdef TRACE
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#else
#define trace1(x)                printf("")
#define trace2(x, y)             printf("")
#define trace3(x, y, z)          printf("")
#define trace4(a, b, c, d)       printf("")
#define trace5(a, b, c, d, e)    printf("")
#define trace6(a, b, c, d, e, f) printf("")
#endif
#define INF         1011111111
#define LLINF       1000111000111000111LL
#define EPS         (double)1e-10
#define MOD         1000000007
#define PI          3.14159265358979323
using namespace std;
typedef long double ldb;
typedef long long lld;
lld powm(lld base,lld exp,lld mod=MOD) {lld ans=1;while(exp){if(exp&1) ans=(ans*base)%mod;exp>>=1,base=(base*base)%mod;}return ans;}
typedef vector<lld> vlld;
typedef pair<lld,lld> plld;
typedef map<lld,lld> mlld;
typedef set<lld> slld;
inline lld lcm(lld a,lld b){ return (a/__gcd(a, b))*b; }
template<typename T1, typename T2> inline pair<T1, T2> operator+(const pair<T1, T2> &p1 , const pair<T1, T2> &p2) { return pair<T1, T2>(p1.first + p2.first, p1.second + p2.second); }
template<typename T1, typename T2> inline pair<T1, T2> operator-(const pair<T1, T2> &p1 , const pair<T1, T2> &p2) { return pair<T1, T2>(p1.first - p2.first, p1.second - p2.second); }
#define DA(a,n) cout<<#a<<"=["; printarray(a,n); cout<<"]\n"
#define DAR(a,n,s) cout<<#a<<"["<<s<<"-"<<n-1<<"]=["; printarray(a,n,s); cout<<"]\n"
template<typename T, typename T2>void printarray(T a[], T2 sz, T2 beg = 0){ for (T2 i = beg; i<sz; i++) cout << a[i] << " "; }
#define N 100005
lld find(lld a,lld b)
{
	if(a==0) return b;
	if(b==0) return a;
	if(a==b) return a;
	if(a<b) swap(a,b);
	return find(a%b,b);
}
int main()
{
	lld t,n,chhota,bada;
	scan(t);
	while(t--)
	{
		scan(n);
		repd(i,n,2)
		{
			lld curr=i,flag=0;
			for(lld j=2;j*j<=curr;j++) if(curr%j==0) {flag=1;break;}
			if(!flag) {chhota=i;break;}
		}
		rep(i,n+1,n+100)
		{
			lld curr=i,flag=0;
			for(lld j=2;j*j<=curr;j++) if(curr%j==0) {flag=1;break;}
			if(!flag) {bada=i;break;}
		}
		//cout<<chhota<<" "<<bada<<endl;
		lld num=chhota*bada - 2*bada + 2*n - 2*chhota + 2;
		lld den= 2*chhota*bada,g=find(num,den);
		//cout<<num<<" "<<den<<endl;
		num/=g,den/=g;cout<<num<<"/"<<den<<endl;
	}
	return 0;
}


/*               ______  ______
 \      / |\   |    |    |       |    |  |   |
  \    /  | \  |    |    |____   |____|  |___|
   \  /   |  \ |    |        |   |    |  |   |
    \/    |   \|    |   _____|   |    |  |   |

  -----------IIT Indore----------*/
#include<bits/stdc++.h>
#define rep(i,start,lim) for(long long i=start;i<lim;i++)
#define repd(i,start,lim) for(long long i=start;i>=lim;i--)
#define scan(x) scanf("%lld",&x)
#define print(x) printf("%lld ",x)
#define sz(a) lld((a).size())
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define YES printf("YES\n")
#define NO printf("NO\n")
#define all(c) (c).begin(),(c).end()
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define tr(it,c) for(__typeof(c.begin()) it = c.begin(); it!=c.end(); ++it)
#define br printf("\n")
#define checkbit(n,b) ((n>>b)&1)
#define TRACE
#ifdef TRACE
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#else
#define trace1(x)                printf("")
#define trace2(x, y)             printf("")
#define trace3(x, y, z)          printf("")
#define trace4(a, b, c, d)       printf("")
#define trace5(a, b, c, d, e)    printf("")
#define trace6(a, b, c, d, e, f) printf("")
#endif
#define INF         1011111111
#define LLINF       1000111000111000111LL
#define EPS         (double)1e-10
#define MOD         1000000007
#define PI          3.14159265358979323
using namespace std;
typedef long double ldb;
typedef long long lld;
lld powm(lld base,lld exp,lld mod=MOD) {lld ans=1;while(exp){if(exp&1) ans=(ans*base)%mod;exp>>=1,base=(base*base)%mod;}return ans;}
typedef vector<lld> vlld;
typedef pair<lld,lld> plld;
typedef map<lld,lld> mlld;
typedef set<lld> slld;
inline lld lcm(lld a,lld b){ return (a/__gcd(a, b))*b; }
template<typename T1, typename T2> inline pair<T1, T2> operator+(const pair<T1, T2> &p1 , const pair<T1, T2> &p2) { return pair<T1, T2>(p1.first + p2.first, p1.second + p2.second); }
template<typename T1, typename T2> inline pair<T1, T2> operator-(const pair<T1, T2> &p1 , const pair<T1, T2> &p2) { return pair<T1, T2>(p1.first - p2.first, p1.second - p2.second); }
#define DA(a,n) cout<<#a<<"=["; printarray(a,n); cout<<"]\n"
#define DAR(a,n,s) cout<<#a<<"["<<s<<"-"<<n-1<<"]=["; printarray(a,n,s); cout<<"]\n"
template<typename T, typename T2>void printarray(T a[], T2 sz, T2 beg = 0){ for (T2 i = beg; i<sz; i++) cout << a[i] << " "; }
#define N 100005
lld find(lld a,lld b)
{
	if(a==0) return b;
	if(b==0) return a;
	if(a==b) return a;
	if(a<b) swap(a,b);
	return find(a%b,b);
}
int main()
{
	lld t,n,chhota,bada;
	scan(t);
	while(t--)
	{
		scan(n);
		repd(i,n,2)
		{
			lld curr=i,flag=0;
			for(lld j=2;j*j<=curr;j++) if(curr%j==0) {flag=1;break;}
			if(!flag) {chhota=i;break;}
		}
		rep(i,n+1,n+300)
		{
			lld curr=i,flag=0;
			for(lld j=2;j*j<=curr;j++) if(curr%j==0) {flag=1;break;}
			if(!flag) {bada=i;break;}
		}
		//cout<<chhota<<" "<<bada<<endl;
		lld num=chhota*bada - 2*bada + 2*n - 2*chhota + 2;
		lld den= 2*chhota*bada,g=find(num,den);
		//cout<<num<<" "<<den<<endl;
		num/=g,den/=g;cout<<num<<"/"<<den<<endl;
	}
	return 0;
}


/*               ______  ______
 \      / |\   |    |    |       |    |  |   |
  \    /  | \  |    |    |____   |____|  |___|
   \  /   |  \ |    |        |   |    |  |   |
    \/    |   \|    |   _____|   |    |  |   |

  -----------IIT Indore----------*/
#include<bits/stdc++.h>
#define rep(i,start,lim) for(long long i=start;i<lim;i++)
#define repd(i,start,lim) for(long long i=start;i>=lim;i--)
#define scan(x) scanf("%lld",&x)
#define print(x) printf("%lld ",x)
#define sz(a) lld((a).size())
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define YES printf("YES\n")
#define NO printf("NO\n")
#define all(c) (c).begin(),(c).end()
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define tr(it,c) for(__typeof(c.begin()) it = c.begin(); it!=c.end(); ++it)
#define br printf("\n")
#define checkbit(n,b) ((n>>b)&1)
#define TRACE
#ifdef TRACE
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#else
#define trace1(x)                printf("")
#define trace2(x, y)             printf("")
#define trace3(x, y, z)          printf("")
#define trace4(a, b, c, d)       printf("")
#define trace5(a, b, c, d, e)    printf("")
#define trace6(a, b, c, d, e, f) printf("")
#endif
#define INF         1011111111
#define LLINF       1000111000111000111LL
#define EPS         (double)1e-10
#define MOD         1000000007
#define PI          3.14159265358979323
using namespace std;
typedef long double ldb;
typedef long long lld;
lld powm(lld base,lld exp,lld mod=MOD) {lld ans=1;while(exp){if(exp&1) ans=(ans*base)%mod;exp>>=1,base=(base*base)%mod;}return ans;}
typedef vector<lld> vlld;
typedef pair<lld,lld> plld;
typedef map<lld,lld> mlld;
typedef set<lld> slld;
inline lld lcm(lld a,lld b){ return (a/__gcd(a, b))*b; }
template<typename T1, typename T2> inline pair<T1, T2> operator+(const pair<T1, T2> &p1 , const pair<T1, T2> &p2) { return pair<T1, T2>(p1.first + p2.first, p1.second + p2.second); }
template<typename T1, typename T2> inline pair<T1, T2> operator-(const pair<T1, T2> &p1 , const pair<T1, T2> &p2) { return pair<T1, T2>(p1.first - p2.first, p1.second - p2.second); }
#define DA(a,n) cout<<#a<<"=["; printarray(a,n); cout<<"]\n"
#define DAR(a,n,s) cout<<#a<<"["<<s<<"-"<<n-1<<"]=["; printarray(a,n,s); cout<<"]\n"
template<typename T, typename T2>void printarray(T a[], T2 sz, T2 beg = 0){ for (T2 i = beg; i<sz; i++) cout << a[i] << " "; }
#define N 100005
bool check(lld x)
{
	lld tmp=sqrt(x)+1;
	rep(i,2,tmp+1) if(x%i==0) return 0;
	return 1;
}
int main()
{
	lld t,n,chhota,bada;
	scan(t);
	while(t--)
	{
		scan(n);
		repd(i,n,2) if(check(i)) {chhota=i;break;}
		rep(i,n+1,n+50) if(check(i)) {bada=i;break;}
		lld num=chhota*bada - 2*bada + 2*n - 2*chhota + 2;
		lld den= 2*chhota*bada,g=__gcd(num,den);
		num/=g,den/=g;
		cout<<num<<"/"<<den<<endl;
	}
	return 0;
}


/*               ______  ______
 \      / |\   |    |    |       |    |  |   |
  \    /  | \  |    |    |____   |____|  |___|
   \  /   |  \ |    |        |   |    |  |   |
    \/    |   \|    |   _____|   |    |  |   |

  -----------IIT Indore----------*/
#include<bits/stdc++.h>
#define rep(i,start,lim) for(long long i=start;i<lim;i++)
#define repd(i,start,lim) for(long long i=start;i>=lim;i--)
#define scan(x) scanf("%lld",&x)
#define print(x) printf("%lld ",x)
#define sz(a) lld((a).size())
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define YES printf("YES\n")
#define NO printf("NO\n")
#define all(c) (c).begin(),(c).end()
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define tr(it,c) for(__typeof(c.begin()) it = c.begin(); it!=c.end(); ++it)
#define br printf("\n")
#define checkbit(n,b) ((n>>b)&1)
#define TRACE
#ifdef TRACE
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#else
#define trace1(x)                printf("")
#define trace2(x, y)             printf("")
#define trace3(x, y, z)          printf("")
#define trace4(a, b, c, d)       printf("")
#define trace5(a, b, c, d, e)    printf("")
#define trace6(a, b, c, d, e, f) printf("")
#endif
#define INF         1011111111
#define LLINF       1000111000111000111LL
#define EPS         (double)1e-10
#define MOD         1000000007
#define PI          3.14159265358979323
using namespace std;
typedef long double ldb;
typedef long long lld;
lld powm(lld base,lld exp,lld mod=MOD) {lld ans=1;while(exp){if(exp&1) ans=(ans*base)%mod;exp>>=1,base=(base*base)%mod;}return ans;}
typedef vector<lld> vlld;
typedef pair<lld,lld> plld;
typedef map<lld,lld> mlld;
typedef set<lld> slld;
inline lld lcm(lld a,lld b){ return (a/__gcd(a, b))*b; }
template<typename T1, typename T2> inline pair<T1, T2> operator+(const pair<T1, T2> &p1 , const pair<T1, T2> &p2) { return pair<T1, T2>(p1.first + p2.first, p1.second + p2.second); }
template<typename T1, typename T2> inline pair<T1, T2> operator-(const pair<T1, T2> &p1 , const pair<T1, T2> &p2) { return pair<T1, T2>(p1.first - p2.first, p1.second - p2.second); }
#define DA(a,n) cout<<#a<<"=["; printarray(a,n); cout<<"]\n"
#define DAR(a,n,s) cout<<#a<<"["<<s<<"-"<<n-1<<"]=["; printarray(a,n,s); cout<<"]\n"
template<typename T, typename T2>void printarray(T a[], T2 sz, T2 beg = 0){ for (T2 i = beg; i<sz; i++) cout << a[i] << " "; }
#define N 100005
int main()
{
	lld t,n,chhota,bada;
	scan(t);
	while(t--)
	{
		scan(n);
		repd(i,n,2)
		{
			lld curr=i,flag=0;
			for(lld j=2;j*j<=curr;j++) if(curr%j==0) {flag=1;break;}
			if(!flag) {chhota=i;break;}
		}
		rep(i,n+1,n+100)
		{
			lld curr=i,flag=0;
			for(lld j=2;j*j<=curr;j++) if(curr%j==0) {flag=1;break;}
			if(!flag) {bada=i;break;}
		}
		lld num=chhota*bada - 2*bada + 2*n - 2*chhota + 2;
		lld den= 2*chhota*bada,g=__gcd(num,den);
		num/=g,den/=g;cout<<num<<"/"<<den<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
#define pb push_back
#define all(X) X.begin(),X.end()
#define smin(X,Y) X=min(X,Y)
#define smax(X,Y) X=max(X,Y)
#define fi first
#define se second
#define fastIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
const int maxn = 1e5 + 5;
const int inf  = 1e9;
const int mod = 1e9 + 7;

int main(){
	fastIO;
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		int i;
		for(i = n;; i--){
			bool b = 0;
			for(int j = 2; j * j <= i; j++)
				if(i % j == 0)
					b = 1;
			if(!b) break;
		}
		int p = i;
		for(i = n + 1;; i++){
			bool b = 0;
			for(int j = 2; j * j <= i; j++)
				if(i % j == 0)
					b = 1;
			if(!b) break;
		}
		int q = i;
		long double ans = 1.0 / 2 - 1.0 / p;
		ans += 1.0 * (n - p + 1) / (p * q);
		cout<<(ans * 2 * p * q)<<'/'<<2ll * p * q<<endl;
	}
}


#include<bits/stdc++.h>
#define pb push_back
#define all(X) X.begin(),X.end()
#define smin(X,Y) X=min(X,Y)
#define smax(X,Y) X=max(X,Y)
#define fi first
#define se second
#define fastIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
const int maxn = 1e5 + 5;
const int inf  = 1e9;
const int mod = 1e9 + 7;

int main(){
	fastIO;
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		int i;
		for(i = n;; i--){
			bool b = 0;
			for(int j = 2; j * j <= i; j++)
				if(i % j == 0)
					b = 1;
			if(!b) break;
		}
		int p = i;
		for(i = n + 1;; i++){
			bool b = 0;
			for(int j = 2; j * j <= i; j++)
				if(i % j == 0)
					b = 1;
			if(!b) break;
		}
		int q = i;
		long double ans = 1.0 / 2 - 1.0 / p;
		ans += 1.0 * (n - p + 1) / (p * q);
		int g = __gcd(2ll * p * q, 1ll * p * q - 2ll * q + 2ll * (n - p + 1));
		cout<<(1ll * p * q - 2ll * q + 2ll * (n - p + 1)) / g<<'/'<<(2ll * p * q) / g<<endl;
	}
}


#include<bits/stdc++.h>
#define pb push_back
#define all(X) X.begin(),X.end()
#define smin(X,Y) X=min(X,Y)
#define smax(X,Y) X=max(X,Y)
#define fi first
#define se second
#define fastIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
const int maxn = 1e5 + 5;
const int inf  = 1e9;
const int mod = 1e9 + 7;

int main(){
	fastIO;
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		int i;
		for(i = n;; i--){
			bool b = 0;
			for(int j = 2; 1ll * j * j <= 1ll * i; j++)
				if(i % j == 0){
					b = 1;
					break;
				}
			if(!b) break;
		}
		int p = i;
		for(i = n + 1;; i++){
			bool b = 0;
			for(int j = 2; 1ll * j * j <= 1ll * i; j++)
				if(i % j == 0){
					b = 1;
					break;
				}
			if(!b) break;
		}
		int q = i;
		ll g = __gcd(2ll * p * q, 1ll * p * q - 2ll * q + 2ll * (n - p + 1));
		cout<<(1ll * p * q - 2ll * q + 2ll * (n - p + 1)) / g<<'/'<<(2ll * p * q) / g<<'\n';
	}
}


#include<bits/stdc++.h>
#define pb push_back
#define all(X) X.begin(),X.end()
#define smin(X,Y) X=min(X,Y)
#define smax(X,Y) X=max(X,Y)
#define fi first
#define se second
#define fastIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
const int maxn = 1e5 + 5;
const int inf  = 1e9;
const int mod = 1e9 + 7;

int main(){
	fastIO;
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		int i;
		for(i = n;; i--){
			bool b = 0;
			for(ll j = 2; j * j <= i; j++)
				if(i % j == 0)
					b = 1;
			if(!b) break;
		}
		int p = i;
		for(i = n + 1;; i++){
			bool b = 0;
			for(ll j = 2; j * j <= i; j++)
				if(i % j == 0)
					b = 1;
			if(!b) break;
		}
		int q = i;
		ll g = __gcd(2ll * p * q, 1ll * p * q - 2ll * q + 2ll * (n - p + 1));
		cout<<(1ll * p * q - 2ll * q + 2ll * (n - p + 1)) / g<<'/'<<(2ll * p * q) / g<<'\n';
	}
}


#include<bits/stdc++.h>
#define pb push_back
#define all(X) X.begin(),X.end()
#define smin(X,Y) X=min(X,Y)
#define smax(X,Y) X=max(X,Y)
#define fi first
#define se second
#define fastIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
const int maxn = 1e5 + 5;
const int inf  = 1e9;
const int mod = 1e9 + 7;

int main(){
	fastIO;
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		int i;
		for(i = n;; i--){
			bool b = 0;
			for(int j = 2; 1ll * j * j <= 1ll * i; j++)
				if(i % j == 0)
					b = 1;
			if(!b) break;
		}
		int p = i;
		for(i = n + 1;; i++){
			bool b = 0;
			for(int j = 2; 1ll * j * j <= 1ll * i; j++)
				if(i % j == 0)
					b = 1;
			if(!b) break;
		}
		int q = i;
		ll g = __gcd(2ll * p * q, 1ll * p * q - 2ll * q + 2ll * (n - p + 1));
		cout<<(1ll * p * q - 2ll * q + 2ll * (n - p + 1)) / g<<'/'<<(2ll * p * q) / g<<'\n';
	}
}


#include<bits/stdc++.h>
#define pb push_back
#define all(X) X.begin(),X.end()
#define smin(X,Y) X=min(X,Y)
#define smax(X,Y) X=max(X,Y)
#define fi first
#define se second
#define fastIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
const int maxn = 1e5 + 5;
const int inf  = 1e9;
const int mod = 1e9 + 7;

int main(){
	fastIO;
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		int i;
		for(i = n;; i--){
			bool b = 0;
			for(int j = 2; j * j <= i; j++)
				if(i % j == 0)
					b = 1;
			if(!b) break;
		}
		int p = i;
		for(i = n + 1;; i++){
			bool b = 0;
			for(int j = 2; j * j <= i; j++)
				if(i % j == 0)
					b = 1;
			if(!b) break;
		}
		int q = i;
		int g = __gcd(2ll * p * q, 1ll * p * q - 2ll * q + 2ll * (n - p + 1));
		cout<<(1ll * p * q - 2ll * q + 2ll * (n - p + 1)) / g<<'/'<<(2ll * p * q) / g<<'\n';
	}
}


#include<bits/stdc++.h>
using namespace std;

#define scl(x) scanf("%lld",&x)
#define sc(x)  scanf("%d",&x)
#define ll long long
#define lop(i,n) for(int i=0;i<n;++i)
typedef pair<int,int> ii;
typedef pair<ll,ll> pll;

bool isPrime(int x){
	for(int i=2;i*i<=x;i++)
		if(x%i==0)return 0;
	return 1;
}
ll gcd(ll x,ll y){
	return (!x ? y : gcd(y%x,x));
}

int main(){
#ifndef ONLINE_JUDGE
	freopen("i.txt","r",stdin);
#endif
	int t;sc(t);
	lop(C,t){
		int n;
		sc(n);
		ll p=n,q=n+1;
		while(!isPrime(q))q++;
		while(!isPrime(p))p--;
		ll a=(p-2)*q+2*(n-p+1),b=2*p*q;
		ll g=gcd(a,b);
		a/=g,b/=g;
		printf("%lld/%lld\n",a,b);
	}
}


#include <iostream>

using namespace std;

typedef long long ll;

bool prime(ll x)
{
	if (x % 2 == 0)
		return false;
	for (ll i = 3; i * i <= x; i += 2)
		if (x % i == 0)
			return false;
	return true;
}

int main()
{
	int t, n;
	cin >> t;
	while (t--)
	{
		cin >> n;
		ll p1 = n, p2 = n + 1;
		for (; p1 >= 0; p1--)
			if (prime(p1))
				break;
		for (; 1; p2++)
			if (prime(p2))
				break;
		ll q = (ll) ((p1 - 2) * (p2 - 2) - 2 + 2 * n);
		cout << q << "/" << (ll) (2 * p1 * p2) << endl;
	}
	return 0;
}


#include <iostream>
#include <algorithm>

using namespace std;

typedef long long ll;

bool prime(ll x)
{
	if (x % 2 == 0)
		return false;
	for (ll i = 3; i * i <= x; i += 2)
		if (x % i == 0)
			return false;
	return true;
}

int main()
{
	int t, n;
	cin >> t;
	while (t--)
	{
		cin >> n;
		ll p1 = n, p2 = n + 1;
		for (; p1 >= 0; p1--)
			if (prime(p1))
				break;
		for (; 1; p2++)
			if (prime(p2))
				break;
		ll q = (ll) ((p1 - 2) * (p2 - 2) - 2 + 2 * n);
		ll d = (ll) (2 * p1 * p2);
		ll gcd = __gcd(q, d);
		q /= gcd;
		d /= gcd;
		cout << q << "/" << d << endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

ifstream in("test.in");
ofstream out("test.out");

const int DIM = 4e4 + 5;
const int MOD = 1e9 + 7;

bool oki[DIM];
vector<int> lst;

bool check(int x) {
    for(int y : lst) {
        if(y * y > x)
            break;
        if(x % y == 0)
            return false;
    }

    return true;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(); cout.tie();

    for(int i = 2; i < DIM; ++i) {
        if(!oki[i]) {
            lst.push_back(i);

            for(int j = i + i; j < DIM; j += i)
                oki[j] = true;
        }
    }

    int q;
    cin >> q;

    while(q--) {
        int x, p1, p2;
        cin >> x;

        for(p1 = x + 0; !check(p1); --p1);
        for(p2 = x + 1; !check(p2); ++p2);

        long long a = 2LL * x - 2LL * p1 - 2LL * p2 + 1LL * p1 * p2 + 2LL,
                  b = 2LL * p1 * p2;

        cout << a / __gcd(a, b) << "/" << b / __gcd(a, b) << "\n";
    }

    return 0;
}


/* be name Khoda */
#include <bits/stdc++.h>
using namespace std;

int t, n;

bool prime(int m) {
	for (int i = 2; 1LL * i * i <= m; i++)
		if (m % i == 0)
			return false;
	return m > 1;
}

int main() {
	cin >> t;
	while (t--) {
		int l = 0, r = 0;
		cin >> n;
		for (int i = n + 1; ; i++)
			if (prime(i)) {
				r = i;
				break;
			}
		for (int i = n; ; i--)
			if (prime(i)) {
				l = i;
				break;
			}
		int dis = r - n - 1;
//		cout << l << "  " << r << " /// " << dis << "  \n";
		// 1 / 2 - 1 / r + dis * 1 / (l * r);
		long long t1 = 1LL * l * r * 2,
			t2 = 1LL * l * r - 2 * l - dis * 2;
		if (t1 % 2 == t2 % 2)
			t1 /= 2, t2 /= 2;
		cout << t2 << "/" << t1 << endl;
	}
}


/* be name Khoda */
#include <bits/stdc++.h>
using namespace std;

int t, n;

bool prime(int m) {
	for (int i = 2; 1LL * i * i <= m; i++)
		if (m % i == 0)
			return false;
	return m > 1;
}

int main() {
	cin >> t;
	while (t--) {
		int l = 0, r = 0;
		cin >> n;
		for (int i = n + 1; ; i++)
			if (prime(i)) {
				r = i;
				break;
			}
		for (int i = n; ; i--)
			if (prime(i)) {
				l = i;
				break;
			}
		int dis = r - n - 1;
//		cout << l << "  " << r << " /// " << dis << "  \n";
		// 1 / 2 - 1 / r + dis * 1 / (l * r);
		long long t1 = 1LL * l * r * 2,
			t2 = 1LL * l * r - 2 * l - dis * 2;
		while (__gcd(t1, t2) > 1) {
			int gcd = __gcd(t1, t2);
			t1 /= gcd, t2 /= gcd;
		}
		cout << t2 << "/" << t1 << endl;
	}
}


#include <stdio.h>
#include <string.h>
#include <iostream>

using namespace std;
const int N = 1e5+10;
typedef long long ll;

int cnt, prime[N], flag[N];

void init () {
	cnt = 0;
	memset(flag, 0, sizeof(flag));

	for (int i = 2; i < N; i++) if (!flag[i]) {
		prime[cnt++] = i;
		for (int j = i*2; j < N; j += i) flag[j] = 1;
	}
}

bool isPrime (int k) {
	if (k < N) return !flag[k];

	for (int i = 0; i < cnt && prime[i] <= k; i++)
		if (k%prime[i] == 0) return false;
	return true;
}

ll under (int n) {
	for (int i = n; i >= 2; i--)
		if (isPrime(i)) return i;
	return 0;
}

ll up (int n) {
	for (int i = n + 1; i; i++)
		if (isPrime(i)) return i;
	return 0;
}

int gcd(ll p, ll q) {
	if (!q) return p;
	else return gcd(q, p%q);
}

int main () {
	init();

	int cas, n;
	scanf("%d", &cas);
	while (cas--) {
		scanf("%d", &n);
		ll v = under(n);
		ll u = up(n);

		ll p = u*v + 2*(n-v-u+1);
		ll q = 2*u*v;

		ll d = gcd(p, q);
		cout << p/d << "/" << q/d << endl;
	}
	return 0;
}
//hello


#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <cstring>
#include <cmath>
#include <climits>
#include <string>
#include <fstream>
#include <stdlib.h>
#include <bitset>
#include <ctime>
#include <iomanip>

using namespace std;

#define I64_IO

#define ARGS_NUM(...) ARGS_NUM_IMPL_((0,__VA_ARGS__,5,4,3,2,1))
#define ARGS_NUM_IMPL_(arg) ARGS_NUM_IMPL arg
#define ARGS_NUM_IMPL(_0,_1,_2,_3,_4,_5, N,...) N
#define FUNC_CALL(func, ...) FUNC_CALL_NUM(func, ARGS_NUM(__VA_ARGS__))
#define FUNC_CALL_NUM(func, args) FUNC_CALL_NUM_(func, args)
#define FUNC_CALL_NUM_(func, args) FUNC_CALL_NUM__(func, args)
#define FUNC_CALL_NUM__(func, args) func ## args

// i/o defines
#define read_int1(v) scanf("%d", &v)
#define read_int2(v1, v2) scanf("%d%d", &v1, &v2)
#define read_int3(v1, v2, v3) scanf("%d%d%d", &v1, &v2, &v3)
#define read_int4(v1, v2, v3, v4) scanf("%d%d%d%d", &v1, &v2, &v3, &v4)
#define read_int(...) FUNC_CALL(read_int, __VA_ARGS__)(__VA_ARGS__)
#ifdef I64_IO
#define read_ll1(v) scanf(MODE ? "%lld" : "%I64d", &v)
#define read_ll2(v1, v2) scanf(MODE ? "%lld%lld" : "%I64d%I64d", &v1, &v2)
#define read_ll3(v1, v2, v3) scanf(MODE ? "%lld%lld%lld" : "%I64d%I64d%I64d", &v1, &v2, &v3)
#define read_ll4(v1, v2, v3, v4) scanf(MODE ?"%lld%lld%lld%lld" : "%I64d%I64d%I64d%I64d", &v1, &v2, &v3, &v4)
#define print_ll(v) printf(MODE ? "%lld" : "%I64d", v)
#else
#define read_ll1(v) scanf( "%lld" , &v)
#define read_ll2(v1, v2) scanf( "%lld%lld" , &v1, &v2)
#define read_ll3(v1, v2, v3) scanf( "%lld%lld%lld" , &v1, &v2, &v3)
#define read_ll4(v1, v2, v3, v4) scanf("%lld%lld%lld%lld", &v1, &v2, &v3, &v4)
#define print_ll(v) printf("%lld" , v)
#endif
#define read_ll(...) FUNC_CALL(read_ll, __VA_ARGS__)(__VA_ARGS__)
#define read_str(v) scanf("%s", v)
#define print_str(v) printf("%s", v)
#define read_f(v) scanf("%f", &v)
#define print_f(v, prec) printf("%.*f", prec, v)
#define read_lf1(v) scanf("%lf", &v)
#define read_lf2(v1, v2) scanf("%lf%lf", &v1, &v2)
#define read_lf3(v1, v2, v3) scanf("%lf%lf%lf", &v1, &v2, &v3)
#define read_lf(...) FUNC_CALL(read_lf, __VA_ARGS__)(__VA_ARGS__)
#define print_lf(v, prec) printf("%.*lf", prec, v)
#define print_int(v) printf("%d", v)

//short defines
#define ll long long
#define ull unsigned long long
#define uchar unsigned char
#define pi 3.141592653589793238462643383279
#define eps (1e-8)
#define minn(a, b) a = min((a), (b))
#define maxx(a, b) a = max((a), (b))
#define all(v) v.begin(),v.end()
#define sz(v) ((int)v.size())
#define ln putchar('\n')
#define space putchar(' ')
#define pair_i pair <int, int>
#define pair_ll pair <ll,ll>

// debug defines
#define PRINT(...) MODE ? (FUNC_CALL(PRINT, __VA_ARGS__)(__VA_ARGS__)) : cout
#define PRINT1(a) cout << #a << " = " << (a) << "\n"
#define PRINT2(a,b) cout << #a << " = " << (a) << "," << #b << " = " << (b) << "\n"
#define PRINT3(a,b,c) cout << #a << " = " << (a) << "," << #b << " = " << (b) << "," << #c << " = " << (c) << "\n"
#define PRINT4(a,b,c,d) cout << #a << " = " << (a) << "," << #b << " = " << (b) << "," << #c << " = " << (c) << "," << #d << " = " << (d) << "\n"
#define BP MODE ? break_point() : 0
#define LINE MODE ? printf("-------------------------------\n") : 0
#define LOG(...) MODE ? printf(__VA_ARGS__) : 0

// useful functions
int break_point(){ char c; while ((c = getchar()) != '\n'); return 0; }
template <typename T> void read_integer(T &r){ bool sign = 0; r = 0; char c; while (1){ c = getchar(); if (c == '-'){ sign = 1; break; }if (c != ' ' && c != '\n'){ r = c - '0'; break; } }while (1){ c = getchar(); if (c == ' ' || c == '\n')break; r = r * 10 + (c - '0'); }if (sign)r = -r; }
ll binpowmod(ll a, ll b, ll mod){ if (b == 0)return 1; ll c = binpowmod(a, b >> 1, mod); return (((c*c) % mod) * (b & 1 ? a : 1)) % mod; }
ll binpow(ll a, ll b){ if (b == 0)return 1; ll c = binpow(a, b >> 1); return c*c*(b & 1 ? a : 1); }
inline int getbit(int x, int b){ return (x >> b) & 1; }
inline int setbit(int x, int b){ return x | (1 << b); }
inline void _setbit(int &x, int b){ x = setbit(x, b); }
inline ll setbit(ll x, int b){ return x | (1ll << b); }
inline void _setbit(ll &x, int b){ x = setbit(x, b); }
inline int unsetbit(int x, int b){ return x & (INT_MAX - (1 << b)); }
inline void _unsetbit(int &x, int b){ x = unsetbit(x, b); }
inline int countbit(int x){ x = x - ((x >> 1) & 0x55555555); x = (x & 0x33333333) + ((x >> 2) & 0x33333333); return ((x + (x >> 4) & 0xF0F0F0F) * 0x1010101) >> 24; }
inline ll countbit(ll x){ return countbit(int(x & INT_MAX)) + countbit(int(x >> 32) & INT_MAX); }
inline void printbit(int x, int len){ for (int i = len - 1; i >= 0; i--) print_int(getbit(x, i)); }
int gcd(int a, int b){ return b == 0 ? a : gcd(b, a%b); }
ll gcd(ll a, ll b){ return b == 0 ? a : gcd(b, a%b); }

template <typename A, typename B> ostream& operator<<(ostream& stream, const pair <A, B> &p){ stream << "{" << p.first << "," << p.second << "}"; return stream; }
template <typename A> ostream& operator<<(ostream &stream, const vector <A> &v){ stream << "["; for (auto itr = v.begin(); itr != v.end(); itr++)stream << *itr << " "; stream << "]"; return stream; }
template <typename A, typename B> ostream& operator<<(ostream &stream, const map <A, B> &v){ stream << "["; for (auto itr = v.begin(); itr != v.end(); itr++)stream << *itr << " "; stream << "]"; return stream; }
template <typename A> ostream& operator<<(ostream &stream, const set <A> &v){ stream << "["; for (auto itr = v.begin(); itr != v.end(); itr++)stream << *itr << " "; stream << "]"; return stream; }
template <typename A> ostream& operator<<(ostream &stream, const stack <A> &v){ stack <A> st = v; stream << "["; while (!st.empty()){ stream << st.top() << " "; st.pop(); }stream << "]"; return stream; }
template <typename A> ostream& operator<<(ostream &stream, const priority_queue <A> &v){ priority_queue <A> q = v; stream << "["; while (!q.empty()){ stream << q.top() << " "; q.pop(); }stream << "]"; return stream; }
template <typename A> ostream& operator<<(ostream &stream, const queue <A> &v){queue <A> q = v;stream << "[";while (!q.empty()){stream << q.front() << " ";q.pop();}stream << "]";return stream;}
template <typename A> ostream& operator<<(ostream &stream, const deque <A> &v){deque <A> q = v;stream << "[";while (!q.empty()){stream << q.front() << " ";q.pop_front();}stream << "]";return stream;}

void run();

#ifndef MODE
#define MODE 0
#endif
//#define FILES "distance3"
//#define FROM_FILE

int main()
{
    srand(time(NULL));
#ifdef FILES
    freopen(FILES".in", "r", stdin);
    freopen(FILES".out", "w", stdout);
#else
#ifdef FROM_FILE
    freopen("file.in", "r", stdin);
#endif
#endif
#ifdef MULTITEST
    do
    {
#endif
        run();
#ifdef MULTITEST
        if (MODE)
        {
            LINE;
            LINE;
        }
    } while (MODE);
#endif
    return 0;
}

//----------------------------------
//----------------------------------

const int mod = 1e9+7;
const int N = 100005;

bool isPrime(int x)
{
    for(int i = 2; i * i <= x; ++i)
        if(x % i == 0)
            return false;
    return true;
}

struct Fraction
{
    ll a, b;
    Fraction(ll _a, ll _b)
        : a(_a)
        , b(_b)
    {}

    Fraction operator+(const Fraction& other) const
    {
        ll g = b / gcd(b, other.b) * other.b;
        ll x = a * (g / b) + other.a * (g / other.b);
        ll q = gcd(x, g);
        x /= q;
        g /= q;
        return Fraction(x, g);

    }
    Fraction operator-(const Fraction& other) const
    {
        ll g = b / gcd(b, other.b) * other.b;
        ll x = a * (g / b) - other.a * (g / other.b);
        ll q = gcd(x, g);
        x /= q;
        g /= q;
        return Fraction(x, g);
    }

};

void run()
{
    int T;
    read_int(T);
    while(T--)
    {
        int n;
        read_int(n);
        int m = n;
        while(!isPrime(m+1))
            --m;
        int nxt_prime = n+1;
        while(!isPrime(nxt_prime))
            ++nxt_prime;
        Fraction res = Fraction(1, 2) - Fraction(1, m+1) + Fraction(n-m, (m+1) * nxt_prime);
        PRINT(1, m+1, n-m, nxt_prime);
        print_ll(res.a);putchar('/');
        print_ll(res.b);ln;
    }
}


#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <cstring>
#include <cmath>
#include <climits>
#include <string>
#include <fstream>
#include <stdlib.h>
#include <bitset>
#include <ctime>
#include <iomanip>

using namespace std;

#define I64_IO

#define ARGS_NUM(...) ARGS_NUM_IMPL_((0,__VA_ARGS__,5,4,3,2,1))
#define ARGS_NUM_IMPL_(arg) ARGS_NUM_IMPL arg
#define ARGS_NUM_IMPL(_0,_1,_2,_3,_4,_5, N,...) N
#define FUNC_CALL(func, ...) FUNC_CALL_NUM(func, ARGS_NUM(__VA_ARGS__))
#define FUNC_CALL_NUM(func, args) FUNC_CALL_NUM_(func, args)
#define FUNC_CALL_NUM_(func, args) FUNC_CALL_NUM__(func, args)
#define FUNC_CALL_NUM__(func, args) func ## args

// i/o defines
#define read_int1(v) scanf("%d", &v)
#define read_int2(v1, v2) scanf("%d%d", &v1, &v2)
#define read_int3(v1, v2, v3) scanf("%d%d%d", &v1, &v2, &v3)
#define read_int4(v1, v2, v3, v4) scanf("%d%d%d%d", &v1, &v2, &v3, &v4)
#define read_int(...) FUNC_CALL(read_int, __VA_ARGS__)(__VA_ARGS__)
#ifdef I64_IO
#define read_ll1(v) scanf(MODE ? "%lld" : "%I64d", &v)
#define read_ll2(v1, v2) scanf(MODE ? "%lld%lld" : "%I64d%I64d", &v1, &v2)
#define read_ll3(v1, v2, v3) scanf(MODE ? "%lld%lld%lld" : "%I64d%I64d%I64d", &v1, &v2, &v3)
#define read_ll4(v1, v2, v3, v4) scanf(MODE ?"%lld%lld%lld%lld" : "%I64d%I64d%I64d%I64d", &v1, &v2, &v3, &v4)
#define print_ll(v) printf(MODE ? "%lld" : "%I64d", v)
#else
#define read_ll1(v) scanf( "%lld" , &v)
#define read_ll2(v1, v2) scanf( "%lld%lld" , &v1, &v2)
#define read_ll3(v1, v2, v3) scanf( "%lld%lld%lld" , &v1, &v2, &v3)
#define read_ll4(v1, v2, v3, v4) scanf("%lld%lld%lld%lld", &v1, &v2, &v3, &v4)
#define print_ll(v) printf("%lld" , v)
#endif
#define read_ll(...) FUNC_CALL(read_ll, __VA_ARGS__)(__VA_ARGS__)
#define read_str(v) scanf("%s", v)
#define print_str(v) printf("%s", v)
#define read_f(v) scanf("%f", &v)
#define print_f(v, prec) printf("%.*f", prec, v)
#define read_lf1(v) scanf("%lf", &v)
#define read_lf2(v1, v2) scanf("%lf%lf", &v1, &v2)
#define read_lf3(v1, v2, v3) scanf("%lf%lf%lf", &v1, &v2, &v3)
#define read_lf(...) FUNC_CALL(read_lf, __VA_ARGS__)(__VA_ARGS__)
#define print_lf(v, prec) printf("%.*lf", prec, v)
#define print_int(v) printf("%d", v)

//short defines
#define ll long long
#define ull unsigned long long
#define uchar unsigned char
#define pi 3.141592653589793238462643383279
#define eps (1e-8)
#define minn(a, b) a = min((a), (b))
#define maxx(a, b) a = max((a), (b))
#define all(v) v.begin(),v.end()
#define sz(v) ((int)v.size())
#define ln putchar('\n')
#define space putchar(' ')
#define pair_i pair <int, int>
#define pair_ll pair <ll,ll>

// debug defines
#define PRINT(...) MODE ? (FUNC_CALL(PRINT, __VA_ARGS__)(__VA_ARGS__)) : cout
#define PRINT1(a) cout << #a << " = " << (a) << "\n"
#define PRINT2(a,b) cout << #a << " = " << (a) << "," << #b << " = " << (b) << "\n"
#define PRINT3(a,b,c) cout << #a << " = " << (a) << "," << #b << " = " << (b) << "," << #c << " = " << (c) << "\n"
#define PRINT4(a,b,c,d) cout << #a << " = " << (a) << "," << #b << " = " << (b) << "," << #c << " = " << (c) << "," << #d << " = " << (d) << "\n"
#define BP MODE ? break_point() : 0
#define LINE MODE ? printf("-------------------------------\n") : 0
#define LOG(...) MODE ? printf(__VA_ARGS__) : 0

// useful functions
int break_point(){ char c; while ((c = getchar()) != '\n'); return 0; }
template <typename T> void read_integer(T &r){ bool sign = 0; r = 0; char c; while (1){ c = getchar(); if (c == '-'){ sign = 1; break; }if (c != ' ' && c != '\n'){ r = c - '0'; break; } }while (1){ c = getchar(); if (c == ' ' || c == '\n')break; r = r * 10 + (c - '0'); }if (sign)r = -r; }
ll binpowmod(ll a, ll b, ll mod){ if (b == 0)return 1; ll c = binpowmod(a, b >> 1, mod); return (((c*c) % mod) * (b & 1 ? a : 1)) % mod; }
ll binpow(ll a, ll b){ if (b == 0)return 1; ll c = binpow(a, b >> 1); return c*c*(b & 1 ? a : 1); }
inline int getbit(int x, int b){ return (x >> b) & 1; }
inline int setbit(int x, int b){ return x | (1 << b); }
inline void _setbit(int &x, int b){ x = setbit(x, b); }
inline ll setbit(ll x, int b){ return x | (1ll << b); }
inline void _setbit(ll &x, int b){ x = setbit(x, b); }
inline int unsetbit(int x, int b){ return x & (INT_MAX - (1 << b)); }
inline void _unsetbit(int &x, int b){ x = unsetbit(x, b); }
inline int countbit(int x){ x = x - ((x >> 1) & 0x55555555); x = (x & 0x33333333) + ((x >> 2) & 0x33333333); return ((x + (x >> 4) & 0xF0F0F0F) * 0x1010101) >> 24; }
inline ll countbit(ll x){ return countbit(int(x & INT_MAX)) + countbit(int(x >> 32) & INT_MAX); }
inline void printbit(int x, int len){ for (int i = len - 1; i >= 0; i--) print_int(getbit(x, i)); }
int gcd(int a, int b){ return b == 0 ? a : gcd(b, a%b); }
ll gcd(ll a, ll b){ return b == 0 ? a : gcd(b, a%b); }

template <typename A, typename B> ostream& operator<<(ostream& stream, const pair <A, B> &p){ stream << "{" << p.first << "," << p.second << "}"; return stream; }
template <typename A> ostream& operator<<(ostream &stream, const vector <A> &v){ stream << "["; for (auto itr = v.begin(); itr != v.end(); itr++)stream << *itr << " "; stream << "]"; return stream; }
template <typename A, typename B> ostream& operator<<(ostream &stream, const map <A, B> &v){ stream << "["; for (auto itr = v.begin(); itr != v.end(); itr++)stream << *itr << " "; stream << "]"; return stream; }
template <typename A> ostream& operator<<(ostream &stream, const set <A> &v){ stream << "["; for (auto itr = v.begin(); itr != v.end(); itr++)stream << *itr << " "; stream << "]"; return stream; }
template <typename A> ostream& operator<<(ostream &stream, const stack <A> &v){ stack <A> st = v; stream << "["; while (!st.empty()){ stream << st.top() << " "; st.pop(); }stream << "]"; return stream; }
template <typename A> ostream& operator<<(ostream &stream, const priority_queue <A> &v){ priority_queue <A> q = v; stream << "["; while (!q.empty()){ stream << q.top() << " "; q.pop(); }stream << "]"; return stream; }
template <typename A> ostream& operator<<(ostream &stream, const queue <A> &v){queue <A> q = v;stream << "[";while (!q.empty()){stream << q.front() << " ";q.pop();}stream << "]";return stream;}
template <typename A> ostream& operator<<(ostream &stream, const deque <A> &v){deque <A> q = v;stream << "[";while (!q.empty()){stream << q.front() << " ";q.pop_front();}stream << "]";return stream;}

void run();

#ifndef MODE
#define MODE 0
#endif
//#define FILES "distance3"
//#define FROM_FILE

int main()
{
    srand(time(NULL));
#ifdef FILES
    freopen(FILES".in", "r", stdin);
    freopen(FILES".out", "w", stdout);
#else
#ifdef FROM_FILE
    freopen("file.in", "r", stdin);
#endif
#endif
#ifdef MULTITEST
    do
    {
#endif
        run();
#ifdef MULTITEST
        if (MODE)
        {
            LINE;
            LINE;
        }
    } while (MODE);
#endif
    return 0;
}

//----------------------------------
//----------------------------------

const int mod = 1e9+7;
const int N = 100005;

bool isPrime(int x)
{
    for(int i = 2; i * i <= x; ++i)
        if(x % i == 0)
            return false;
    return true;
}

struct Fraction
{
    ll a, b;
    Fraction(ll _a, ll _b)
        : a(_a)
        , b(_b)
    {}

    Fraction operator+(const Fraction& other) const
    {
        ll g = b / gcd(b, other.b) * other.b;
        ll x = a * (g / b) + other.a * (g / other.b);
        ll q = gcd(x, g);
        x /= q;
        g /= q;
        return Fraction(x, g);

    }
    Fraction operator-(const Fraction& other) const
    {
        ll g = b / gcd(b, other.b) * other.b;
        ll x = a * (g / b) - other.a * (g / other.b);
        ll q = gcd(x, g);
        x /= q;
        g /= q;
        return Fraction(x, g);
    }

};

void run()
{
    int T;
    read_int(T);
    while(T--)
    {
        int n;
        read_int(n);
        int m = n;
        while(!isPrime(m+1))
            --m;
        int nxt_prime = n+1;
        while(!isPrime(nxt_prime))
            ++nxt_prime;
        Fraction res = Fraction(1, 2) - Fraction(1, m+1) + Fraction(n-m, 1ll*(m+1) * nxt_prime);
        PRINT(1, m+1, n-m, nxt_prime);
        print_ll(res.a);putchar('/');
        print_ll(res.b);ln;
    }
}


#include <iostream>
#include <cmath>

using namespace std;

typedef long long ll;

ll GCD(ll A, ll B) {
	if(B == 0) return A;
	return GCD(B, A % B);
}

bool isPrime(int a) {
	for(int i = 2; i <= sqrt(a); i++) {
		if(a % i == 0)
			return false;
	}
	return true;
}

int main() {
	int t;
	cin >> t;
	while(t--) {
		int n;
		cin >> n;
		ll v, u;
		v = n;
		while(!isPrime(v)) v--;
		u = n + 1;
		while(!isPrime(u)) u++;
		ll p = 2 * (n + 1) - 2 * (u + v) + u * v;
		ll q = 2 * u * v;
		ll gcd = GCD(p, q);
		cout << p / gcd << "/" << q / gcd << endl;
	}
}


#include <iostream>
#include <cmath>

using namespace std;

typedef long long ll;

ll GCD(ll A, ll B) {
	if(B == 0) return A;
	return GCD(B, A % B);
}

bool isPrime(int a) {
	for(int i = 2; i <= sqrt(a); i++) {
		if(a % i == 0)
			return false;
	}
	return true;
}

int main() {
	int t;
	cin >> t;
	while(t--) {
		int n;
		cin >> n;
		int v, u;
		v = n;
		while(!isPrime(v)) v--;
		u = n + 1;
		while(!isPrime(u)) u++;
		ll p = 2 * (n + 1) - 2 * (u + v) + u * v;
		ll q = 2 * u * v;
		ll gcd = GCD(p, q);
		cout << p / gcd << "/" << q / gcd << endl;
	}
}


//In the name of Allah

#include<bits/stdc++.h>

using namespace std;

long long t, n;

bool isP(int v)
{
    for(int i = 2; i * i <= v; i ++)
        if(v % i == 0)
            return false;
    return true;
}

int main()
{
    scanf("%I64d", &t);
    pair<long long, long long> p; int g;
    for(int i = 0; i < t; i ++)
    {
        scanf("%I64d", &n);
       long long last, nextt;
        for(int i = n; i >= max(n - 500, (long long)2); i --)
            if(isP(i))
            {
                last = i;
                break;
            }
        for(int i = n + 1; i < n + 500; i ++)
            if(isP(i))
            {
                nextt = i;
                break;
            }
        p = make_pair(last * (nextt - 2) - 2 * nextt + 2 * n + 2, 2 * last * nextt);
        g = __gcd(p.first, p.second);
        printf("%I64d/%I64d\n", p.first / g, p.second / g);
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define SZ(x) ((int)(x).size())
#define All(x) (x).begin(),(x).end()
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define Close() ios::sync_with_stdio(0),cin.tie(0)
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
const int maxn = 1e5 + 10;
const int maxm = 1e3 + 5;
const int mod = 1e9 + 7;
/* head */
bool vis[maxn];
int prime[maxn], cnt;
inline void init() {
	cnt = 0;
	for (int i = 2; i <= maxn - 10; i++) {
		if (!vis[i]) prime[cnt++] = i;
		for (int j = i * 2; j <= maxn - 10; j += i) vis[j] = 1;
	}
}
inline bool isPrime(int k) {
	if (k <= maxn - 10) return !vis[k];
	for (int i = 0; i < cnt && prime[i] <= k; i++) if (k % prime[i] == 0) return 0;
	return 1;
}
inline void solve() {
	init();
	int t;
	scanf("%d", &t);
	while (t--) {
		int n;
		scanf("%d", &n);
		int u, v;
		for (int i = n; i >= 2; i--) if (isPrime(i)) {
			v = i;
			break;
		}
		for (int i = n + 1; i <= (maxn << 2); i++) {
			if (isPrime(i)) {
				u = i;
				break;
			}
		}
		ll p = 1LL * u * v + 2LL * (n - v - u + 1);
		ll q = 2LL * u * v;
		ll g = __gcd(p, q);
		printf("%lld/%lld\n", p / g, q / g);
	}
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("test.in", "r", stdin);
    freopen("test.out", "w", stdout);
    long _begin_time = clock();
#endif
    solve();
#ifndef ONLINE_JUDGE
    long _end_time = clock();
    printf("time = %ld ms.", _end_time - _begin_time);
#endif
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define SZ(x) ((int)(x).size())
#define All(x) (x).begin(),(x).end()
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define Close() ios::sync_with_stdio(0),cin.tie(0)
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
const int maxn = 1e5 + 10;
const int maxm = 1e3 + 5;
const int mod = 1e9 + 7;
/* head */
bool vis[maxn];
int prime[maxn], cnt;
inline void init() {
	cnt = 0;
	for (int i = 2; i <= maxn - 10; i++) {
		if (!vis[i]) prime[cnt++] = i;
		for (int j = i * 2; j <= maxn - 10; j += i) vis[j] = 1;
	}
}
inline bool isPrime(int k) {
	if (k <= maxn - 10) return !vis[k];
	for (int i = 0; i < cnt && prime[i] <= k; i++) if (k % prime[i] == 0) return 0;
	return 1;
}
inline void solve() {
	init();
	int t;
	scanf("%d", &t);
	while (t--) {
		int n;
		scanf("%d", &n);
		int u, v;
		for (int i = n; i >= 2; i--) if (isPrime(i)) {
			v = i;
			break;
		}
		for (int i = n + 1; i <= (maxn << 2); i++) {
			if (isPrime(i)) {
				u = i;
				break;
			}
		}
		ll p = u * v + 2 * (n - v - u + 1);
		ll q = 2 * u * v;
		ll g = __gcd(p, q);
		printf("%lld/%lld\n", p / g, q / g);
	}
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("test.in", "r", stdin);
    freopen("test.out", "w", stdout);
    long _begin_time = clock();
#endif
    solve();
#ifndef ONLINE_JUDGE
    long _end_time = clock();
    printf("time = %ld ms.", _end_time - _begin_time);
#endif
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define SZ(x) ((int)(x).size())
#define All(x) (x).begin(),(x).end()
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define Close() ios::sync_with_stdio(0),cin.tie(0)
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
const int maxn = 1e5 + 10;
const int maxm = 1e3 + 5;
const int mod = 1e9 + 7;
/* head */
bool vis[maxn];
int prime[maxn], cnt;
inline void init() {
	cnt = 0;
	for (int i = 2; i <= maxn - 10; i++) {
		if (!vis[i]) prime[cnt++] = i;
		for (int j = i * 2; j <= maxn - 10; j += i) vis[j] = 1;
	}
}
inline bool isPrime(ll k) {
	if (k <= maxn - 10) return !vis[k];
	for (int i = 0; i < cnt && prime[i] <= k; i++) if (k % prime[i] == 0) return 0;
	return 1;
}
inline void solve() {
	init();
	int t;
	scanf("%d", &t);
	while (t--) {
		int n;
		scanf("%d", &n);
		ll u, v;
		for (int i = n; i >= 2; i--) if (isPrime(i)) {
			v = i;
			break;
		}
		for (ll i = n + 1; i <= (1LL << 60); i++) {
			if (isPrime(i)) {
				u = i;
				break;
			}
		}
		ll p = 1 * u * v + 2 * (n - v - u + 1);
		ll q = 2 * u * v;
		ll g = __gcd(p, q);
		printf("%lld/%lld\n", p / g, q / g);
	}
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("test.in", "r", stdin);
    freopen("test.out", "w", stdout);
    long _begin_time = clock();
#endif
    solve();
#ifndef ONLINE_JUDGE
    long _end_time = clock();
    printf("time = %ld ms.", _end_time - _begin_time);
#endif
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

long long t,n;

bool Chk(long long u)
{
    for(long long i=2;i*i<=u;++i)
        if(!(u%i))return false;

    return true;
}

int main()
{
    cin>>t;

    while(t--)
    {
        cin>>n;

        long long p,q;

        for(long long i=n;i>=2;--i)
        {
            if(Chk(i))
            {
                p=i;
                break;
            }
        }

        for(long long i=n+1;;++i)
        {
            if(Chk(i))
            {
                q=i;
                break;
            }
        }

        long long ts=p*q+2*n-2*(p+q)+2;
        long long ms=2*p*q;

        long long GCD=__gcd(ms,ts);

        cout<<ts/GCD<<"/"<<ms/GCD<<'\n';
    }
}


#include<bits/stdc++.h>
using namespace std;

int t,n;

bool Chk(int u)
{
    for(int i=2;i*i<=u;++i)
        if(!(u%i))return false;

    return true;
}

int main()
{
    cin>>t;

    while(t--)
    {
        cin>>n;

        int p,q;

        for(int i=n;i>=2;--i)
        {
            if(Chk(i))
            {
                p=i;
                break;
            }
        }

        for(int i=n+1;;++i)
        {
            if(Chk(i))
            {
                q=i;
                break;
            }
        }

        long long ts=(long long)(p*q)+(long long)(2*n)-(long long)(2*(p+q))+2;
        long long ms=(long long)(2*p*q);

        long long GCD=__gcd(ts,ms);

        cout<<ts/GCD<<"/"<<ms/GCD<<'\n';
    }
}


#include<bits/stdc++.h>
using namespace std;

long long t,n;

bool Chk(long long u)
{
    for(long long i=2;i*i<=u;++i)
        if(!(u%i))return false;

    return true;
}

int main()
{
    cin>>t;

    while(t--)
    {
        cin>>n;

        long long p,q;

        for(long long i=n;i>=2;--i)
        {
            if(Chk(i))
            {
                p=i;
                break;
            }
        }

        for(long long i=n+1;;++i)
        {
            if(Chk(i))
            {
                q=i;
                break;
            }
        }

        long long ts=p*q+2*n-2*(p+q)+2;
        long long ms=2*p*q;

        cout<<ts<<"/"<<ms<<'\n';
    }
}


#include<bits/stdc++.h>
using namespace std;

int t,n;

bool Chk(int u)
{
    for(int i=2;i*i<=u;++i)
        if(!(u%i))return false;

    return true;
}

int main()
{
    cin>>t;

    while(t--)
    {
        cin>>n;

        int p,q;

        for(int i=n;i>=2;--i)
        {
            if(Chk(i))
            {
                p=i;
                break;
            }
        }

        for(int i=n+1;;++i)
        {
            if(Chk(i))
            {
                q=i;
                break;
            }
        }

        long long ts=(long long)(p*q)+(long long)(2*n)-(long long)(2*(p+q))+2;
        long long ms=2*p*q;

        long long GCD=__gcd(ts,ms);

        cout<<ts/GCD<<"/"<<ms/GCD<<'\n';
    }
}


// In the name of God
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iomanip>
#include <ctime>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <assert.h>
#include <bitset>
#define sqr(a) ((a)*1LL*(a))
#define all(a) (a).begin(), (a).end()
using namespace std;

template <typename T>
T next_int() {
    T x = 0, p = 1;
    char ch;
    do { ch = getchar(); } while(ch <= ' ');
    if(ch == '-') {
        p = -1;
        ch = getchar();
    }
    while(ch >= '0' && ch <= '9') {
        x = x * 10 + (ch - '0');
        ch = getchar();
    }
    return p * x;
}

string next_token() {
    char ch;
    string ans = "";
    do { ch = getchar(); } while(ch <= ' ');
    while(ch > ' ') {
        ans += ch;
        ch = getchar();
    }
    return ans;
}

const long long INF = (long long)1e18;
const int INFINT = (int)1e9 + 227 + 1;
const int MAXN = (int)3e5 + 227 + 1;
const int MOD = (int)1e9 + 7;
const long double EPS = 1e-9;

long long bin_pow(long long a, long long b) {
    if(!b) return 1;
    long long ans = bin_pow(a, b / 2);
    ans = ans * ans % MOD;
    if(b % 2) ans = ans * a % MOD;
    return ans;
}

struct heh {
    long long a;
    long long b;

    heh(long long a, long long b) {
        this -> a = a;
        this -> b = b;
    } ;

    heh() {
        this -> a = -INFINT;
        this -> b = 1;
    } ;

    heh operator+(heh a) {
        heh ans(this -> a * a.b + a.a * this -> b, this -> b * a.b);
        return ans;
    }
    heh operator-(heh a) {
        heh ans(this -> a * a.b - a.a * this -> b, this -> b * a.b);
        return ans;
    }
    heh operator*(heh a) {
        heh ans(this -> a * a.a, this -> b * a.b);
        return ans;
    }

    bool operator<(const heh& a) const {
        return (this -> a * a.b) < (a.a * this -> b);
    }
    bool operator>(const heh& a) const {
        return (this -> a * a.b) > (a.a * this -> b);
    }
    bool operator==(const heh& a) const {
        return (this -> a * a.b) == (a.a * this -> b);
    }
} ;

void write(heh a, bool ok = 0) {
    if(ok) {
        int gcd = __gcd(a.a, a.b);
        a.a /= gcd;
        a.b /= gcd;
    }

    cout << a.a << "/" << a.b << "\n";
}

bool check(int a) {
    for(int i = 2; i * i <= a; i++)
        if(a % i == 0) return 1;
    return 0;
}

int get_down(int a) {
    while(check(a)) a--;
    return a;
}

int get_up(int a) {
    a++;
    while(check(a)) a++;
    return a;
}

int main() {
    // freopen(".in", "r", stdin);

    int test; cin >> test;

    while(test--) {
        int n; cin >> n;

        vector<int> b;
        while(check(n + 1)) n++, b.push_back(n);

        heh ans = heh(1, 2) - heh(1, n + 1);

        for(int i = 0; i < b.size(); i++) {
            ans = ans - heh(1, get_down(b[i]) * get_up(b[i]));
        }

        write(ans, 1);
    }
}


// In the name of God
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iomanip>
#include <ctime>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <assert.h>
#include <bitset>
#define sqr(a) ((a)*1LL*(a))
#define all(a) (a).begin(), (a).end()
using namespace std;

template <typename T>
T next_int() {
    T x = 0, p = 1;
    char ch;
    do { ch = getchar(); } while(ch <= ' ');
    if(ch == '-') {
        p = -1;
        ch = getchar();
    }
    while(ch >= '0' && ch <= '9') {
        x = x * 10 + (ch - '0');
        ch = getchar();
    }
    return p * x;
}

string next_token() {
    char ch;
    string ans = "";
    do { ch = getchar(); } while(ch <= ' ');
    while(ch > ' ') {
        ans += ch;
        ch = getchar();
    }
    return ans;
}

const long long INF = (long long)1e18;
const int INFINT = (int)1e9 + 227 + 1;
const int MAXN = (int)3e5 + 227 + 1;
const int MOD = (int)1e9 + 7;
const long double EPS = 1e-9;

long long bin_pow(long long a, long long b) {
    if(!b) return 1;
    long long ans = bin_pow(a, b / 2);
    ans = ans * ans % MOD;
    if(b % 2) ans = ans * a % MOD;
    return ans;
}

struct heh {
    long long a;
    long long b;

    heh(long long a, long long b) {
        this -> a = a;
        this -> b = b;
    } ;

    heh() {
        this -> a = -INFINT;
        this -> b = 1;
    } ;

    heh operator+(heh a) {
        heh ans(this -> a * a.b + a.a * this -> b, this -> b * a.b);
        return ans;
    }
    heh operator-(heh a) {
        long long gcd = __gcd(this -> b, a.b);
        heh ans(this -> a * (a.b / gcd) - a.a * (this -> b / gcd), this -> b / gcd * a.b);
        return ans;
    }
    heh operator*(heh a) {
        heh ans(this -> a * a.a, this -> b * a.b);
        return ans;
    }

    bool operator<(const heh& a) const {
        return (this -> a * a.b) < (a.a * this -> b);
    }
    bool operator>(const heh& a) const {
        return (this -> a * a.b) > (a.a * this -> b);
    }
    bool operator==(const heh& a) const {
        return (this -> a * a.b) == (a.a * this -> b);
    }

    void norm() {
        int gcd = __gcd(a, b);
        a /= gcd;
        b /= gcd;
    }
} ;

void write(heh a, bool ok = 0) {
    if(ok) {
        int gcd = __gcd(a.a, a.b);
        a.a /= gcd;
        a.b /= gcd;
    }

    cout << a.a << "/" << a.b << "\n";
}

bool check(int a) {
    for(int i = 2; i * i <= a; i++)
        if(a % i == 0) return 1;
    return 0;
}

int get_down(int a) {
    while(check(a)) a--;
    return a;
}

int get_up(int a) {
    a++;
    while(check(a)) a++;
    return a;
}

int main() {
    // freopen(".in", "r", stdin);

    int test; cin >> test;

    while(test--) {
        int n; cin >> n;

        vector<int> b;
        while(check(n + 1)) n++, b.push_back(n);

        heh ans = heh(1, 2) - heh(1, n + 1);

        if(b.size()) ans = ans - heh(b.size(), get_down(b[0]) * 1LL * get_up(b[0]));

        write(ans, 1);
    }
}