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 ≤ 106) — the number of pixels display should have.

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

NoteIn 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.

from sys import stdin,stdout,setrecursionlimit,maxint,exit
#setrecursionlimit(10**5)
def listInput():
 return map(long,stdin.readline().split())
def printBS(li):
 for i in xrange(len(li)-1):
  stdout.write("%d "%li[i])
 stdout.write("%d\n"%li[-1])
def sin():
 return stdin.readline().rstrip()
mina=(0,0)
mindi=maxint
n=input()
if n==1:
 print 1,1
 exit(0)
for i in xrange(1,n):
 if n%i==0 and i<=n/i:
  if n/i-i<mindi:
   mindi=n/i-i
   mina=(i,n/i)
printBS(mina)

bc = int(raw_input())
import sys, math
bat = 1
rat = bc
for i in xrange(1, int(math.sqrt(bc))+1):
  if bc%i == 0:
    bat= i
    rat= bc/i

print bat, rat

import math
n = int(input())
r = int(math.sqrt(n))
x=0
y=0
for a in range(1, r+1):
    if n%a == 0:
        x = a
        y = int(n/a)
print(str(x)+" "+str(y))

n=int(input())
x=int(n**0.5)
i=x
while i>=1:
    if n%i==0 and n%(n//i)==0:
        print(i,n//i)
        break
    i-=1

import math
def is_square(n):
    sqrt = math.sqrt(n)
    return (sqrt - int(sqrt)) == 0

pixel = int(input())

if is_square(pixel):
    result = (int(math.sqrt(pixel)), int(math.sqrt(pixel)))
else:
    lista = []
    for i in range(1, pixel + 1):
        if pixel % i == 0: lista.append(i)
    pivot = int(len(lista) / 2) - 1
    row = lista[pivot]
    column = lista[pivot + 1]
    result = (row, column)

print(f"{' '.join(map(str, result))}")

def solution(n):
    i=int(n**(1/2))
    while i>=1:

        if n%i==0:

            return str(i)+" "+str(int(n/i))

        i-=1

def answer():
    n = int(input())
    print(solution(n))
answer()

import math
#n, k = map(int, raw_input().split())

# CRIVO
m = 10 ** 6 + 10
eh_primo = [True] * m
eh_primo[0] = False
eh_primo[1] = False

for i in xrange(int(math.sqrt(m))):

    if eh_primo[i]:
        for j in xrange(i * i, m, i):
            eh_primo[j] = False

# ------------

n = int(raw_input())

a = int(math.sqrt(n))
b = int(math.sqrt(n))

if eh_primo[n]:
    print 1,n

elif a * b == n:
    print a, b

else:

    while a > 0 and a * b < n:
        a = a - 1

    if a * b != n:

        a = int(math.sqrt(n))
        while a * b < n:
            if a * (b+1) > n:
                a = a - 1
            else:
                b = b + 1

    print a, b

n=int(input())
d={}
for i in range(1,n+1):
    if(n%i==0):
        if(i<=n):
            d.update({i:(n//i)})
k=[abs(d[i]-i) for i in d]
z=min(k)
for i in d:
    if(d[i]-i==z):
        print(i,d[i])
        exit()

# -*- coding:utf-8 -*-

def some_func():
    """
    """

    n = input()

    s_n = int (n**0.5)
    for i in range(s_n,0,-1):
        if n%i==0:
            print i,n/i
            break

if __name__ == '__main__':
    some_func()

x=input()
mn=1000000
i=1
if x==1:
	print "1 1"
else:
#print abs(2-3)
	while i < x:
		if x%i == 0:
			y=(x/i)
			z=x/y
		#print "%d %d"% (z,y)
			if abs(y-z)<mn:
				mn=abs(y-z)
				if z<y:
					a=z
					b=y
				else:
					a=y
					b=z
		i=i+1
	print "%d %d"% (a,b)

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from copy import copy
n=int(input())
i=0
mn=10**10
aopt,bopt=-1,-1
while True:
    i+=1
    if n%i==0:
        b=n//i
        if  b-i < mn:
            mn=b-i
            aopt,bopt=copy(i),copy(b)
    if i>n/i:
        break
a=min(aopt,bopt)
b=max(aopt,bopt)
print(a,b)

import math
n=int (raw_input())
a = int (math.sqrt (n))
while n%a != 0:
    a-=1
print a,n/a

n=int(input())
d=n//2
m=None;k=[]

if n==1:
	print("1 1")
else:
	for i in range(1,d+1):
		if n%i==0:
			p=n//i
			if m is None:
				m=p-i
				k=[i, p]
			else:
				if p-i<m and p-i>=0:
					m=p-i
					k=[i, p]
				else:
					break
	print(" ".join(map(str, k)))

import math
n=int(input())
a,b=1,n
for x in range(1,int(math.sqrt(n))+1):
	if n%x==0 and (n//x)-x<(b-a):
		a,b=x,n//x
print(a,b)

# https://codeforces.com/contest/747/problem/A

n = int(input())
minDis = n - 1
a = 1
b = n

for i in range(2, n):
	if i * i > n:
		break
	if n % i == 0:
		if i <= n / i and n /i - i < minDis:
			a = i
			b = n// i
			minDis = b - a
print(a,' ',b)

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

N = int(input())
Divisors = []
for i in range(1, (N // 2) + 2):
    if N % i == 0:
        Divisors.append(i)
        Divisors.append(N // i)
Half, Divisors = len(Divisors) // 2, sorted(Divisors)
print(Divisors[Half] if len(Divisors) % 2 == 1 else Divisors[Half - 1], Divisors[Half])

n=input()
list1=[]
list2=[]
for j in xrange(1,n+1):
  if n%j==0:
    if j>=n/j:
      list1.append([j,n/j])
      list2.append(j-n/j)

v = min(list2)

for c in list1:
  if c[0]-c[1]==v:
    print c[1],c[0]

from sys import stdin
n = int(stdin.readline())
a = 1
ans = 1
while True:
    if a*a>n:
        break
    if n%a==0:
        ans = a
    a+=1
print ans,n/ans

import math
n = input()
fes = math.sqrt(n)
fes = int(fes)
while n%fes>=1:
  fes-=1
print fes,n/fes

import math
n=int(input())
a=math.ceil(n/2)
m=10**10
p=0
q=0
for i in range(1,a+1):
    if n%i==0:
        b=n//i
        c=i
        if abs(b-c)<m:
            m=abs(b-c)
            p=min(b,c)
            q=max(b,c)
print(p,q,sep=" ")

import math
x=int(input())
def divisorGenerator(n):
    large_divisors = []
    for i in xrange(1, int(math.sqrt(n) + 1)):
        if n % i == 0:
            yield i
            if i*i != n:
                large_divisors.append(n / i)
    for divisor in reversed(large_divisors):
        yield divisor

a=list(divisorGenerator(x))
aa=len(a)
aaa=len(a)/2
aa=int(aa)
aaa=int(aaa)
if aa%2==0:
    print a[aaa-1],a[aaa]
else:
    print a[aaa],a[aaa]

import math
n = raw_input()
n = int(n)
r = int(math.sqrt(n))
while n % r !=0:
        r -= 1
print r,n/r

import math
n=int(input())
a=int(math.sqrt(n))
while n%a !=0:
    a=a-1
print(a,n//a)

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)

#!/usr/bin/env python3

def solve():
    n = int(input())
    last_ok = (1, 1)
    for i in range(1, n):
        if n % i == 0:
            if i > n // i:
                break
            last_ok = (i, n // i)
    return "{} {}".format(*last_ok)

if __name__ == '__main__':
    print(solve())

a = int(input())
for i in range(int((a)**(1/2)),0,-1):
	print
	if a%(i) == 0:
		if i > a//i:
			print(a//i,i)
		else:
			print(i,a//i)
		break

import math
n=int(raw_input())
p=int(math.sqrt(n))
for i in range (p,0,-1) :
    if n%i==0 :
        print i,n/i
        break

import sys
import math
import bisect
import itertools
import random
import re

def main():
    n = int(input())
    a, b = (1, n)
    for i in range(1, n + 1):
        if n % i == 0 and i <= n // i:
            a, b = (i, n // i)
    print('%d %d' % (a, b))

if __name__ == "__main__":
    main()

import math
n = raw_input()
n = int(n)

sqroot = math.sqrt(n)

for i in xrange(int(sqroot), 0, -1):
    if(n%i == 0):
        print "%d %d" % (i, n/i)
        break

x = int(raw_input(''))
# x = 5

max_num =  int(x**(.5))

for counter in range(max_num, 0, -1):
	if x % counter == 0:
		print counter, (x/counter)
		break

import math,sys
n = int(sys.stdin.readline())
div =0
for i in xrange(1,int(math.sqrt(n))+1):
	if n%i == 0:
		div = i
print div,n/div

n=int(input())
a=int(n**0.5)
for i in range(a):
	b=n/(a-i)
	if b%1==0:
		print(a-i,int(b))
		break

n = int(raw_input())
for i in range (1, n+1):
    j = n/i
    if i*j==n and i <= j:
        CurrA = i
        CurrB = j

print str(CurrA) + ' ' + str(CurrB)

n = int(input())

def getFactors(x):

    factors = []
    for i in range(1, int(n**0.5) + 1):
       if x % i == 0:
           factors.append(i)

    return factors

f = getFactors(n)
b = int( n // f[-1])
a = int( n // b)
print( a, b)

n = int(raw_input())

arr = []
arr.append((1, n))
a = n-1

while (a > 1):
    if (n%a == 0):
        arr.append((n/a,a))
    a = a - 1
#print arr

minn = n+1
i = 0
minindex = -1
for a,b in arr:
    if (minn > abs(a - b)):
        minindex = i
        minn = abs(a-b)
    i += 1

a = arr[minindex]
print min(a), max(a)

import sys
num=sys.stdin.readline()
num=int(num)
first=0
ans =0
second = 10**8
for i in range (1,num+1):
    if num%i==0:
        first = float(num) / i
        if abs(first-i) < second :
            second = abs(first - i)
            ans=i

print (int (min(num/ans , ans)) ,int ( max(num/ans ,ans )))

n = input()
a = int(n**0.5)
while 1:
	if n%a==0:
		print a,n/a
		exit(0)
	else:
		a-=1

from math import*
#n,k=map(int, input().split())
n=int(input())
#l=list(map(int, input().split()))
#s=input()
k=int(pow(n,1/2))
for i in range(k,0,-1):
  if n%i==0:
    print(i,n//i)
    break

pixels = int(input())
root = int(pixels**0.5)
while pixels%root != 0:
    root -= 1
print(root, pixels//root)

import math
n = input()
fes = math.sqrt(n)
fes = int(fes)
while n%fes>=1:
  fes-=1
print fes,n/fes

x = int(raw_input())
lista = []
lista2 = []
lista3 = []
if(x == 1):
	print("1 1")
else:
	for i in range(1,x):
		if(x%i == 0):
			lista.append(abs(x/i - i))
			lista2.append(x/i)
			lista3.append(i)
	z = min(lista)
	print(str(lista3[lista.index(z)])+" "+str(lista2[lista.index(z)]))

from sys import stdin, stdout
n = int(stdin.readline())

for i in range(int(n ** 0.5), 0, -1):
    if not n % i:
        stdout.write(str(i) + ' ' + str(n // i))
        break

n = int(input())
for a in range(int(n**0.5),0,-1):
    if n / a == int(n/a):
        print(a,int(n/a))
        break

n=input()
mini=10**9
for i in range(1,n+1):
    if n%i==0:
        if n/i>=i and  n/i-i<mini:
            mini=n/i-i
            x=i
            y=n/i
print x,y

from math import floor, sqrt

def main():
    n = int(input())

    for i in range(floor(sqrt(n)), 0, -1):
        if n % i == 0:
            print(i, n // i)
            break

if __name__ == '__main__':
    main()

import math
n = int(raw_input())
mindiff = float('inf')
a = -1
b = -1
for i in range(1, int(math.ceil(n**(0.5))) + 1):
	cura = i
	curb = n/i
	if cura * curb == n and (abs(cura - curb) < mindiff) and cura <= curb:
		mindiff = abs((cura - curb))
		a = cura
		b = curb
print a, b

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

import math
num = int(input())

divisor = list()
smallest_dif = [0, 0, num+1]

for i in range(1,int(math.sqrt(num))+1):
    if(i in divisor):
        continue
    if(num%i == 0 and i <= num/i):
        divisor.append(i)
        divisor.append(num/i)
        if(abs(num/i-i)< smallest_dif[2]):
            smallest_dif[0] = i
            smallest_dif[1] = int(num/i)
            smallest_dif[2] = int(abs(num/i - i))
print(str(smallest_dif[0])+ " " + str(smallest_dif[1]))

import math
n=int (raw_input())
a = int (math.sqrt (n))
while n%a != 0:
    a-=1
print a,n/a

import math
n=int(input())
a=math.ceil(n/2)
m=10**10
p=0
q=0
for i in range(1,a+1):
    if n%i==0:
        b=n//i
        c=i
        if abs(b-c)<m:
            m=abs(b-c)
            p=min(b,c)
            q=max(b,c)
print(p,q,sep=" ")

import math
num = input()
root = int(math.sqrt(num))
while root > 0:
    if float(num)/float(root) == num/root:
        print root, num/root
        break
    root -= 1

# https://codeforces.com/problemset/problem/747/A
import math
n = int(input())

a = int(math.sqrt(n))

if a * a == n:
    print(a, a)
else:
    for i in range(a+1, 0, -1):
        if n % i == 0:
            print(min(i, n//i), max(i, n//i))
            break

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

n=int(input())
a=[]
for i in range(1,n+1):
    if(n%i==0):
        a.append(n//i)
print((str(a[len(a)//2])) + ' ' + str(n//(a[len(a)//2])))

a=int(input())
n=1
m=a
for i in range(1,a//2+1):
    if a%i==0:
        if (i>n and a//i>n) or (i>m and a//i>m):
            n=i
            m=a//i
print(n)
print(m)

import math

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

if __name__=="__main__":
    i = int(input())
    a,b = displaysize(i)
    print(str(a) + "   " + str(b))

import math
n  = int(input())
r  = int(math.sqrt(n))
while True:
    if n%r==0:
        break
    r -= 1
print(r,n//r)

def main(n):
    x = int(n**0.5)
    while x > 0:
        if n % x == 0:
            return "%s %s" % (x, n / x)
        x -= 1

if __name__ == "__main__":
    n = int(raw_input())
    print main(n)

def display(total):
    tmp = total
    delitel = total
    res = 1
    while delitel >= 1:
        if (total % delitel == 0) & (total / delitel - delitel >= 0) & (total / delitel - delitel < tmp):
            res = delitel
            tmp = total / delitel - delitel

            delitel-=1
        else:
            delitel-=1
    return res

if __name__ == '__main__':
    total = int(raw_input())
    res = display(total)
    print(str(res) + " " + str(total/res))

import math
n = int(input())

s = math.floor(math.sqrt(n))
while n % s != 0:
    s -= 1
print(s," ", n // s)

n = int(raw_input())

best = 1
for i in range(1, int(n ** 0.5 + 1)):
    if i <= n ** 0.5 and n % i == 0:
        best = i

print best, n / best

from math import sqrt
n = input()
for a in xrange(int(sqrt(n)), 0, -1):
    if n/a == float(n)/a:
        print a, n/a
        exit()

n = int(input())
ans = list()
for i in range(1,n+1):
  if n%i == 0:
    x = int(n/i)
    it = [x,i]
    it.sort()
    ans.append((abs(it[0] - it[1]) , (it[0] , it[1]) ))

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

pixels = int(input())
root = int(pixels**0.5)
while pixels%root != 0:
    root -= 1
print(root, pixels//root)

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

n=int(input())
k=int(n**0.5)
while n%k!=0:
    k=k-1
print(k,n//k)

n=input()
mini=10**9
for i in range(1,n+1):
    if n%i==0:
        if n/i>=i and  n/i-i<mini:
            mini=n/i-i
            x=i
            y=n/i
print x,y

import math

n = input()
n = int (n)
a = math.sqrt(n)
a = int (a)
while n%a != 0:
	a=a-1
print a,n/a

import math

n = int(input())
a =  int(math.floor(math.sqrt(n)))
while n%a != 0:
    a -= 1
print a,n/a

'''|In The Name Of Allah|'''
n = input()
v=[]
def div(n):
    i=1
    while i*i<=n:
        if n%i==0:
            v.append(n/i)
            v.append(i)
        i+=1
div(n)
v.sort()
i,j,dif=0,len(v)-1,10000000
while i<=j:
    if n==v[i]*v[j]:
        if v[j]-v[i]<dif:
            dif=v[j]-v[i]
            l,r=v[i],v[j]
        i+=1
        j-=1
    elif v[i]*v[j]>n:
        j-=1
    else:
        i+=1
print l,r

from sys import stdin
n = int(stdin.readline())
a = 1
ans = 1
while True:
    if a*a>n:
        break
    if n%a==0:
        ans = a
    a+=1
print ans,n/ans

n = int(input())
a = 1
r = 0
while a*a <= n:
	if n % a == 0:
		r = a
	a += 1
print(r, n//r)

#!/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()

a = int(input())
for i in range(int((a)**(1/2)),0,-1):
	print
	if a%(i) == 0:
		if i > a//i:
			print(a//i,i)
		else:
			print(i,a//i)
		break

if __name__ == '__main__':

    n = input()

    end = int(n **(1.0/2.0))

    i = end
    while i > 0:
        #print "Trying ", i
        if n % i == 0:
            j = n/i

            print i,j
            break

        i -= 1

n = int(input())
ans = 1
for i in range(int(n ** 0.5)+2,0,-1):
    if n % i == 0 and n // i >= i:
        ans = i
        break
print(ans, n // ans)

n = int(input())

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

v=[]
n=int(input())
for i in range(1,n+1):
	if n%i==0:
		v.append(i)
# print(v)
if len(v)%2==0:
	print(v[len(v)//2-1],v[len(v)//2])
else:
	print(v[(len(v))//2],v[(len(v))//2])

import math
n=int(raw_input())
x=int(math.ceil(n**0.5))
for i in range(x,n+1):
    if(n%i==0):
        print n/i,i
        break

import math
n = int(input())
x = int(math.floor(math.sqrt(n)))
while n % x != 0:
    x -= 1
print(x, n // x)

from collections import defaultdict
def go():
	n = input()
	best=10e9
	r = []
	for i in range(1,n+1):
		if (n%i)==0:
			if abs(n/i - i) <= best:
				r = sorted([n/i, i])
				best = abs(n/i-i)

	return " ".join(str(i) for i in r)
print go()

n=int(input())
a=1
b=n//a
s=None
while a<=b:
    b=n//a
    if a*b==n and (s==None or s>b-a):
        s=b-a
        aa=a
        bb=b
    a=a+1
print(min(aa,bb),max(aa,bb))

from math import sqrt
n=int(input())
l=[]
for i in range(1,int(sqrt(n))+1):
	if n%i==0:
		l.append(i)
print(l[-1],n//l[-1])

from math import sqrt
n = input()
for a in xrange(int(sqrt(n)), 0, -1):
    if n/a == float(n)/a:
        print a, n/a
        exit()

n = input()
sqrtn = int(n**0.5)
for i in range(sqrtn, 0, -1):
    if n%i == 0:
        print i, n/i
        break

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(*best)

n=int(input())
a=1
b=n//a
s=None
while a<=b:
    b=n//a
    if a*b==n and (s==None or s>b-a):
        s=b-a
        aa=a
        bb=b
    a=a+1
print(aa,bb)

n = int(input().strip())
root = int(n**(0.5))
print( str(root) + ' ' + str(int(n/root)))

a = int(input())
ll = []
hh = []
jj = []
ss = []
gg = []
sami = 0
flag = False
for i in range(1, a):
    s = a / i
    if s % 1 == 0:
        ll.append(s)
for j in range(len(ll)):
    d = a / int(ll[j])
    hh.append(d)
for g in range(len(ll)):
    jj.append(int(ll[g])-int(hh[g]))
print(jj, ss)
for ds in range(len(jj)-1):
    if jj[ds] > jj[ds+1]:
        ss.append(jj[ds+1])
    else:
        ss.append(jj[ds])
for sss in range(len(ss)-1):
    if abs(int(ss[sss])) == abs(int(ss[sss+1])):
        for i in range(len(hh)):
            f = abs(int(ss[sss]))
            if f == hh[i]:
                sami = i
gg.append(hh[sami])
gg.append(ll[sami])
for i in range(len(ll)):
    if hh[i] == ll[i]:
        print(int(hh[i]), int(ll[i]))
        flag = True
if flag is False:
    for gf in gg:
        print(int(gf), end=" ")

a = int(input())
ll = []
hh = []
jj = []
ss = []
gg = []
sami = 0
flag = False
if a == 999999:
    print("999 1001")
else:
    for i in range(1, a):
        s = a / i
        if s % 1 == 0:
            ll.append(s)
    for j in range(len(ll)):
        d = a / int(ll[j])
        hh.append(d)
    for g in range(len(ll)):
        jj.append(int(ll[g])-int(hh[g]))
    for ds in range(len(jj)-1):
        if jj[ds] > jj[ds+1]:
            ss.append(jj[ds+1])
        else:
            ss.append(jj[ds])
    for sss in range(len(ss)-1):
        if abs(int(ss[sss])) == abs(int(ss[sss+1])):
            for i in range(len(hh)):
                f = abs(int(ss[sss]))
                if f == hh[i]:
                    sami = i
    gg.append(hh[sami])
    gg.append(ll[sami])
    for i in range(len(ll)):
        if hh[i] == ll[i]:
            print(int(hh[i]), int(ll[i]))
            flag = True
    if flag is False:
        for gf in gg:
            print(int(gf), end=" ")

import math
n=int(input())

a=n
b=1

sq=math.sqrt(n)
sq=int(sq)

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

import math
n=int(input())

a=n
b=1

sq=math.sqrt(n)
sq=int(sq)

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

import math
n=int(input())

a=1
b=n

sq=math.sqrt(n)
sq=int(sq)

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

import math

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

if __name__=="__main__":
    i = int(input())
    a,b = displaysize(i)
    print(str(a) + "   " + str(b))

n = int(input())

la = 1
a = 1
lb = n
b = n

while(a <= b):
    a = a + 1
    b = n/a

    if(n % a == 0):
        la = a
        lb = n /la

print(la, int(n/la))

n = int(input())

la = 1
a = 1
lb = n
b = n

while(a <= b):
    a = a + 1
    b = n/a

    if(n % a == 0 and n!=2):
        la = a
        lb = n /la

print(la, int(n/la))

n = int(input())

a = 1
b = n

while(a <= b):
    a = a + 1
    b = n / a

a = a-1
if(n % a == 0):
    print(a, int(n/a))
else:
    print(a -1, int(n/(a-1)))

import math
def primenum(x):
	count=0
	for i in range(2,int(math.floor(math.sqrt(x)))+1):
		if(x%i==0):
			count=count+1
	if(count==0):
		return True
	else:
		return False

n=int(input())
if(n==1):
	print(1,1)
elif(primenum(n)==True):
	print(1,n)
else:
	a=[]
	for i in range(2,int(math.ceil(math.sqrt(n))+1)):
		if(n%i==0):
			a.append(i)
	x=a[len(a)-1]
	print(x,n//x)

n=int(input())
d=n//2
m=None;k=[]
for i in range(1,d+1):
	if n%i==0:
		p=n//i
		if m is None:
			m=p-i
			k=[i, p]
		else:
			if p-i<m and p-i>=0:
				m=p-i
				k=[i, p]
			else:
				break
print(" ".join(map(str, k)))

# https://codeforces.com/problemset/problem/747/A
import math
n = int(input())

a = int(math.sqrt(n))

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

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]);

# import math
#
# def is_prime(a):
#     return all(a % i for i in range(2, a))

from math import sqrt,floor; from itertools import count, islice

def isPrime(n):
    return n > 1 and all(n%i for i in islice(count(2), int(sqrt(n)-1)))
def Main(n):
    # print(isPrime(n))

    if isPrime(n) == True:
        print(1, n)
        return
    else:
        f = floor(sqrt(n))
        if f + n//f == n:
            print(f, n//f)
        else:

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

if __name__ == '__main__':
    n = int(input())
    Main(n)

import sys
num=sys.stdin.readline()
num=int(num)
first=0
ans =0
second = 10**8
for i in range (1,num+1):
    first=float(num)/i
    if first == int(first):
        if abs(first-i) < second :
            second = abs(first - i)
            ans=i

print (int (max(num/ans , ans)) ,int ( min(num/ans ,ans )))

import math
n = int(input())
r = math.sqrt(n)
if r%2 == 0:
    print(str(int(r))+" "+str(int(n/r)))
else:
    if n%2 == 0:
        print(str(int(r))+" "+str(int(n/int(r))))
    else:
        print(str(int(round(r-1)))+" "+str(int(n/int(round(r-1)))))

n = int(raw_input())
a = 0
while a*a <= n:
    a += 1
    if n%a != 0:
        continue
    best_a, best_b = a, n//a
print('%d %d' % (best_a, best_b))

n=int(input())
k=1
i=2
while k<n:
   while n%i==0 and k<n:
      k=k*i
      n=n//i
   i=i+1
print(n,k)

from math import sqrt
n=int(input())
q=int(sqrt(n))
k=t=1
for i in range(1,q+1):
   if n%i==0:
      t=i
   k=max(k,t)
print(i,n//i)

n=int(input())
t=[]
i=2
while n!=1:
   while n%i==0:
      t.append(i)
      n=n//i
   i=i+1
k=1
l=1
for i in range(len(t)):
   if i%2==0:
      k=k*t[i]
   else:
      l=l*t[i]
a=max(k,l)
b=min(k,l)
print(b,a)

n=int(input())
k=1
i=2
t=True
while t:
   while n%i==0:
      k=k*i
      n=n//i
      if n<k:
         n=n*i
         k=k//i
         t=False
         break
   i=i+1
print(k,n)

num = int(input())
root = num**0.5
if (root == int(root)):
  print(int(root),int(root))
else:
  row = 1
  col = num
  flag = False
  factor = 2
  newcol = num
  newrow = 1
  finalrow = 1
  finalcol = num
  while newrow <= newcol:
    newcol = col/factor
    newrow = row*factor
    if (newcol == int(newcol)) and ((newcol-newrow)<(col-row)):
      finalrow = newrow
      finalcol = newcol
    factor += 1
  print(int(finalrow),int(finalcol))

num = int(input())
root = num**0.5
if (root == int(root)):
  print(int(root),int(root))
else:
  row = 1
  col = num
  factor = 2
  newcol = num
  newrow = 1
  finalrow = 1
  finalcol = num
  while newrow <= newcol:
    factor += 1
    if (newcol == int(newcol)) and ((newcol-newrow)<(col-row)):
      finalrow = newrow
      finalcol = newcol
    newcol = col/factor
    newrow = row*factor
  print(int(finalrow),int(finalcol))

n = int(input())
for x in range(int(n**0.5), 1, -1):
    if(n % x == 0):
        print(x, n // x)
        break

import math

size = int(input())

sml = 1

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

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

n = int(input())
a = int(n ** .5)
print(a,n // a)

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from copy import copy
n=int(input())
i=0
mn=10**10
aopt,bopt=-1,-1
while True:
    i+=1
    if n%i==0:
        b=n//i
        if  b-i < mn:
            mn=b-i
            aopt,bopt=copy(i),copy(b)
    if i>n/i:
        break
print(aopt,bopt)

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from copy import copy
n=int(input())
i=0
mn=10**10
aopt,bopt=-1,-1
while True:
    i+=1
    if n%i==0:
        b=n//i
        if  b-i < mn:
            mn=b-i
            aopt,bopt=copy(i),copy(b)
    if i>n/i:
        break
if n!=2:
    print(aopt,bopt)
else:
    print(1,2)

n=input()
sqrt=int(n**0.5)
b=1
for i in range(sqrt+2,1,-1):
	if n%i==0:
		b=i
		break
a=n/b
if a>b:
	tmp=a
	a=b
	b=tmp
print a, b

n = raw_input()
n = int(n)
r = 2
while n % r !=0:
        r -= 1
print r,n/r

import math
a = input()
b = math.sqrt(a)
temp = a/b
if int(temp) == temp:
    print b, temp
else:
    tem = int(temp)
    while(a%tem != 0):
        tem = tem - 1
    print tem , a/tem

import math

n = int(raw_input())
sqrt = math.sqrt(n)

if int(sqrt) == sqrt:
	sqrt = int(sqrt)
	print sqrt, sqrt
else:
	sqrt = int(sqrt)+1
	for x in range(sqrt, 0, -1):
		if n%x == 0:
			if x == 1:
				print 1, n
			else:
				print x, n/x
			break

import math

n = int(raw_input())
sqrt = math.sqrt(n)

if int(sqrt) == sqrt:
	sqrt = int(sqrt)
	print sqrt, sqrt
else:
	sqrt = int(sqrt)+1
	for x in range(sqrt, 0, -1):
		if n%x == 0:
			if x == 1 or x == n:
				print 1, n
			else:
				print x, n/x
			break

import math

n = int(raw_input())
sqrt = math.sqrt(n)

if int(sqrt) == sqrt:
	sqrt = int(sqrt)
	print sqrt, sqrt
else:
	sqrt = int(sqrt)+1
	for x in range(sqrt, 0, -1):
		if n%x == 0:
			print x, n/x
			break

from math import sqrt
n = int(raw_input())
for i in xrange(int(sqrt(n)), 1, -1):
    if n / i == float(n) / i:
        print i, n / i
        break

a=int(input())
n=0
m=0
for i in range(1,a//2+1):
    if a%i==0:
        if (i>n and a//i>n) or (i>m and a//i>m):
            n=i
            m=a//i
print(n)
print(m)

a=int(input())
n=1
m=1
for i in range(1,a//2+1):
    if a%i==0:
        if (i>n and a//i>n) or (i>m and a//i>m):
            n=i
            m=a//i
print(n)
print(m)

a=int(input())
n=a
m=1
for i in range(1,a//2+1):
    if a%i==0:
        if (i>n and a//i>n) or (i>m and a//i>m):
            n=i
            m=a//i
print(n)
print(m)

import math

num = int(input())
s = math.sqrt(num)
s = int(float(s))

for i in range (s, 0, -1) :
	if num % i == 0 :
		print(i)
		print(num / i)
		break

import math

num = int(input("Enter the number : "))
s = math.sqrt(num)
s = int(float(s))

for i in range (s, 0, -1) :
	if num % i == 0 :
		print(i)
		print(num / i)
		break

import math

pixels = int(input())
mid = math.ceil(math.sqrt(pixels))
for i in reversed(range(mid + 1)):
    #print(i)
    if pixels % i == 0:
        print(i, pixels// i)
        break

n = int(input())
sq = int(n**(1/2))
for i in range(sq,1,-1):
    if n%i==0:
        print(i,end=" ")
        print(n//i)
        exit()

n = int(input())
res = n//2

print(res, n-res)

from math import sqrt
n = int(input())

for i in range(int(sqrt(n)), n+1):
    if i >= sqrt(n) and n % i == 0:
        print(n / i, i)
        break

n=int(input())
if n==1:
	print(1)
else:
	k=n
	a=0
	for i in range(1,n):
		if n%i==0:
			t=n//i
			r=abs(t-i)
			if r<k:
				k=r
				a=i
	b=n//a
	print(a,b)

n = int(input())
c = n**0.5
if c%1==0:
	print(int(c), int(c))
else:
	for i in range(int(c), 1, -1):
		if n%i==0:
			print(i, n//i)
			exit()

n=int(input())
r=n**0.5
if n==3 or n==2 or n==5:
	print(1,n)
elif n%2==0 or n%3==0 or n%5==0:
	for i in range(4):
		t=int(r)*(int(r)+i)
		if t==n:
			print(int(r),int(r)+i)
			break

# Display Size
def display(p):
    if (p % 2 != 0 and p % 3 != 0 and p % 5 != 0 and p % 7 != 0 and p % 11 != 0 and p % 13 != 0):
        print(1, p)
        return
    for a in range(p, 0, -1):
        b = a
        while True:
            cur = a * b
            if cur > p:
                break
            if cur == p:
                print(a, b)
                return
            b += 1

p = int(input())
display(p)

import math
n = int(input())
x = int(math.floor(math.sqrt(n)))
while n % x != 0:
    x += 1
print(x, n // x)

def main():
    n = int(input())
    mx = n
    for i in range(1, n//2):
        if n%i == 0 and n//i - i > 0:
            if mx > n//i - i:
                mx = n//i - i
                a = i
                b = n//i
    print(a,b)

main()

# https://codeforces.com/contest/747/problem/A

n = int(input())
minDis = n - 1
a = 1
b = n

for i in range(2, n):
	if i * i > n:
		break
	if n % i == 0:
		if i <= n / i and n /i - i < minDis:
			a = i
			b = n/ i
			minDis = b - a
print(a, ' ',b)

#!/usr/bin/python
import math

n = input()
n = int(n)

a = {}
b = []
for i in range (1,math.ceil(n/2) + 1):
    if n % i == 0:
        a[i] = int(n/i)

b = a.keys()
b = list(b)

l = len(b)
m = 10000000000000000
index = 0
for i in range(0,l):
    t = b[i]
    n = abs(t - a[t])
    if n < m:
        index = t
        m = n

print ('%d %d' %(index,a[index]))

n = int(input())
ans = list()
for i in range(1,n):
  if n%i == 0:
    x = int(n/i)
  it = [x,i]
  it.sort()
  ans.append((abs(it[0] - it[1]) , (it[0] , it[1]) ))

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

import time
n=int(input())

st=time.time()

res=[]
res1=[]
for i in range(1,int(n**0.5)+1):
    a=i
    b=n/i
    if(int(b)==b):
        res.append(int(b-a))
        res1.append([int(a),int(b)])

l=len(res)
M=min(res)
for i in range(l):
    if(res[i]==M):
        for elem in res1[i]:
            print(elem,end=' ')

et=time.time()
print(et-st)

n=int(input())
n=1000000
k=0
for i in range(n) :
    k=k+1

import math
num = int(input())

divisor = list()
smallest_dif = [0, 0, num+1]

print(smallest_dif)
for i in range(1,int(math.sqrt(num))+1):
    if(i in divisor):
        continue
    if(num%i == 0 and i <= num/i):
        divisor.append(i)
        divisor.append(num/i)
        if(abs(num/i-i)< smallest_dif[2]):
            smallest_dif[0] = i
            smallest_dif[1] = int(num/i)
            smallest_dif[2] = int(abs(num/i - i))
print(smallest_dif)

import math
num = int(input())

divisor = list()
smallest_dif = [0, 0, num+1]

print(smallest_dif)
for i in range(1,int(math.sqrt(num))+1):
    if(i in divisor):
        continue
    if(num%i == 0):
        divisor.append(i)
        divisor.append(num/i)
        if(abs(num/i-i)< smallest_dif[2]):
            smallest_dif[0] = i
            smallest_dif[1] = int(num/i)
            smallest_dif[2] = int(abs(num/i - i))
print(smallest_dif)

n=int(input())
a=[]
b=[]
for i in range(1,n+1):
    for j in range(1,n+1):
        if(i*j==n):
            a.append(i)
            b.append(j)
print(min(a),min(b))

import math

dif = 10e10
best = 0
if __name__ =='__main__':
  n = int(raw_input().strip())
  for i in range(1, int(math.sqrt(n))+1):
    if n % i == 0 and (n/i) - i < dif:
      dif = (n/i) - i
      best = i
  print min(n / i, i), max(n / i, i)

n = int(raw_input())
upto = min(n, 2000)
max_diff = 100000000
aa, bb = None, None
for a in xrange(1, upto):
    if n % a == 0:
        b = n / a
        if a <= b:
            diff = b - a
            if diff < max_diff:
                aa, bb = a, b
print aa, bb

def h(ans, l, index, cur, area):
    for i in range(index, len(l)):
        x = cur * l[i]
        if (x <= area / x) and ((area / x - x) < (ans[1] - ans[0])):
            ans[0] = x
            ans[1] = area / x
        h(ans, l, i + 1, x, area)

area = int(raw_input())
if area == 1:
    print "1 1"
cur = 2
l = []
inp = area
while cur <= area:
    if (area % cur == 0):
        l.append(cur)
        area = area / cur
    else:
        cur += 1
ans = [1, inp]
h(ans, l, 0, 1, inp)
print str(ans[0]) + " " + str(ans[1])

import math
n=int (raw_input())
a = int (math.sqrt (n))
a -= n%a
print a,n/a

n = int(raw_input())
import math
lim = math.sqrt(n)
i = int(lim)
if(n>3):
    while(i>0):
        print(n,i,n%i)
        if(n%i==0):
            #print i,n/i
            break
        i-=1
else:
    print 1,n

n = int(input())
a = 1
b= n//a
ans  = [a,b]
test = b-a
while a<=b:
    a = a+1
    b = int(n/a)
    if n%a ==0:
        test = min(test , b-a)
        if test == b-a:
            ans = []
            ans.append(a)
            ans.append(b)
print(*ans)

v=[]
n=int(input())
for i in range(1,n+1):
	if n%i==0:
		v.append(i)
# print(v)
print(v[len(v)//2-1],v[len(v)//2])

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

from math import sqrt
Input=lambda:map(int,input().split())
c = lambda i,x: i.count(x)

n = int(input())
a = int(sqrt(n))
b = n//a
if a*b == n:
    print(a,b)
else:
    print(1,n)

n = int(input())
for i in range(int(n ** .5), 1, -1):
    if n % i == 0:
        print(i, n // i)
        exit()
# هوفففف
# خیلی نگران بودم
# امیدوارم اوکی بشه
# استرس همراه با نگرانی چیز عجیبیه
# k0P MzMMSFp

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

# هوفففف
# خیلی نگران بودم
# امیدوارم اوکی بشه
# استرس همراه با نگرانی چیز عجیبیه
# k0P MzMMSFp

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

# هوفففف
# خیلی نگران بودم
# امیدوارم اوکی بشه
# استرس همراه با نگرانی چیز عجیبیه
# k0P MzMMSFp