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