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>).
def prime(n):

    m = int(n ** 0.5) + 1

    t = [1] * (n + 1)

    for i in range(3, m):

        if t[i]: t[i * i :: 2 * i] = [0] * ((n - i * i) // (2 * i) + 1)

    return [2] + [i for i in range(3, n + 1, 2) if t[i]]



def gcd(a, b):

    c = a % b

    return gcd(b, c) if c else b



p = prime(31650)

def g(n):

    m = int(n ** 0.5)

    for j in p:

        if n % j == 0: return True

        if j > m: return False



def f(n):

    a, b = n, n + 1

    while g(a): a -= 1

    while g(b): b += 1

    p, q = (b - 2) * a + 2 * (n - b + 1), 2 * a * b

    d = gcd(p, q)

    print(str(p // d) + '/' + str(q // d))



for i in range(int(input())): f(int(input()))





# Made By Mostafa_Khaled