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.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.Scanner;
import java.util.Stack;
import java.util.TreeMap;
import java.util.TreeSet;

public class CF427_1 {
	static int N;

	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int t = in.nextInt();

		while (t-- > 0) {
			int n = in.nextInt();
			long last = n;
			long sc = n + 1;
			for (int j = n; j >= 2; j--) {
				BigInteger b = new BigInteger(String.valueOf(j));
				if (b.isProbablePrime(10)) {
					last = j;
					break;
				}
			}
			for (int j = n + 1;; j++) {
				BigInteger b = new BigInteger(String.valueOf(j));
				if (b.isProbablePrime(10)) {
					sc = j;
					break;
				}
			}

			long ans = last * sc - 2 * sc + 2 * (n - last + 1);
			long ans2 = 2 * last * sc;

			long g = gcd(ans, ans2);
			ans = ans / g;
			ans2 = ans2 / g;
			out.println(ans + "/" + ans2);

		}
		out.close();

	}

	static long gcd(long a, long b) {
		if (b == 0)
			return a;
		return gcd(b, a % b);
	}

}