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

public class Main232B {

    private FastScanner in;
    private PrintWriter out;

    int[] prime = new int[100000];
    int countPrime;

    public void solve() throws IOException {
        prime[0] = 2;
        prime[1] = 3;
        countPrime = 2;
        while(prime[countPrime - 1] < 50000) {
            int t = prime[countPrime - 1] + 2;
            while(true) {
                int i = 0;
                while(i < countPrime && t % prime[i] != 0) {
                    i++;
                }
                if(i == countPrime) {
                    break;
                }
                t = t + 2;
            }
            prime[countPrime] = t;
            countPrime++;
        }

        int n = in.nextInt();
        for(int i = 0; i < n; i++) {
            int t = in.nextInt();
            int pr = findPrevPrime(t + 2);
            int ne = findNextPrime(pr);
            BigInteger b2 = BigInteger.valueOf(2);
            BigInteger bt = BigInteger.valueOf(t);
            BigInteger bne = BigInteger.valueOf(ne);
            BigInteger bpr = BigInteger.valueOf(pr);
            BigInteger num = bne.multiply(bpr).subtract(b2.multiply(bne)).add(b2.multiply(bt.subtract(bpr).add(BigInteger.ONE)));
            BigInteger div = b2.multiply(bpr).multiply(bne);
            BigInteger gcd = num.gcd(div);
            num = num.divide(gcd);
            div = div.divide(gcd);
            out.println(num + "/" + div);
        }
    }

    private int findPrevPrime(int t) {
        for(int i = t - 1; i > 0; i--) {
            boolean pr = true;
            int sq = (int) Math.sqrt(i);
            for(int j = 0; j < countPrime && prime[j] <= sq; j++) {
                if(i % prime[j] == 0) {
                    pr = false;
                    break;
                }
            }
            if(pr) {
                return i;
            }
        }
        return 1;
    }

    private int findNextPrime(int t) {
        for(int i = t + 1; i < Integer.MAX_VALUE; i++) {
            boolean pr = true;
            int sq = (int) Math.sqrt(i);
            for(int j = 0; j < countPrime && prime[j] <= sq; j++) {
                if(i % prime[j] == 0) {
                    pr = false;
                    break;
                }
            }
            if(pr) {
                return i;
            }
        }
        return 2;
    }

    public void run() {
        try {
            in = new FastScanner(System.in);
            out = new PrintWriter(System.out);
            solve();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    class FastScanner {

        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

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

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

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

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

    public static void main(String[] arg) {
        new Main232B().run();
    }
}