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.BufferedReader;
import java.io.IOError;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.StringTokenizer;

public class Main {

	FastIO scan = new FastIO();
	PrintWriter cout = new PrintWriter(System.out);

	public long gcdfuck(long a, long b) {
		return b == 0 ? a : gcdfuck(b, a % b);
	}
	
	public boolean isPrime(long x) {
		for (long i = 2; i * i <= x; i++) {
			if (x % i == 0)
				return false;
		}
		return true;
	}

	public void run() {

		int t = scan.nextInt();
		for (int i = 1; i <= t; i++) {
			int n = scan.nextInt();
			long l = n, r = n + 1;
//			while (BigInteger.valueOf((long) l).isProbablePrime(10) == false) {
//				l--;
//			}
//			while (BigInteger.valueOf((long) r).isProbablePrime(10) == false) {
//				r++;
//			}
			while (isPrime(l) == false) {
				l--;
			}
			while (isPrime(r) == false) {
				r++;
			}
			long fenzi = (long) l * r + (long) (n - r + 1) * 2 - l * 2;
			long fenmu = (long) 2 * l * r;
			long yueshu = gcdfuck(fenzi, fenmu);
			System.out.println((fenzi / yueshu) + "/" + (fenmu / yueshu));
		}
	}

	public static void main(String[] args) {
		new Main().run();
	}

	public class FastIO {
		BufferedReader br;
		StringTokenizer st;
		PrintWriter out;

		public FastIO(InputStream in, OutputStream o) {
			br = new BufferedReader(new InputStreamReader(in));
			out = new PrintWriter(new OutputStreamWriter(o));
			eat("");
		}

		public FastIO() {
			br = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(new OutputStreamWriter(System.out));
			eat("");
		}

		public void eat(String s) {
			st = new StringTokenizer(s);
		}

		public String nextLine() {
			try {
				return br.readLine();
			} catch (IOException e) {
				throw new IOError(e);
			}
		}

		public boolean hasNext() {
			while (!st.hasMoreTokens()) {
				String s = nextLine();
				if (s == null)
					return false;
				eat(s);
			}
			return true;
		}

		public String next() {
			hasNext();
			return st.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public void print(String ans) {
			out.print(ans);
			out.flush();
		}

		public void println(String ans) {
			out.println(ans);
			out.flush();
		}

		public void close() {
			out.close();
		}
	}
}

  		   	 		  	   		   	 	