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.math.BigInteger;
import java.util.Scanner;

public class B {
    // 3 - 2 / 3 * 2 = 1/2 - 1/3

    // sum (p[i+1]-p[i])/(p[i+1]*p[i]) = 1/p[i] - 1/p[i+1]
    // whole sequence, first - last
    public long gcd(long a, long b) {
        return b == 0 ? a : gcd(b, a % b);
    }

    public static BigInteger b(long x) {
        return new BigInteger(x + "");
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int tc = in.nextInt();
        while (tc-- > 0) {
            int k = in.nextInt();
            BigInteger b = new BigInteger(k + "");
            while (!b.isProbablePrime(20))
                b = b.subtract(BigInteger.ONE);
            long num = b.intValue() - 2;
            long denum = 2 * b.intValue();

            long current = b.intValue();
            long next = b.nextProbablePrime().intValue();
            long othernum = k - current + 1;
            long otherdenum = current * next;
            BigInteger resnum = (b(othernum).multiply(b(denum))).add(b(num)
                    .multiply(b(otherdenum)));
            BigInteger resdenum = b(denum).multiply(b(otherdenum));
            BigInteger g = resnum.gcd(resdenum);
            resnum = resnum.divide(g);
            resdenum = resdenum.divide(g);
            System.out.println(resnum + "/" + resdenum);
        }
    }
}
