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.*;
import java.math.*;
import java.io.*;

public class CF396B {
	class Fraction {
		long n, d;
		public Fraction(long nn, long dd) {
			n = nn;  d = dd;
			simplify();
		}
		void simplify() {
			long gcd = gcd(n, d);
			n /= gcd;  d /= gcd;
		}
		Fraction add(Fraction f) {
			long lcm = lcm(d, f.d);
			return new Fraction((n * (lcm / d)) + (f.n * (lcm / f.d)), lcm);
		}
		Fraction sub(Fraction f) { return this.add(new Fraction(-f.n, f.d)); }
		public String toString() { return String.format("%d/%d", n, d); }
	}
	long gcd(long a, long b) { return b == 0 ? a : gcd(b, a % b); }
	long lcm(long a, long b) { return a / gcd(a, b) * b; }
	int prevprime(int x) {
		for(int i = x ;; i--)
			if(BigInteger.valueOf(i).isProbablePrime(100))
				return i;
	}
	int nextprime(int x) {
		for(int i = x + 1 ;; i++)
			if(BigInteger.valueOf(i).isProbablePrime(100))
				return i;
	}
	public CF396B() {
		FS scan = new FS();
		PrintWriter out = new PrintWriter(System.out);
		int t = scan.nextInt();
		for(int tt = 0 ; tt < t ; tt++) {
			int n = scan.nextInt();
			// Let's denote p1, p2, p3, ... as the list of primes, starting with p1 as 2
			// if n + 1 is a prime p, then the solution for it is 1/p1 - 1/p (prove by induction)
			// since p1 is just 2, then the solution is 1/2 - 1/p
			// so just find the previous prime less than or equal to n
			// then just solve for everything along the way
			// since the largest prime gap does not exceed 300 for n < 1e9
			// it is at most total 300 to get the previous prime and the next prime
			int pi = prevprime(n);
			int pj = nextprime(n);
			Fraction half = new Fraction(1, 2);
			Fraction f1 = new Fraction(1, pi);
			Fraction f2 = new Fraction(n - pi + 1, (long) pi * pj);
			out.println(half.sub(f1).add(f2));
		}
		out.close();
	}
	class FS {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
		public String next() {
			while (!st.hasMoreTokens()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch (Exception e) { e.printStackTrace(); }
			}
			return st.nextToken();
		}
		public int nextInt() { return Integer.parseInt(next()); }
	}
	public static void main(String[] args) { new CF396B(); }
}
