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. 


-----Input-----

The first line contains the positive integer n (1 ≤ n ≤ 10^6) — the number of pixels display should have.


-----Output-----

Print two integers — the number of rows and columns on the display. 


-----Examples-----
Input
8

Output
2 4

Input
64

Output
8 8

Input
5

Output
1 5

Input
999999

Output
999 1001



-----Note-----

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.

Difficulty: interview

Starter code:

Solutions:

import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline

n=int(input())

for a in range(1,n+1)[::-1]:
    if n%a: continue
    if a>n//a: continue
    print("%s %s"%(a,n//a))
    break

n = int(input())

a = 1
b = n

for i in range(2, int(n**.5)+1):
    if n % i == 0:
        a = i
        b = n//i

print(a,b)


n = int(input())
rowres = 1
for row in range(1, n + 1):
	if n % row == 0:
		col = n // row
		if row <= col:
			rowres = row
print(rowres, n // rowres)

#!/usr/bin/env python3

def main():
    import math

    try:
        while True:
            n = int(input())
            x = int(math.sqrt(n))
            while n % x:
                x -= 1
            print(x, n // x)

    except EOFError:
        pass

main()


n = int(input())
top = 0

for i in range(1, int(n**(1/2))+1):
    if n % i == 0:
        top = max((top, i))

print(top, n//top)


from math import sqrt, ceil
n = int(input())
a = ceil(sqrt(n))
for i in range(a, n+1):
	if n%i == 0:
		print(n//i, i)
		return
		


x = int(input())
xd=[]
for i in range(1, x+1):
    if (x%i == 0 and i <= x/i):
        xd.append([i, x//i])
    
xd.sort(key = lambda x:x[1]-x[0])
print(xd[0][0], xd[0][1]);

def dl(n):
    ret = 0
    i = 1
    while (i * i <= n):
        if (n % i == 0):
            ret = i
        i += 1
    return ret


n = int(input())
kek1 = dl(n)
kek2 = n // kek1
print(kek1, kek2)

import math
n = int(input())
k = math.floor(n ** 0.5)
counter = 2
md = 1
while counter <= k:
    if n % counter == 0:
        md = counter
    counter += 1
print(md, n // md)


n = int(input())

a, b = -1, -1
for i in range(1, n+1):
    if n % i == 0:
        if i > n//i:
            break
        a, b = i, n//i
print(a, b)


import math
n = int(input())
aupper = int(math.sqrt(n))
for a in range(aupper,0,-1):
    if n%a == 0:
        print(a,int(n/a))
        break

n = int(input())

i = 1

r = 1, n

while i*i <= n:
	if n%i == 0:
		r = i, n//i
	i+=1

print(r[0], r[1])

n = int(input())
best = (n, 1)
for i in range(1, int(n ** 0.5 + 1)):
    if n %i == 0 and abs(n // i -  i) < abs(best[0] - best[1]):
        best = (n // i, i)
print(*sorted(best))

#!python

n = int(input())

m = n - 1
ii = 1
for i in range(1, int((n+2)/2)):
    if n%i == 0:
        if m > abs(i - n/i):
            ii = i
            m = abs(i - n/i)

jj = int(n/ii)

a, b = min(ii, jj), max(ii, jj)
print(a, b)

import math

n = int(input())

for i in range(1, int(math.sqrt(n)) + 1):
    if not (n % i):
        ans = [i, n // i]

print(ans[0], ans[1])

import math

def displaysize(n):
    s = int(math.floor(math.sqrt(n)))  
    while n % s != 0:
        s -= 1
    return (s,n//s)

def __starting_point():
    i = int(input())
    a,b = displaysize(i)
    print(str(a) + "   " + str(b))


__starting_point()

import math
n = int(input())
for i in range(round(math.sqrt(n)), 0, -1):
    if n%i == 0:
        cols = n//i
        break
print(n//(n//i), end = ' ')
print(n//i)


import math

size = int(input())

sml = 1

for i in range(math.floor(math.sqrt(size)), 1, -1):
	if size % i == 0:
		sml = i
		break

print("{0} {1}".format(sml, size//sml))

n = int(input())
min_sum, a, b = n, 0, 0
for i in range(1, int(n ** (1/2) + 1)):
    if not n % i and min_sum > abs(i - (n // i)):
        a, b = i, n // i
        min_sum = abs(a - b)

print(a , b)


n = int(input())

for i in range(1,int(n ** .5) + 1):
    if n % i == 0:
        a = i
print(a,n // a)

n=int(input())
b=int(n**0.5)
f=True
for i in range(b,1,-1):
    if n%i==0:
        print(min(n//i,i),max(n//i,i))
        f=False
        break
if f:
    print(1,n)


n = int(input().strip())
import math
for i in range(1, int(1+math.sqrt(n))):
    if n%i == 0:
        p = i
p = min(p, n/p)
n = n//p
print(p, n)


# python3
import math

def solve():
    n=int(input())
    m = int(math.sqrt(n))
    while n % m != 0:
        m-=1

    return str(m)+" "+ str(int(n/m))
    
print(solve())


import math

n = int(input())
lim = int(math.sqrt(n))

for a in range(lim, 0, -1):
    b = n/a
    if b == int(b):
        print(a, int(b))
        break



def problem(n):
    b=[]
    b=[x for x in range(1, n+1) if n % x == 0]
    return b[len(b)//2]
    
a=int(input())
c=problem(a)
print(a//c,c)