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(p):
    if p ==1 or p ==2:
        return True
    else:
        for i in range(2,n):
            if p % i == 0:
                return False
    return True

def lcm(x,y):
    if (x>y):
        greater = x
    else:
        greater = y
    while(True):
       if((greater % x == 0) and (greater % y == 0)):
           lcm = greater
           break
       greater += 1
    return lcm        
    
    

def add_fractions(a,b,c,d):
    lcd = lcm(b,d)
    d1 = lcd//b
    d2 =  lcd//d
    return (a*d1+c*d2, lcd)

def get_uandv(i):
    index = i+1
    while True:
        if prime(index) == True:
            break
        index = index+1    
    u = index
    index = i
    while True and index>=1:
        if prime(index) == True:
            break
        index = index-1    
    v = index 
    return v,u

def reduce_fraction(x,y):
    a = x
    b = y
    while b:
        a, b = b, a%b
    return x//a,y//a

t = int(input())

for _ in range(t):
    n = int(input())
    #print(n) 
    sum = (0,1)
    for k in range(2,n+1):
        v,u = get_uandv(k)
        #print(u,v)
        sum = add_fractions(sum[0], sum[1], 1, v*u)
        #print(sum)

    
    sum = reduce_fraction(sum[0], sum[1])
    print(sum[0],"/", sum[1], sep = "")





