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.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.math.BigInteger;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        InputStream inStream = System.in;
        OutputStream outStream = System.out;
        InputReader in = new InputReader(inStream);
        PrintWriter out = new PrintWriter(outStream);
        Solver solver = new Solver();
        solver.solve(in, out);
        out.close();
    }

    static class Solver {

        public static void solve(InputReader in, PrintWriter out) {
            int T = in.nextInt();
            while(T-- > 0){
                int n = in.nextInt();
                BigInteger nn = BigInteger.valueOf(n);
                BigInteger np = nn.nextProbablePrime();
                int m = n;
                while(!BigInteger.valueOf(m).isProbablePrime(30)){
                    --m;
                }
                BigInteger pp = BigInteger.valueOf(m);
                BigInteger P = np.multiply(pp);
                P = P.subtract(BigInteger.valueOf(2).multiply(pp.add(np)));
                P = P.add(BigInteger.valueOf(2*n + 2));
                BigInteger Q = np.multiply(pp);
                Q = Q.add(Q);
                BigInteger G = P.gcd(Q);
                P = P.divide(G);
                Q = Q.divide(G);
                out.print(P.toString());
                out.print('/');
                out.println(Q.toString());
            }
        }
    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader (InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next () {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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