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>).
import math 
prime_numbers = [2]

def prime(p):
    if p ==1 or p ==2:
        return True
    else:
        for i in prime_numbers:
            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)
    return (a*d+c*b, b*d)

def get_uandv(i):
    # index = i+1
    # 
    # index = i
    # while True and index>=1:
    #     if prime(index) == True:
    #         break
    #     index = index-1    
    # v = index 
    lenth = len(prime_numbers)
    if i in prime_numbers:
        v = i
        j = prime_numbers.index(i)
        if j+1 < lenth:
             u = prime_numbers[j+1]
        else:
            index = i+1
            while True:
                if prime(index) == True:
                    break
                index = index+1    
            u = index 
            prime_numbers.append(u)
    else:
         for k in range(lenth):
             if prime_numbers[k] > i:
                u = prime_numbers[k] 
                if (k-1)>= 0:
                    v=prime_numbers[k-1] 
                else:
                     v = 2
                break         
    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())


tests = []
for _ in range(t):
    n = int(input())
    tests.append(n)

max_test = max(tests)
prime_u = []
prime_v = []
for _ in range(max_test+1):
    prime_u.append(0)
    prime_v.append(0)

partial_sums = []
for _ in range(max_test+1):
    partial_sums.append((0,0))


for i in range(3,max_test+1):
    if prime(i):
        prime_numbers.append(i)
#print(prime_numbers)
length = len(prime_numbers)
partial_sums[0] = (0,1)
# for i in range(t):
#     if partial_sums[tests[i]]  == (0,0):
#         for k in range(2,tests[i]+1):
#             if partial_sums[k] == (0,0):  
#                 if (prime_u[k]==0 and prime_v[k]==0):
#                      v,u = get_uandv(k)
#                      prime_u[k] = u
#                      prime_v[k] = v   
#                # print(k-1,partial_sums[k-1][0], partial_sums[k-1][1])    
#                 partial_sums[k] = add_fractions(partial_sums[k-1][0], partial_sums[k-1][1], 1, prime_u[k]*prime_v[k])
#                 #print(partial_sums[tests[i]][0],"/", partial_sums[tests[i]][1], sep = "")   
#                 partial_sums[k] = reduce_fraction(partial_sums[k][0], partial_sums[k][1])
#                # print(partial_sums[k][0],"/",partial_sums[k][1], sep = "")
#         print(partial_sums[tests[i]][0],"/", partial_sums[tests[i]][1], sep = "")          
#     else:
#         print(partial_sums[tests[i]][0],"/", partial_sums[tests[i]][1], sep = "")

for i in range(t):
    if tests[i] >= prime_numbers[length-1]:
        index = tests[i]+1
        while True:
            if prime(index) == True:
                break
            index = index+1    
        prime_numbers.append(index)
    for k in range(len(prime_numbers)):
        if prime_numbers[k] > tests[i]:
           inx = k 
           break
    #print(inx)    
    if (inx==1):
        print(1,"/",6, sep = "")
    else: 
        for l in range(inx-1):
            partial_sums[l+1] = add_fractions(partial_sums[l][0], partial_sums[l][1], prime_numbers[l+1]-prime_numbers[l], prime_numbers[l]*prime_numbers[l+1])
            partial_sums[l+1] = reduce_fraction(partial_sums[l+1][0], partial_sums[l+1][1])      
           # print(partial_sums[l+1][0],"/", partial_sums[l+1][1], sep = "")  
        partial_sums[inx] = add_fractions(partial_sums[inx-1][0], partial_sums[inx-1][1], tests[i]-prime_numbers[inx-1]+1, prime_numbers[inx]*prime_numbers[inx-1])
        partial_sums[inx] = reduce_fraction(partial_sums[inx][0], partial_sums[inx][1]) 
        print(partial_sums[inx][0],"/", partial_sums[inx][1], sep = "")        

    
    
   





