A big company decided to launch a new series of rectangular displays, and decided that the display must have exactly *n* pixels. 

Your task is to determine the size of the rectangular display — the number of lines (rows) of pixels *a* and the number of columns of pixels *b*, so that:
 -  there are exactly *n* pixels on the display; -  the number of rows does not exceed the number of columns, it means *a* ≤ *b*; -  the difference *b* - *a* is as small as possible.
The first line contains the positive integer *n* (1 ≤ *n* ≤ 10<sup class="upper-index">6</sup>) — the number of pixels display should have.
In the first example the minimum possible difference equals 2, so on the display should be 2 rows of 4 pixels.

In the second example the minimum possible difference equals 0, so on the display should be 8 rows of 8 pixels.

In the third example the minimum possible difference equals 4, so on the display should be 1 row of 5 pixels.
8
2 4
64
8 8
5
1 5
999999
999 1001
716539
97 7387
1
1 1
2
1 2
3
1 3
4
2 2
6
2 3
7
1 7
9
3 3
10
2 5
11
1 11
12
3 4
15
3 5
100
10 10
101
1 101
169
13 13
179
1 179
190
10 19
1000
25 40
10000
100 100
10001
73 137
100000
250 400
100001
11 9091
1000000
1000 1000
999983
1 999983
524288
512 1024
954493
971 983
966289
983 983
944663
961 983
912673
97 9409
732641
679 1079
232897
343 679
16807
49 343
999958
2 499979
990151
1 990151
997002
998 999
20
4 5
20261
1 20261
999123
3 333041
901841
1 901841
"""

n = a * b

b == a
b > a
> b - a

"""

# num = 42

import math as m

# r = num**(1/2) 

# if r - m.floor(r) == 0:
#     print(int(r), int(r))

# listA = []
# listB = []

# for n in range(1, num):
#     if num % n == 0:
#         listA.append(n)
#     for nn in range(1, num):
#         if n * nn == num:
#             listB.append(nn)

# menores = []

# lista_lista = []

# for i in listA:
#     for j in listB:
#         if j * i == num:
#             lista = [j, i]
#             if i-j > 0:
#                 menores.append(i-j)
#                 # print(lista)
#                 lista_lista += [((i-j),lista)]
#                 #print(menores)
# #print(min(menores))

# # print(lista_lista)

# lista_menor_dif = lista_lista[0][1]
# menor_dif = lista_lista[0][0]
# for i in range(1,len(lista_lista)):
#     if lista_lista[i][0] < menor_dif:
#         menor_dif = lista_lista[i][0]
#         lista_menor_dif = lista_lista[i][1]
    
# print(lista_menor_dif[0], lista_menor_dif[1])

# 42: 1, 2, 3, 6, 7, 14, 21, 42
# 25 : 1, 5, 25

# fatores = []
# for f in range(1,num+1):
#     if num % f == 0:
#         fatores += [f]

# if len(fatores)%2 == 1:
#     f2 = fatores[len(fatores)//2+1]
#     print(f2, f2)
# else:
#     f1 = fatores[len(fatores)//2]
#     f2 = fatores[len(fatores)//2+1]
#     print(f1,f2)

def solve(num):
    f0 = pow(num,1/2)
    f0 = m.ceil(f0)
    f0 = int(f0)

    for f in range(f0,num+1):
        if num%f == 0:
            print(num//f, f)
            break

def main():
    t = int(input())
    while t > 0:
        
        # take input
        num = int(input())

        solve(num)

        t-=1


if __name__ == '__main__':
    main()