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

public class Q396B {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = sc.nextInt();
        int[] nums = new int[count];
        for (int i = 0; i < count; i++) {
            nums[i] = sc.nextInt();
        }
        for (int num : nums) {
            long maxprime = maxPrime(num);
            long minprime = minPrime(num);

            long sub1 = maxprime - 2;
            long mo1 = 2 * maxprime;

            long sub2 = num - maxprime+1;
            long mo2 = maxprime * minprime;

            long gcd = gcd(mo1, mo2);
            long sub = sub1 * (mo2/gcd) + sub2 * (mo1/gcd);
            long mo = mo1 * (mo2/gcd);

            long gd = gcd(mo, sub);
            if (gd == 1) {
                System.out.println(sub + "/" + mo);
            } else {
                System.out.println(sub/gd + "/" + mo/gd);
            }
        }


    }

    private static long gcd(long div1, long div2) {
        if (div2 > div1) return gcd(div2, div1);
        if (div1 % div2 == 0) return div2;
        return gcd(div2, div1%div2);

    }

    private static long maxPrime (int max) {
        for (int i = max; i >= 2; i--) {
            if (isPrime(i)) return i;
        }
        return 2;
    }
    private static long minPrime(int max) {
        while (!isPrime(++max));
        return max;

    }
    private static boolean isPrime(int num) {
        if (num == 2) return true;
        for (int i = 2; i <= Math.sqrt(num); i++) {
            if (num % i == 0) return false;
        }
        return true;
    }
}
