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 <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/9efda33382293068ce21371b950297a1d3ac3212.png" style="max-width: 100.0%;max-height: 100.0%;"/>.
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* ≤ 10<sup class="upper-index">9</sup>).
from fractions import Fraction

def isprime(n):
    """Returns True if n is prime."""
    if n % 2 == 0 or n % 3 == 0:
        return False

    i = 5
    w = 2

    while i * i <= n:
        if n % i == 0:
            return False

        i += w
        w = 6 - w

    return True

def getNextPrime(n):
    while not isprime(n):
        n += 1
    return n

def getFraction(n):
    if n in num_c:
        return (num_c[n], den_c[n])
    last_p = 3
    last_f = Fraction(num_c[last_p], den_c[last_p])
    for i in range(5, n, 2):
        if isprime(i):
            if i not in num_c:
                f2 = Fraction(1, last_p * i)
                f = last_f + ((i-last_p) * f2)
                num_c[i], den_c[i] = f.numerator, f.denominator
                last_f = f
            else:
                last_f = Fraction(num_c[i], den_c[i])
            last_p = i
    if last_p < n:
        next_p = getNextPrime(n)
        f2 = Fraction(1, last_p * next_p)
        f = last_f + ((n-last_p) * f2)
        num_c[n], den_c[n] = f.numerator, f.denominator
    return (num_c[n], den_c[n])
    
num_c = {2:1, 3: 7, 4: 9}
den_c = {2:6, 3:30, 4:30}
for _ in range(int(input())):
    n = int(input())
    (num, den) = getFraction(n)
    print('{}/{}'.format(num, den))
