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

public class Template implements Runnable {

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    void init() throws FileNotFoundException {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        } catch (Exception e) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }
    }

    class GraphBuilder {
        int n, m;
        int[] x, y;
        int index;
        int[] size;


        GraphBuilder(int n, int m) {
            this.n = n;
            this.m = m;
            x = new int[m];
            y = new int[m];
            size = new int[n];
        }

        void add(int u, int v) {
            x[index] = u;
            y[index] = v;
            size[u]++;
            size[v]++;
            index++;
        }

        int[][] build() {
            int[][] graph = new int[n][];
            for (int i = 0; i < n; i++) {
                graph[i] = new int[size[i]];
            }
            for (int i = m - 1; i >= 0; i--) {
                int u = x[i];
                int v = y[i];
                graph[u][--size[u]] = v;
                graph[v][--size[v]] = u;
            }
            return graph;
        }
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            try {
                tok = new StringTokenizer(in.readLine());
            } catch (Exception e) {
                return null;
            }
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    int[] readIntArray(int size) throws IOException {
        int[] res = new int[size];
        for (int i = 0; i < size; i++) {
            res[i] = readInt();
        }
        return res;
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    <T> List<T>[] createGraphList(int size) {
        List<T>[] list = new List[size];
        for (int i = 0; i < size; i++) {
            list[i] = new ArrayList<>();
        }
        return list;
    }

    public static void main(String[] args) {
        new Template().run();
        // new Thread(null, new Template(), "", 1l * 200 * 1024 * 1024).start();
    }

    long timeBegin, timeEnd;

    void time() {
        timeEnd = System.currentTimeMillis();
        System.err.println("Time = " + (timeEnd - timeBegin));
    }

    long memoryTotal, memoryFree;

    void memory() {
        memoryFree = Runtime.getRuntime().freeMemory();
        System.err.println("Memory = " + ((memoryTotal - memoryFree) >> 10)
                + " KB");
    }

    public void run() {
        try {
            timeBegin = System.currentTimeMillis();
            memoryTotal = Runtime.getRuntime().freeMemory();
            init();
            solve();
            out.close();
            if (System.getProperty("ONLINE_JUDGE") == null) {
                time();
                memory();
            }
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    boolean isPrime(int x) {
        for (int i = 2; i * i <= x; i++) {
            if (x % i == 0) return false;
        }
        return true;
    }

    int v(int n) {
        for (int i = n; ; i--) {
            if (isPrime(i)) return i;
        }
    }

    int u(int n) {
        for (int i = n + 1; ; i++) {
            if (isPrime(i)) return i;
        }
    }

    class Fraction {
        long num, denum;

        Fraction(long num, long denum) {
            this.num = num;
            this.denum = denum;
        }

        Fraction add(Fraction f) {
            return new Fraction(f.num * denum + f.denum * num, denum * f.denum);
        }

        Fraction simply() {
            long g = gcd(num, denum);
            return new Fraction(num / g, denum / g);
        }

        long gcd(long x, long y) {
            if (x == 0) return y;
            return gcd(y % x, x);
        }

        @Override
        public String toString() {
            return num + "/" + denum;
        }
    }

    void solve() throws IOException {
//        int n = readInt();
//        Fraction sum = new Fraction(0, 1);
//        for (int i = 2; i < 300; i++) {
//            int v = v(i);
//            int u = u(i);
//
//            Fraction next = new Fraction(1, v * u);
//            sum = sum.add(next).simply();
//            System.err.println(s(i) + " " + i + " " + sum.num + " " + sum.denum + " " + v * u);
//        }
        int n = readInt();
        while (n --> 0) {
            out.println(solve(readInt()));
        }
    }


    String solve(int x) {
        long prevX = v(x);
        long nextX = u(x);

        long z = (long) prevX * nextX;
        long denumerator = z * 2;
        long numeratorNext = z - 2 * prevX;
        numeratorNext = numeratorNext - (nextX - x - 1) * 2;
        return new Fraction(numeratorNext, denumerator).simply().toString();
    }

    String s(int x) {
        String s = BigInteger.valueOf(x).isProbablePrime(20) + "";
        if (s.length() == 4) s = " " + s;
        return s;
    }


}