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.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @author Don Li
 */
public class OnSumFractions {
    void solve() {
        int T = in.nextInt();
        while (T-- > 0) {
            int n = in.nextInt();
            long p = -1, q = -1;
            for (int i = 0; i < 300; i++) {
                if (prime(n - i)) {
                    p = n - i;
                    break;
                }
            }
            for (int i = 1; i < 300; i++) {
                if (prime(n + i)) {
                    q = n + i;
                    break;
                }
            }
            long x = p * q - 2 * q + 2 * (n - p + 1), y = 2 * p * q;
            if (x % 2 == 0) {
                x /= 2;
                y /= 2;
            }
            if (x % p == 0) {
                x /= p;
                y /= p;
            }
            if (x % q == 0) {
                x /= q;
                y /= q;
            }
            out.printf("%d/%d%n", x, y);
        }
    }
    
    boolean prime(int n) {
        int sqrt = (int) (Math.sqrt(n) + 0.5);
        for (int i = 2; i <= sqrt; i++) {
            if (n % i == 0) return false;
        }
        return true;
    }
    
    public static void main(String[] args) {
        in = new FastScanner(new BufferedReader(new InputStreamReader(System.in)));
        out = new PrintWriter(System.out);
        new OnSumFractions().solve();
        out.close();
    }
    
    static FastScanner in;
    static PrintWriter out;
    
    static class FastScanner {
        BufferedReader in;
        StringTokenizer st;
        
        public FastScanner(BufferedReader in) {
            this.in = in;
        }
        
        public String nextToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        
        public int nextInt() {
            return Integer.parseInt(nextToken());
        }
        
        public long nextLong() {
            return Long.parseLong(nextToken());
        }
        
        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }
}
