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.BufferedWriter;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.StringTokenizer;

public class cf397d {
  static FastIO in = new FastIO(), out = in;

  public static void main(String[] args) {
    int T = in.nextInt();
    for(int t=1; t<=T; t++) {
      int n = in.nextInt();
      int higherPrime = n+1;
      while(!isPrime(higherPrime)) higherPrime++;
      int lowerPrime = n;
      while(!isPrime(lowerPrime)) lowerPrime--;
      
      Fraction ans = new Fraction(1, 2);
      ans = ans.subtract(new Fraction(1, lowerPrime));
      ans = ans.add(new Fraction(n - lowerPrime + 1, higherPrime*1L*lowerPrime));
      out.println(ans);
    }
    out.close();
  }
  static class Fraction {
    BigInteger num, den;
    Fraction(long a, long b) {
      this(BigInteger.valueOf(a), BigInteger.valueOf(b));
    }
    Fraction(BigInteger a, BigInteger b) {
      num = a;
      den = b;
      reduce();
    }
    Fraction negate() {
      return new Fraction(num.negate(), den);
    }
    Fraction add(Fraction rhs) {
      return new Fraction(num.multiply(rhs.den).add(den.multiply(rhs.num)), den.multiply(rhs.den));
    }
    Fraction subtract(Fraction rhs) {
      return add(rhs.negate());
    }
    void reduce() {
      if(den.signum() < 0) {
        num = num.negate();
        den = den.negate();
      }
      BigInteger g = num.abs().gcd(den.abs());
      num = num.divide(g);
      den = den.divide(g);
    }
    public String toString() {
      return num+"/"+den;
    }
  }
  static boolean isPrime(int x) {
    for(int i=2; i*i <= x; i++)
      if(x % i == 0)
        return false;
    return true;
  }

  static class FastIO extends PrintWriter {
    BufferedReader br;
    StringTokenizer st;

    public FastIO() {
      this(System.in, System.out);
    }

    public FastIO(InputStream in, OutputStream out) {
      super(new BufferedWriter(new OutputStreamWriter(out)));
      br = new BufferedReader(new InputStreamReader(in));
      scanLine();
    }

    public void scanLine() {
      try {
        st = new StringTokenizer(br.readLine().trim());
      } catch (Exception e) {
        throw new RuntimeException(e.getMessage());
      }
    }

    public int numTokens() {
      if (!st.hasMoreTokens()) {
        scanLine();
        return numTokens();
      }
      return st.countTokens();
    }

    public String next() {
      if (!st.hasMoreTokens()) {
        scanLine();
        return next();
      }
      return st.nextToken();
    }

    public double nextDouble() {
      return Double.parseDouble(next());
    }

    public long nextLong() {
      return Long.parseLong(next());
    }

    public int nextInt() {
      return Integer.parseInt(next());
    }
  }
}
