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.math.*;
import java.security.KeyStore.Entry;
import java.util.*;

public class CODEFORCES {
	private InputStream is;
	private PrintWriter out;

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

	void solve() {
		int t = ni();
		int sq = (int) Math.sqrt(1e9) + 1;
		ArrayList<Integer> a = new ArrayList<Integer>();
		boolean u[] = new boolean[sq + 1];
		for (int i = 2; i <= sq; i++) {
			if (!u[i]) {
				a.add(i);
				for (int j = i * i; j <= sq; j += i)
					u[j] = true;
			}
		}
		while (t-- > 0) {
			int n = ni();
			if (n <= 1000) {
				if (n == 2)
					out.println("1/6");
				else {
					int op = 2, pm = 0;
					for (int i : a) {
						if (i <= n)
							op = i;
						else {
							pm = i;
							break;
						}
					}
					if (n == pm - 1)
						out.println((pm - 2) + "/" + (2 * pm));
					else {
						long io = (op - 2) * pm + (n + 1 - op) * 2;
						long jk = 2 * op * pm;
						long gc = gcd(io, jk);
						out.println((io / gc) + "/" + (jk / gc));
					}
				}
			} else {
				boolean v[] = new boolean[600];
				int nm = n - 300;
				for (int i : a) {
					if(i>nm-300)
						break;
					int ind = nm % i;
					ind = (i - ind) % i;
					for (int j = ind; j < 600; j += i)
						v[j] = true;
				}
				long op = 0, pm = 0;
				for (int i = 300; i >= 0; i--) {
					if (!v[i]) {
						op = nm + i;
						break;
					}
				}
				for (int i = 301; i < 600; i++) {
					if (!v[i]) {
						pm = nm + i;
						break;
					}
				}
				if (n == pm - 1)
					out.println((pm - 2) + "/" + (2 * pm));
				else {
					long io = (op - 2) * pm + (n + 1 - op) * 2;
					long jk = 2 * op * pm;
					long gc = gcd(io, jk);
					out.println((io / gc) + "/" + (jk / gc));
				}
			}
		}
	}

	void soln() {
		is = System.in;
		out = new PrintWriter(System.out);
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis() - s + "ms");
	}

	public static void main(String[] args) throws Exception {
		new CODEFORCES().soln();
	}

	// To Get Input
	// Some Buffer Methods
	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte() {
		if (lenbuf == -1)
			throw new InputMismatchException();
		if (ptrbuf >= lenbuf) {
			ptrbuf = 0;
			try {
				lenbuf = is.read(inbuf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) {
		return !(c >= 33 && c <= 126);
	}

	private int skip() {
		int b;
		while ((b = readByte()) != -1 && isSpaceChar(b))
			;
		return b;
	}

	private double nd() {
		return Double.parseDouble(ns());
	}

	private char nc() {
		return (char) skip();
	}

	private String ns() {
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != '
									// ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n) {
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while (p < n && !(isSpaceChar(b))) {
			buf[p++] = (char) b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m) {
		char[][] map = new char[n][];
		for (int i = 0; i < n; i++)
			map[i] = ns(m);
		return map;
	}

	private int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}

	private int ni() {
		int num = 0, b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl() {
		long num = 0;
		int b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;

	private void tr(Object... o) {
		if (!oj)
			System.out.println(Arrays.deepToString(o));
	}
}