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.lang.Math;
import java.util.*;
import java.math.BigInteger;

public class Main
{	
	public BufferedReader in;
	public PrintStream out;
	
	public boolean log_enabled = true;
	
	private class Q
	{
		BigInteger n; BigInteger d;
		Q(long n, long d)
		{
			this.n = BigInteger.valueOf(n);
			this.d = BigInteger.valueOf(d);
			this.norm();
		}
		
		public void norm()
		{
			BigInteger g = n.gcd(d);
			this.n = this.n.divide(g);
			this.d = this.d.divide(g);
		}
		
		public void add(long n, long d)
		{
			this.n = this.n.multiply(BigInteger.valueOf(d)).add(this.d.multiply(BigInteger.valueOf(n)));
			this.d = this.d.multiply(BigInteger.valueOf(d));
			
			this.norm();
		}
		
		public String asString()
		{
			return n.toString() + "/" + d.toString();
		}
	}
	
	static int[] primes;
	static int p_count;

	public static void get_primes(int n)
	{
		primes = new int[3600];
		
		boolean[] v = new boolean[n+1];
		int i,j;
		for (i=2; i<=n;i++)
		{
			v[i] = true;
		}
		
		for (i=2; i*i<=n;i++)
		{
			if (v[i])
			{
				for (j=i; i*j<=n; j++)
				{
					v[i*j]=false;
				}
			}
		}
		
		p_count = 0;
		for (i=2; i<=n; i++)
		{
			if (v[i])
			{	
				primes[p_count++] = i;
			}
		}
	}
	
	public boolean is_prime(long n)
	{
		for (int i=0; i<p_count; i++)
		{
			if (n % primes[i]==0) return false;
			if (primes[i]*primes[i]>n) break;
		}
		return true;
	}
	
	public long next_prime(long n)
	{
		long i=n+1;
		while (!is_prime(i)) i++;
		return i;
	}
	
	public long prev_prime(long n)
	{
		long i=n;
		while (!is_prime(i)) i--;
		return i;
	}
	
	public void test()
	{
		get_primes(33000);
		
		int t = readInt();
		for (;t>0;t--)
		{
			long n = readInt();
			
			if (n==2)
			{
				out.println("1/6");
				continue;
			}
			
			if (n==3)
			{
				out.println("7/30");
				continue;
			}
			
			Q q = new Q((long)1, (long)2);
			
			if (is_prime(n))
			{
				q.add(-1, n);
				q.add(1, n*next_prime(n));
			}
			else
			{
				long p = prev_prime(n);
				q.add(-1, p);
				
				q.add(n-p+1, p*next_prime(n));
			}
			
			out.println(q.asString());
		}
	}
    
	public void run()
	{
		try
		{
			in = new BufferedReader(new InputStreamReader(System.in));
			out = System.out;
			
			//in = new BufferedReader(new FileReader("in.txt"));
			//out = new PrintStream(new File("out.txt"));
			
			
		}
		catch (Exception e)
		{
			return;
		}
		
		//while (true)
		{
			//int t = readInt(); for (int i=0; i<t; i++)					
			{
				test();
			}
		}
	}
	
	public static void main(String args[])
	{
		new Main().run();
	}
	
	private StringTokenizer tokenizer = null;
	
	public int readInt() 
	{
        return Integer.parseInt(readToken());
    }
   
    public long readLong() 
	{
        return Long.parseLong(readToken());
    }
   
    public double readDouble() 
	{
        return Double.parseDouble(readToken());
    }
   
	public String readLn()
	{	
		try
		{
			String s;
			while ((s = in.readLine()).length()==0);
			return s;
		}
		catch (Exception e)
		{
			return "";
		}
	}
	
    public String readToken() 
	{
		try
		{
			while (tokenizer == null || !tokenizer.hasMoreTokens()) 
			{
				tokenizer = new StringTokenizer(in.readLine());
			}
			return tokenizer.nextToken();
		}
		catch (Exception e)
		{
			return "";
		}
    }
	
	public int[] readIntArray(int n)
	{
		int[] x = new int[n];
		readIntArray(x, n);
		return x;
	}
	
	public void readIntArray(int[] x, int n)
	{
		for (int i=0; i<n; i++)
		{
			x[i] = readInt();
		}
	}
	
	public void logWrite(String format, Object... args)
	{
		if (!log_enabled)
		{
			return;
		}
		
		out.printf(format, args);
	}
}

