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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.util.Random;
import java.io.UncheckedIOException;
import java.math.BigDecimal;
import java.io.Closeable;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.math.BigInteger;
import java.io.InputStream;
import java.math.RoundingMode;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) throws Exception {
        Thread thread = new Thread(null, new TaskAdapter(), "", 1 << 29);
        thread.start();
        thread.join();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastInput in = new FastInput(inputStream);
            FastOutput out = new FastOutput(outputStream);
            BOnSumOfFractions solver = new BOnSumOfFractions();
            int testCount = Integer.parseInt(in.next());
            for (int i = 1; i <= testCount; i++)
                solver.solve(i, in, out);
            out.close();
        }
    }

    static class BOnSumOfFractions {
        public void solve(int testNumber, FastInput in, FastOutput out) {
            int n = in.ri();
            if (n == 2) {
                out.println("1/6");
                return;
            }
            int p1 = prev(n);
            int next = next(n + 1);
            //2..p1
            BigFraction ans = BigFraction.minus(new BigFraction(BigInteger.ONE, BigInteger.valueOf(2)),
                    new BigFraction(BigInteger.ONE, BigInteger.valueOf(p1)));
            ans = BigFraction.plus(ans, new BigFraction(BigInteger.valueOf(n - p1 + 1), BigInteger.valueOf((long) p1 * next)));
            out.append(ans.top()).append('/').append(ans.bot()).println();
        }

        public int prev(int x) {
            while (!MillerRabin.mr(x, 10)) {
                x--;
            }
            return x;
        }

        public int next(int x) {
            while (!MillerRabin.mr(x, 10)) {
                x++;
            }
            return x;
        }

    }

    static class Power implements InverseNumber {
        int mod;

        public Power(int mod) {
            this.mod = mod;
        }

        public int pow(int x, int n) {
            if (n == 0) {
                return 1 % mod;
            }
            long r = pow(x, n >> 1);
            r = r * r % mod;
            if ((n & 1) == 1) {
                r = r * x % mod;
            }
            return (int) r;
        }

    }

    static class MillerRabin {
        static int mod;
        static Power power;

        public static boolean mr(int n, int s) {
            if (n <= 1) {
                return false;
            }
            if (n == 2) {
                return true;
            }
            if (n % 2 == 0) {
                return false;
            }
            int m = n - 1;
            while (m % 2 == 0) {
                m /= 2;
            }
            mod = n;
            power = new Power(mod);
            for (int i = 0; i < s; i++) {
                int x = RandomWrapper.INSTANCE.nextInt(n - 2) + 2;
                if (!mr0(x, n, m)) {
                    return false;
                }
            }
            return true;
        }

        private static boolean mr0(int x, int n, int m) {
            return test(power.pow(x, m), m, n);
        }

        private static boolean test(int y, int exp, int n) {
            int y2 = (int) ((long) y * y % mod);
            if (!(exp == n - 1 || test(y2, exp * 2, n))) {
                return false;
            }
            if (exp != n - 1 && y2 != 1) {
                return true;
            }
            if (y != 1 && y != n - 1) {
                return false;
            }
            return true;
        }

    }

    static class BigFraction extends Number implements Comparable<BigFraction> {
        private BigInteger top;
        private BigInteger bot;

        public BigFraction(BigInteger top) {
            this.top = top;
            this.bot = BigInteger.ONE;
        }

        public BigFraction(BigInteger top, BigInteger bot) {
            this(top, bot, false);
        }

        private BigFraction(BigInteger top, BigInteger bot, boolean skipGCD) {
            if (top == null || bot == null || bot.signum() == 0) {
                throw new IllegalArgumentException();
            }
            if (bot.signum() < 0) {
                top = top.negate();
                bot = bot.negate();
            }
            if (!skipGCD) {
                BigInteger g = top.gcd(bot);
                this.top = top.divide(g);
                this.bot = bot.divide(g);
            } else {
                this.top = top;
                this.bot = bot;
            }
        }

        public static BigFraction plus(BigFraction a, BigFraction b) {
            return new BigFraction(a.top.multiply(b.bot).add(b.top.multiply(a.bot)),
                    a.bot.multiply(b.bot));
        }

        public static BigFraction minus(BigFraction a, BigFraction b) {
            return new BigFraction(a.top.multiply(b.bot).subtract(b.top.multiply(a.bot)),
                    a.bot.multiply(b.bot));
        }

        public String toString() {
            if (!bot.equals(BigInteger.ONE)) {
                return String.format("%s/%s", top.toString(), bot.toString());
            } else {
                return top.toString();
            }
        }

        public BigInteger top() {
            return top;
        }

        public BigInteger bot() {
            return bot;
        }

        public int compareTo(BigFraction o) {
            return top.multiply(o.bot).compareTo(o.top.multiply(bot));
        }

        public int intValue() {
            return (int) longValue();
        }

        public long longValue() {
            return top.divide(bot).longValue();
        }

        public float floatValue() {
            return (float) doubleValue();
        }

        public double doubleValue() {
            return new BigDecimal(top).divide(new BigDecimal(bot),
                    20,
                    RoundingMode.HALF_EVEN).doubleValue();
        }

        public int hashCode() {
            return top.hashCode() * 31 + bot.hashCode();
        }

        public boolean equals(Object obj) {
            if (!(obj instanceof BigFraction)) {
                return false;
            }
            BigFraction other = (BigFraction) obj;
            return top.equals(other.top) && bot.equals(other.bot);
        }

    }

    static class FastInput {
        private final InputStream is;
        private StringBuilder defaultStringBuf = new StringBuilder(1 << 13);
        private byte[] buf = new byte[1 << 13];
        private int bufLen;
        private int bufOffset;
        private int next;

        public FastInput(InputStream is) {
            this.is = is;
        }

        private int read() {
            while (bufLen == bufOffset) {
                bufOffset = 0;
                try {
                    bufLen = is.read(buf);
                } catch (IOException e) {
                    bufLen = -1;
                }
                if (bufLen == -1) {
                    return -1;
                }
            }
            return buf[bufOffset++];
        }

        public void skipBlank() {
            while (next >= 0 && next <= 32) {
                next = read();
            }
        }

        public String next() {
            return readString();
        }

        public int ri() {
            return readInt();
        }

        public int readInt() {
            int sign = 1;

            skipBlank();
            if (next == '+' || next == '-') {
                sign = next == '+' ? 1 : -1;
                next = read();
            }

            int val = 0;
            if (sign == 1) {
                while (next >= '0' && next <= '9') {
                    val = val * 10 + next - '0';
                    next = read();
                }
            } else {
                while (next >= '0' && next <= '9') {
                    val = val * 10 - next + '0';
                    next = read();
                }
            }

            return val;
        }

        public String readString(StringBuilder builder) {
            skipBlank();

            while (next > 32) {
                builder.append((char) next);
                next = read();
            }

            return builder.toString();
        }

        public String readString() {
            defaultStringBuf.setLength(0);
            return readString(defaultStringBuf);
        }

    }

    static class RandomWrapper {
        private Random random;
        public static final RandomWrapper INSTANCE = new RandomWrapper();

        public RandomWrapper() {
            this(new Random());
        }

        public RandomWrapper(Random random) {
            this.random = random;
        }

        public RandomWrapper(long seed) {
            this(new Random(seed));
        }

        public int nextInt(int n) {
            return random.nextInt(n);
        }

    }

    static interface InverseNumber {
    }

    static class FastOutput implements AutoCloseable, Closeable, Appendable {
        private static final int THRESHOLD = 32 << 10;
        private final Writer os;
        private StringBuilder cache = new StringBuilder(THRESHOLD * 2);

        public FastOutput append(CharSequence csq) {
            cache.append(csq);
            return this;
        }

        public FastOutput append(CharSequence csq, int start, int end) {
            cache.append(csq, start, end);
            return this;
        }

        private void afterWrite() {
            if (cache.length() < THRESHOLD) {
                return;
            }
            flush();
        }

        public FastOutput(Writer os) {
            this.os = os;
        }

        public FastOutput(OutputStream os) {
            this(new OutputStreamWriter(os));
        }

        public FastOutput append(char c) {
            cache.append(c);
            afterWrite();
            return this;
        }

        public FastOutput append(String c) {
            cache.append(c);
            afterWrite();
            return this;
        }

        public FastOutput append(Object c) {
            cache.append(c);
            afterWrite();
            return this;
        }

        public FastOutput println(String c) {
            return append(c).println();
        }

        public FastOutput println() {
            return append('\n');
        }

        public FastOutput flush() {
            try {
//            boolean success = false;
//            if (stringBuilderValueField != null) {
//                try {
//                    char[] value = (char[]) stringBuilderValueField.get(cache);
//                    os.write(value, 0, cache.length());
//                    success = true;
//                } catch (Exception e) {
//                }
//            }
//            if (!success) {
                os.append(cache);
//            }
                os.flush();
                cache.setLength(0);
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
            return this;
        }

        public void close() {
            flush();
            try {
                os.close();
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }

        public String toString() {
            return cache.toString();
        }

    }
}

