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.*;
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();
    }

}