Let's assume that 

  * v(n) is the largest prime number, that does not exceed n;
  * u(n) is the smallest prime number strictly greater than n. 



Find <image>.

Input

The first line contains integer t (1 ≤ t ≤ 500) — the number of testscases. 

Each of the following t lines of the input contains integer n (2 ≤ n ≤ 109).

Output

Print t lines: the i-th of them must contain the answer to the i-th test as an irreducible fraction "p/q", where p, q are integers, q > 0.

Examples

Input

2
2
3


Output

1/6
7/30

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


public class B {
    public static long time = 0;
    public static void main(String[] args) throws Exception {
        time = System.currentTimeMillis();
        
        IN = System.in;
        OUT = System.out;
        in = new BufferedReader(new InputStreamReader(IN));
        out = new PrintWriter(OUT, FLUSH);
        solveOne();
        out.flush();
    }
    public static long bot(long cur){
        long bot = cur;
        for (;;){
            if (NT.millerRabin(bot)){
                break;
            }
            else bot--;
        }
        return bot;
    }
    public static long top(long cur){
        long top = cur + 1l;
        for (;;){
            if (NT.millerRabin(top)){
                break;
            }
            else top++;
        }
        return top;
    }
    
    public static BigInteger[] p1(long bot){
        BigInteger top = bi(bot - 2l);
        BigInteger bot2 = bi(2).multiply(bi(bot));
        return new BigInteger[]{top, bot2};
    }
    public static BigInteger[] p2(long top, long bot, long cur){
        BigInteger diff = bi(cur - bot);
        BigInteger bot2 = bi(top).multiply(bi(bot));
        return new BigInteger[]{diff, bot2};
    }
    
    
    public static void solveOne() throws Exception {
//      F temp = new F(0, 1);
//      for (int i = 2; i <= 10; i++){
//          F temp2 = new F(1, bot(i) * top (i));
//          temp = temp.add(temp2);
//          px(i, bot(i), top (i), temp);
//          
//          
//      }
        int no = ni();
        for (int qq = 0 ;qq < no; qq++){
            long cur = ni();
//          if (cur == 2l){
//              pn("1/3");
//              continue;
//          }
//          else if (cur == 3){
//              pn("7/30");
//              continue;
//          }
            cur++;
            long top = top(cur);
            long bot = bot(cur);
//          px(bot, top);
            BigInteger[] p1 = p1(bot);
//          px(p1);
            BigInteger[] p2 = p2(top, bot, cur);
            BigInteger finTop = p1[0].multiply(p2[1]).add(p2[0].multiply(p1[1]) );
            BigInteger finBot = p1[1].multiply(p2[1]);
            BigInteger gcd = finTop.gcd(finBot);
            finTop = finTop.divide(gcd);
            finBot= finBot.divide(gcd);
            pn(finTop +"/" + finBot);
        }
        
        
    }
    
    public static void solveTwo() throws Exception {
        
    }
    
    public static void solveThree() throws Exception {
        
    }
    
    public static BufferedReader in;
    public static StringTokenizer st;
    public static InputStream IN;
    public static OutputStream OUT;
    public static String nx() throws Exception {
        for (;st == null || !st.hasMoreTokens();){
            String k1 = in.readLine();
            if (k1 == null) return null;
            st = new StringTokenizer(k1);
        }
        return st.nextToken();
    }
    public static int ni () throws Exception {
        return Integer.parseInt(nx());
    }
    public static long nl() throws Exception{
        return Long.parseLong(nx());
    }
    public static double nd() throws Exception{
        return Double.parseDouble(nx());
    }
    public static void px(Object ... l1){
        System.out.println(Arrays.deepToString(l1));
    }
    public static boolean FLUSH = false;
    public static PrintWriter out;
    public static void p(Object ... l1){
        for (int i = 0; i < l1.length; i++){
            if (i != 0) out.print(' ');
            out.print(l1[i].toString());
        }
    }
    public static void pn(Object ... l1){
        for (int i = 0; i < l1.length; i++){
            if (i != 0) out.print(' ');
            out.print(l1[i].toString());
        }
        out.println();
    }
    
    public static void pn(Collection l1){
        boolean first = true;
        for (Object e: l1){
            if (first) first = false;
            else out.print(' ');
            out.print(e.toString());
        }
        out.println();
    }
    
    private static BigInteger bi(long n1){
        return BigInteger.valueOf(n1);
    }
    
    private static 
 class NT {
    public static boolean millerRabinX(long x1, long n1) {
        long y = n1 - 1l;
        while (!((y & 1) == 1))
            y >>= 1;
        x1 = Modz.pow(x1, y, n1);
        while (y < n1 - 1l && x1 != 1 && x1 != n1 - 1l) {
            x1 = (x1 * x1) % n1;
            y <<= 1;
        }
        return x1 == n1 - 1l || (y & 1l) == 1l;
    }
    public static boolean millerRabin(long n1) {
        if (n1 == 2 || n1 == 7 || n1 == 61)
            return true;
        if (n1 == 1 || (n1 & 1l) == 0)
            return false;
        if (!millerRabinX(2, n1))
            return false;
        if (!millerRabinX(7, n1))
            return false;
        if (!millerRabinX(61, n1))
            return false;
        return true;
    }
}

private static 
 class Modz {
        public static long times(long n1, long n2, long mod) {
            long k1 = (n1 * n2) % mod;
            if (k1 < 0) k1 += mod;
            return k1;
        }
        public static long pow(long base, long pow, long mod) {
            if (pow == 0)
                return 1l % mod;
            else if (pow == 1)
                return times(1l, base, mod);
            else if ((pow & 1) == 0) {
                long half = pow(base, pow >> 1, mod);
                return times(half, half, mod);
            }
            else {
                long half = pow(base, pow >> 1, mod);
                return times(half, times(half, base, mod), mod);
            }
        }
    }

}
