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: EASY

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


from math import *
n = int(input())
num1 = ceil(sqrt(n))
num2 = floor(sqrt(n))
while n % num1 != 0:
	num1 += 1
while n % num2 != 0:
	num2 -= 1
print(num2, num1)


from math import sqrt
n = int(input())
a = 1
b = n
x = 1
while x <= sqrt(n):
	if n % x == 0:
		a = x
		b = n // x
	x += 1
print(a, b, sep=' ')


def solve(n):
	r = k = 1
	while k * k <= n:
		if n % k == 0:
			r = k
		k += 1
	return '%d %d' % (r, n / r)
print(solve(int(input())))


n = int(input())
import math
a = int(math.pow(n, 0.5))
for i in range(a, 0, -1):
	b = n / i
	if int(b + 0.9) == b:
		print(i, int(b))
		break


import math
n = int(input())
m = 1000000
for i in range(1, int(math.sqrt(n)) + 1):
	if n % i == 0:
		if i <= n // i:
			if abs(i - n // i) < m:
				a = i
				b = n // i
		else:
			break
print(a, b)


Input = lambda : map(int, input().split())

def diviser(num):
	Len = 1
	div = [num]
	a = num // 2
	while a >= 1:
		if num % a == 0:
			div.append(a)
			Len += 1
		a -= 1
	return (div, Len)
n = int(input())
(div, Len) = diviser(n)
if Len % 2 == 0:
	print(div[Len // 2], div[Len // 2 - 1])
else:
	print(div[Len // 2], div[Len // 2])


import math
N = int(input())
las = 0
for wi in range(1, int(math.sqrt(N)) + 1):
	if N % wi == 0:
		las = wi
print('%d %d' % (las, int(N / las)))


n = int(input())
if n == 1:
	print(1, 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)


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)


anum = int(input())
factor1 = int(anum ** 0.5)
while factor1 > 0:
	if (anum / factor1).is_integer():
		if int(anum / factor1) < factor1:
			print(int(anum / factor1), factor1)
		else:
			print(factor1, int(anum / factor1))
		break
	else:
		factor1 -= 1
		continue


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


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)


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, z) = (int(input()), 1)
for i in range(1, int(n ** 0.5) + 1):
	if n % i == 0:
		z = i
print(z, n // z)


n = int(input())
maxi = 100000000000000
for i in range(1, n + 1):
	A = i
	if n % i == 0:
		B = n // i
		if A <= B:
			C = abs(A - B)
			if C < maxi:
				maxi = C
				ans1 = A
				ans2 = B
print(ans1, ans2)


v = []
n = int(input())
for i in range(1, n + 1):
	if n % i == 0:
		v.append(i)
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])


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


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


from math import *
n = int(input())
l = []
m = []
for i in range(1, int(sqrt(n)) + 1):
	if n % i == 0:
		ch = str(i) + ' ' + str(int(n / i))
		l.append(ch)
		c = abs(int(n / i) - i)
		m.append(c)
ch = str(n) + ' 1'
l.append(ch)
m.append(abs(n - 1))
a = min(m)
b = m.index(a)
print(l[b])


def main():
	n = int(input())
	mx = n
	for i in range(1, n // 2 + 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()


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


from math import *
x = int(input())
l = []
for i in range(1, int(sqrt(x)) + 1):
	if x % i == 0:
		l.append(i)
l.sort(reverse=True)
if l[0] * l[0] == x:
	print(l[0], l[0], sep=' ')
else:
	print(l[0], x // l[0], sep=' ')


import math

def factorize(n):
	f = []
	for i in range(1, int(math.sqrt(n)) + 1):
		if n % i == 0:
			f.append(i)
			f.append(n // i)
	return f
n = int(input())
x = factorize(n)
d = n - 1
a = 0
b = 0
for i in range(0, len(x) - 1, 2):
	if abs(x[i] - x[i + 1]) <= d:
		d = abs(x[i] - x[i + 1])
		a = x[i]
		b = x[i + 1]
print(a, b)


import math

def findans(n):
	r = math.floor(math.sqrt(n))
	for i in range(r, 0, -1):
		if n % i == 0:
			return (i, n // i)
n = int(input())
(a, b) = findans(n)
print(min(a, b), max(a, b))


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())
a = set()
i = 1
while i * i <= n:
	if n % i == 0:
		a.add((i, n // i))
	i += 1
b = []
a = list(a)
for i in range(len(a)):
	(c, d) = a[i]
	b.append(abs(c - d))
print(*a[b.index(min(b))])


n = int(input())
a = 1
b = n
ansa = 1
ansb = n
mi = abs(b - a)
for i in range(0, n // 2):
	a += 1
	if n % a == 0:
		b = n // a
		if abs(b - a) < mi:
			mi = abs(b - a)
			ansa = a
			ansb = b
print(ansa, ansb)


from math import *

def Main(n):
	a = int(floor(sqrt(n)))
	while n % a:
		a -= 1
	print(a, n // a)
n = int(input())
Main(n)


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(min(x, n // x), max(x, n // x))


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())
MassFactor = []
for i in range(1, int(n ** 0.5) + 1):
	if n % i == 0:
		MassFactor.append([i, n // i])
d = MassFactor[0][1] - MassFactor[0][0]
q = 0
for i in range(1, len(MassFactor)):
	if MassFactor[i][1] - MassFactor[i][0] < d:
		d = MassFactor[0][1] - MassFactor[0][0]
		q = i
print(MassFactor[q][0], MassFactor[q][1])


import math
n = int(input())
a = int(math.sqrt(n))
while n % a != 0:
	a = 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]
			elif p - i < m and p - i >= 0:
				m = p - i
				k = [i, p]
			else:
				break
	print(' '.join(map(str, k)))


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


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))
main()


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


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


n = int(input())
(a, b) = (1, n)
for i in range(1, round(n ** (1 / 2)) + 1):
	if n % i == 0:
		(a, b) = (i, n // i)
print(str(a) + ' ' + str(b))


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


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


n = int(input())
i = 1
li = []
while i * i < n:
	if n % i == 0:
		b = n // i
		li.append(i)
		li.append(b)
	i += 1
if i * i == n:
	print(i, i)
else:
	print(li[-2], li[-1])


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


n = int(input())

def factors(n):
	l = []
	for i in range(1, n + 1):
		if n % i == 0:
			l.append(i)
	return l
m = factors(n)
if len(m) % 2 == 0:
	print(m[len(m) // 2 - 1], m[len(m) // 2])
else:
	print(m[len(m) // 2], m[len(m) // 2])


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)
if b >= a:
	print(a, b)
else:
	print(b, a)


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


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


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 a <= b:
		la = a
		lb = n / la
print(la, int(n / la))


n = int(input())
res = 1
for i in range(2, int(n ** 0.5) + 1):
	if n % i == 0:
		res = i
print(res, n // res)


def optimal_divider(n):
	optimal = n ** 0.5
	optint = int(optimal)
	for ans1 in range(optint, 0, -1):
		ans2 = n // ans1
		if ans1 * ans2 == n:
			return (ans1, ans2)
n = int(input())
print(*optimal_divider(n))


n = int(input())
m = 10 ** 10
for i in range(1, int(n ** 0.5 + 1)):
	if n % i == 0:
		if m > n // i - i:
			m = n // i - i
			mini = i
print(mini, n // mini)


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


import math
n = int(input())
x = str(math.sqrt(n))
if x.endswith('.0'):
	print(x[:len(x) - 2], x[:len(x) - 2])
	exit(0)
l = []
for i in range(1, n + 1):
	if n % i == 0:
		l.append(i)
(m, temp) = ([], [])
for i in range(len(l)):
	for j in range(i + 1, len(l)):
		if l[i] * l[j] == n and l[i] <= l[j]:
			m.append(l[j] - l[i])
			temp.append([l[i], l[j]])
(minimum, x, y) = (m[0], temp[0][0], temp[0][1])
for i in range(1, len(m)):
	if minimum > m[i]:
		(minimum, x, y) = (m[i], temp[i][0], temp[i][1])
print(x, y)


a = int(input())
ll = []
hh = []
jj = []
ss = []
gg = []
sami = 0
flag = False
if a == 1:
	print('1 1')
else:
	for i in range(1, a):
		s = a / i
		if s % 1 == 0:
			ll.append(s)
			d = a / int(s)
			hh.append(d)
			jj.append(int(s) - int(d))
	for ds in range(len(jj) - 1):
		ss.append(jj[ds + 1])
	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 == jj[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=' ')


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)


n = int(input())
from math import sqrt as S
sq = int(S(n))
for i in range(sq, 0, -1):
	if n % i == 0:
		print(i, n // i)
		exit()


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


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	ans = inf
	ans_pair = [0, 0]
	for i in range(1, n + 1):
		if n % i == 0:
			x = n // i
			if ans > abs(x - i):
				ans = abs(x - i)
				ans_pair = [i, n // i]
	(a, b) = sorted(ans_pair)
	return str(a) + ' ' + str(b)
print(main())


from math import sqrt
n = int(input())
b = 1.5
if sqrt(n) % 1 == 0:
	print(int(sqrt(n)), int(sqrt(n)))
else:
	p = int(sqrt(n)) + 1
	while b % 1 != 0:
		p -= 1
		b = n / p
	print(p, int(b))


import string

def reversed_list(l, start, end):
	if start >= end:
		return l
	(l[start], l[end]) = (l[end], l[start])
	return reversed_list(l, start + 1, end - 1)

def main_function():
	n = int(input())
	possiblities = [n, 1]
	for b in range(1, n + 1):
		if not n % b:
			a = n // b
			if b >= a:
				if b - a < possiblities[0] - possiblities[1]:
					possiblities = [b, a]
	return f'{possiblities[1]} {possiblities[0]}'
print(main_function())


def prost(n):
	d = 2
	while n % d != 0 and d * d <= n:
		d += 1
	if d * d > n:
		return True
	else:
		return False
n = int(input())
if n == 1:
	print(1, 1)
elif n == 2:
	print(1, 2)
else:
	bol = prost(n)
	if bol == True:
		print(1, n)
	else:
		raz = 1000000000000000000000
		(a, b) = (0, 0)
		d = 2
		while n >= d * d:
			if n % d == 0:
				if abs(d - n // d) < raz:
					raz = abs(d - n // d)
					a = min(d, n // d)
					b = max(d, n // d)
			d += 1
		print(a, b)


n = input()
n = int(n.strip())
t = int(n ** 0.5)
while True:
	if n % t == 0:
		a = min(t, n // t)
		b = max(t, n // t)
		print(a, b)
		break
	t = t - 1


import sys
num = sys.stdin.readline()
num = int(num)
first = 0
ans = 0
second = 10 ** 8
for i in range(1, int(num ** 0.5) + 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)))


num = int(input())
root = num ** 0.5
if root == int(root):
	print(int(root), int(root))
else:
	row = 1
	col = num
	factor = 1
	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))


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


from math import *
n = int(input())
a = 1
ans = 1
while a * a <= n:
	if n % a == 0:
		ans = a
	a += 1
print(ans, n // ans)


import math
a = int(input())
b = math.sqrt(a)
if b == int(b):
	print(int(b), int(b))
else:
	p = []
	for j in range(a // 2, 0, -1):
		if a % j == 0:
			p.append([abs(j - a // j), j])
	p.sort()
	print(p[0][1], a // p[0][1])


n = int(input())
x = int(pow(n, 0.5))
if n % x == 0:
	print(x, n // x)
else:
	while n % x != 0:
		x -= 1
	print(x, n // x)


import math
x = int(input())
y = int(math.sqrt(x))
while y > 0:
	if x % y == 0:
		print(y, int(x / y))
		break
	else:
		y -= 1


def solve():
	global a, b, n
	now = 1000000000.0
	for i in range(1, n + 1):
		if n % i == 0:
			if i > n // i:
				break
			a = i
			b = n // i
n = int(input())
solve()
print(a, b)


num = int(input())
mn = float('inf')
ans = []
for i in range(1, int(num ** 0.5) + 1):
	if num % i == 0:
		add = i + num // i
		if add < mn:
			ans = [i, num // i]
print(*ans)


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


def main():
	n = int(input())
	(row, col) = solver(n)
	print(row, col)

def solver(n):
	sqrt = int(n ** 0.5)
	for row in range(sqrt, 0, -1):
		if n % row == 0:
			return (row, n // row)
	assert False
main()


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


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


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


def codeforces(pixels):
	difference = float('inf')
	for i in range(1, pixels + 1):
		if pixels % i == 0:
			diff = abs(pixels // i - i)
			if diff < difference:
				nums = (pixels // i, i)
				difference = diff
	return (str(min(nums)), str(max(nums)))
n = int(input())
print(' '.join(codeforces(n)))


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


n = int(input())
x = 1
y = n
min = y - x
for i in range(0, n):
	if i != 0 and n % i == 0:
		a = i
		b = n // i
		if min > abs(b - a) and a <= b:
			x = a
			y = b
print(x, y)


n = int(input())
import math
a = 1
b = n
r = n - 1
ra = 1
rb = n
while a <= math.sqrt(n) + 1:
	a += 1
	if n % a == 0:
		b = n // a
		if b >= a and b - a < r:
			r = b - a
			ra = a
			rb = b
print(ra, rb)


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


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


import math
n = int(input())
r = 1000000000000000000000000
a = 0
b = 0
if n == 1:
	print(1, 1)
elif n == 2:
	print(1, 2)
else:
	for i in range(1, int(math.sqrt(n)) + 1):
		if n % i == 0 and abs(n // i - i) < r:
			r = abs(n // i - i)
			a = min(n // i, i)
			b = max(n // i, i)
	print(a, b)


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


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(k, n // k)


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


def display(p):
	c = p ** 0.5
	if c % 1 == 0:
		print(int(c), int(c))
		return
	else:
		for i in range(int(c), 0, -1):
			if p % i == 0:
				print(i, p // i)
				return
p = int(input())
display(p)


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
while True:
	try:
		num = int(input())
		ans = int(math.sqrt(num))
		while True:
			if num % ans == 0:
				print(ans, num // ans)
				break
			else:
				ans -= 1
	except EOFError:
		break


n = int(input())
i = int(n ** 0.5)
test = False
while test == False:
	if n % i == 0:
		test = True
	i = i - 1
print(i + 1, n // (i + 1))


import sys

def main():
	n = int(sys.stdin.read().strip())
	return next(((i, n // i) for i in range(int(n ** 0.5), 0, -1) if not n % i))
print(*main())


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


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


from math import *
n = int(input())
k = int(pow(n, 1 / 2))
for i in range(k, 0, -1):
	if n % i == 0:
		print(i, n // i)
		break


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


n = int(input())
if n == 1:
	print(1, 1)
else:
	z = n - 1
	for i in range(1, n // 2 + 1):
		if n % i == 0 and z > 0:
			b = n // i - i
			if z > b:
				z = n // i - i
			m = i
	if m != 1:
		print(n // m, m)
	else:
		print(m, n // m)


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())
from math import *
b = sqrt(n) // 1
s = 0
a = int(b)
for i in range(1, a + 1):
	if n % i == 0 and s < i:
		s = i
k = n // s
print(s, k)


lis = []

def print_factors(x):
	for i in range(1, x + 1):
		if x % i == 0:
			lis.append(i)
print_factors(int(input()))
if len(lis) % 2 == 0:
	print(lis[len(lis) // 2 - 1], lis[len(lis) // 2])
else:
	print(lis[(len(lis) - 1) // 2], lis[(len(lis) - 1) // 2])


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


import sys
n = int(input())
t = n // 2
mi = sys.maxsize
if n == 1:
	print('1', '1')
else:
	while t <= n:
		if n % t == 0:
			t1 = n // t
			m = abs(t - t1)
			if m < mi:
				mi = m
				a = min(t, t1)
				b = max(t, t1)
		t += 1
	t = n // 2
	while t > 0:
		if n % t == 0:
			t1 = n // t
			m = abs(t - t1)
			if m < mi:
				mi = m
				a = min(t, t1)
				b = max(t, t1)
		t -= 1
	print(a, b)


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


from math import sqrt
n = int(input())
m = 999999999
for i in range(1, int(sqrt(n)) + 1):
	if n % i == 0 and i * (n // i) == n:
		x = n // i - i
		if m >= x:
			(a, b) = (i, n // i)
			m = x
print(a, b)


n = int(input())
m = 10 ** 6
(a, b) = (0, 0)
for i in range(1, n + 1):
	if n % i == 0:
		x = i
		y = n // i
		if abs(y - x) < m and y >= x:
			m = abs(y - x)
			a = x
			b = y
print(a, b)


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().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)


x = int(input())
l = []
for i in range(1, x // 2 + 2):
	if x % i == 0:
		l = l + [[i, x // i]]
l = [[a, b] for (a, b) in l if a <= b]
c = [abs(a - b) for (a, b) in l]
(a, b) = l[c.index(min(c))]
print(a, b)


from math import sqrt, ceil

def find_dividers(n: int):
	if sqrt(n) == round(sqrt(n)):
		print(int(sqrt(n)), int(sqrt(n)))
		return
	else:
		for i in reversed(range(1, ceil(sqrt(n)))):
			if n % i == 0:
				print(i, n // i)
				return
n = int(input())
find_dividers(n)


import math
n = int(input())
a = math.floor(math.sqrt(n))
while a > 0:
	if n % a == 0:
		b = n // a
		break
	a -= 1
print(a, b)


n = int(input())

def display(n):
	myMin = n
	for i in range(1, n + 1):
		if n % i == 0:
			if abs(i - n / i) < myMin:
				myMin = abs(i - n / i)
				answer = (min(i, n / i), max(i, n / i))
	return answer
goodResolution = display(n)
print(int(goodResolution[0]), int(goodResolution[1]))


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


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


c = []
import math
n = int(input())
for i in range(1, n + 1):
	if n % i == 0:
		c.append(i)
min = 9999999
a = b = int(math.sqrt(n))
for i in range(1, len(c)):
	m = c[i] - c[i - 1]
	if m < min and c[i] * c[i - 1] == n:
		a = c[i]
		b = c[i - 1]
		min = m
print(b, a)


n = int(input())
a = []
key = []
value = []
c = 0
for i in range(1, n + 1):
	if n % i == 0:
		a.append(i)
ll = len(a) - 1
for elements in a:
	if elements * elements == n:
		c = elements
		print(elements, elements)
		break
	else:
		lenght_a = ll
		while lenght_a >= 0:
			if a[lenght_a] * elements == n:
				if elements > a[lenght_a]:
					key.append(elements)
					value.append(a[lenght_a])
					lenght_a -= 1
				else:
					lenght_a -= 1
			else:
				lenght_a -= 1
if c * c != n:
	if len(key) > 2:
		Rama = []
		for g in range(len(key) - 1):
			a = key[g] - value[g]
			Rama.append(a)
		k = Rama.index(min(Rama))
		print(value[k], key[k])
	else:
		print(value[0], key[0])
else:
	pass


T_ON = 0
DEBUG_ON = 1
MOD = 998244353

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

def main():
	T = read_int() if T_ON else 1
	for i in range(T):
		solve()

def debug(*xargs):
	if DEBUG_ON:
		print(*xargs)
from collections import *
import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def read_int():
	return int(input())

def read_ints():
	return list(map(int, input().split()))

def print_nums(nums):
	print(' '.join(map(str, nums)))

def YES():
	print('YES')

def Yes():
	print('Yes')

def NO():
	print('NO')

def No():
	print('No')

def First():
	print('First')

def Second():
	print('Second')

def fib(n):
	(a, b) = (0, 1)
	for _ in range(n):
		(a, b) = (b, a + b)
	return a

def fib_ns(n):
	assert n >= 1
	f = [0 for _ in range(n + 1)]
	f[0] = 0
	f[1] = 1
	for i in range(2, n + 1):
		f[i] = f[i - 1] + f[i - 2]
	return f

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def xgcd(a, b):
	(x0, x1, y0, y1) = (0, 1, 1, 0)
	while a != 0:
		((q, a), b) = (divmod(b, a), a)
		(y0, y1) = (y1, y0 - q * y1)
		(x0, x1) = (x1, x0 - q * x1)
	return (b, x0, y0)

def lcm(a, b):
	d = gcd(a, b)
	return a * b // d

def is_even(x):
	return x % 2 == 0

def is_odd(x):
	return x % 2 == 1

def modinv(a, m):
	(g, x, _) = xgcd(a, m)
	if g != 1:
		raise Exception('gcd(a, m) != 1')
	return x % m

def mod_add(x, y):
	x += y
	while x >= MOD:
		x -= MOD
	while x < 0:
		x += MOD
	return x

def mod_mul(x, y):
	return x * y % MOD

def mod_pow(x, y):
	if y == 0:
		return 1
	if y % 2:
		return mod_mul(x, mod_pow(x, y - 1))
	p = mod_pow(x, y // 2)
	return mod_mul(p, p)

def mod_inv(y):
	return mod_pow(y, MOD - 2)

def mod_div(x, y):
	return mod_mul(x, mod_inv(y))

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i:
			return False
	return True

def gen_primes(n):
	P = [True for _ in range(n + 1)]
	P[0] = P[1] = False
	for i in range(int(n ** 0.5) + 1):
		if P[i]:
			for j in range(2 * i, n + 1, i):
				P[j] = False
	return P
main()


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


n = int(input())
b = int(n ** 0.5)
while True:
	if n % b == 0:
		print(b, n // b)
		break
	else:
		b -= 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))}")


n = int(input())
pp = []
k = []
for i in range(1, int(n ** 0.5) + 1):
	if n % i == 0:
		l = n // i
		k.append(abs(i - l))
		pp.append(str(min(l, i)))
		pp.append(str(max(l, i)))
l = min(k)
for j in range(0, len(k)):
	if k[j] == l:
		break
print(' '.join(pp[2 * j:2 * j + 2]))


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


from math import sqrt
a = int(input())
b = int(sqrt(a))
while True:
	if a % b == 0:
		(g, h) = (b, int(a / b))
		print(min(g, h), max(g, h))
		break
	b += 1


num = int(input())
root = num ** 0.5
if root == int(root):
	print(int(root), int(root))
else:
	newrow = int(root)
	newcol = num / newrow
	while int(newcol) != newcol:
		newrow = newrow - 1
		newcol = num / newrow
	print(newrow, int(newcol))


import math
from fractions import Fraction as frac
MOD = 1000000000.0 + 7

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)

def solve(case_no):
	n = int(input())
	for i in range(math.floor(math.sqrt(n)), 0, -1):
		if n % i == 0:
			print(i, n // i)
			exit()
t = 1
for i in range(1, t + 1):
	solve(i)


import math
n = int(input())
for i in range(1, int(math.sqrt(n)) + 1)[::-1]:
	if n % i == 0:
		print(' '.join([str(i), str(n // i)]))
		quit()


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)


IL = lambda : list(map(int, input().split()))
IS = lambda : input().split()
I = lambda : int(input())
S = lambda : input()
n = I()
for i in range(int(n ** 0.5), 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(*sorted(best))


import math

def solve(n):
	for i in range(int(n ** 0.5), 0, -1):
		if n % i == 0:
			return (i, n // i)
n = int(input())
s = solve(n)
print(s[0], s[1])


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


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


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


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


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


c = int(input())
a = 1
x = c ** 0.5
for i in range(2, int(x) + 1):
	if c % i == 0:
		a = i
print(a, int(c / a))


n = int(input())
li = list()
for i in range(1, n + 1):
	if n % i == 0:
		li.append(i)
li.sort()
l = 0
r = len(li) - 1
m = l + (r - l) // 2
if li[m] * li[m] == n:
	print(li[m], li[m])
else:
	print(li[m], li[m + 1])


from math import sqrt

def div(n):
	i = 1
	list = []
	while i <= n:
		if n % i == 0:
			list.append(i)
		i = i + 1
	return list
n = int(input())
root = sqrt(n)
divs = div(n)
listy = [abs(root - x) for x in divs]
min_index = listy.index(min(listy))
print('{} {}'.format(int(divs[min_index]), int(n / divs[min_index])))


def isPrime(n):
	if n <= 2:
		return 1
	for i in range(2, n):
		if n % i == 0:
			return 0
	return 1
n = int(input().strip())
s = n ** 0.5
if isPrime(n):
	print(1, n)
elif s == int(s):
	print(int(s), int(s))
else:
	s = int(s)
	for i in range(s, n // 2 + 1):
		if n % i == 0:
			print(int(min(n // i, i)), int(max(n // i, i)))
			break


import math
n = int(input())
k = int(math.sqrt(n))
ans = []
for i in range(1, k + 1):
	if n % i == 0:
		ans.append(i)
print(min(max(ans), n // max(ans)), max(max(ans), n // max(ans)))


import math

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

class CodeforcesTask747ASolution:

	def __init__(self):
		self.result = ''
		self.pixel = 0

	def read_input(self):
		self.pixel = int(input())

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

	def get_result(self):
		return f"{' '.join(map(str, self.result))}"
Solution = CodeforcesTask747ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


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 = int(input())
for i in range(int(sqrt(n)) + 1, 0, -1):
	if n % i == 0:
		l = sorted([i, n // i])
		print(*l)
		exit()


n = int(input())
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=' ')


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
main()


import math

def solve():
	n = int(input().strip())
	root = math.floor(n ** (1 / 2))
	i = root
	while i > 0:
		if i * math.ceil(n / i) == n:
			print(str(i) + ' ' + str(int(n / i)))
			return
		i = i - 1
solve()


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)
print(solve())


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


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


n = int(input())
chk = 0
for i in range(1, n + 1):
	if i * i > n:
		break
	elif n % i == 0:
		chk = i
ans = [min(chk, n // chk), max(chk, n // chk)]
print(*ans)


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 = int(input())
	arr = [int(i) for i in input().split(' ')]
	arr_sum = sum(arr)
	zeros = len([i for i in arr if i == 0])
	if -1 * arr_sum == zeros:
		print(zeros + 1)
		return
	print(max(0, zeros))

def possible(arr):
	halfsum = sum(arr) // 2
	if halfsum in arr:
		return True
	for i in range(0, 4):
		for j in range(i + 1, 4):
			if arr[i] + arr[j] == halfsum:
				return True
	return False

def is_palin(string):
	if not string or len(string) == 1:
		return True
	n = len(string)
	for i in range(0, n // 2):
		pass
n = int(input())
diff = 10 ** 9
(a, b) = (None, None)
for i in range(1, n + 1):
	if i * i > n:
		break
	if n % i == 0 and n // i - i < diff:
		(a, b) = (i, n // i)
		diff = b - a
print(a, b)


n = int(input())
minimum = n
for a in range(1, n + 1):
	if n % a != 0:
		continue
	b = int(n / a)
	if b > a:
		continue
	elif abs(b - a) < minimum:
		minimum = b - a
		itog1 = int(a)
		itog2 = int(b)
print(itog2, itog1)


import math
a = float(input())
k = math.sqrt(a)
if k == round(k):
	print('%d %d' % (k, k))
else:
	k = round(k)
	while k > 0:
		if a % k != 0:
			k -= 1
		else:
			print('%d %d' % (k, a / k))
			break


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)


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


def isPrime(n):
	if n % 2 == 0 and n < 3:
		return True
	if n % 2 == 0:
		return False
	if n < 2:
		return False
	for x in range(3, round(n ** 0.5) + 1, 2):
		if n % x == 0:
			return False
	return True
n = int(input())
if isPrime(n):
	print(1, n)
else:
	a = round(n ** 0.5)
	while a > 0 and n % a != 0:
		a -= 1
	b = n // a
	if a < b:
		(a, b) = (b, a)
	print(b, a)


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


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)


from math import sqrt
n = int(input())
a = int(sqrt(n))
while a > 0:
	if n % a == 0:
		break
	else:
		a -= 1
print(a, n // a)


n = int(input())
factors = []
index = 0
difference = 1000000
for x in range(1, n + 1):
	if n % x == 0 and x >= n // x:
		factors.append((x, n // x))
for y in range(len(factors)):
	if factors[y][0] - factors[y][1] < difference:
		difference = factors[y][0] - factors[y][1]
		index = y
print(factors[index][1], factors[index][0])


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


n = int(input())
a = 1
for i in range(2, int(n ** 0.5) + 2):
	if n % i == 0:
		a = i
print(min(a, n // a), max(a, n // a))


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


from math import sqrt, floor
a = int(input())
b = floor(sqrt(a))
while a % b != 0:
	b = b - 1
print(b, a // b)


n = int(input())
z = n ** 0.5
if z % 1 == 0:
	z = int(z)
	print(z, z)
else:
	z = int(z)
	while n % z != 0 and z > 0:
		z -= 1
	print(z, n // z)


a = int(input())
b = a ** (1 / 2)
if b == int(b):
	print(int(b), int(b))
elif a == 2:
	print(1, 2)
else:
	y = 1
	z = a / 2
	entre = 0
	primero = 1
	while y < z:
		entre = 1
		if a % y == 0:
			z = a // y
			primero = y
		y = y + 1
	print(primero, int(z))


import sys
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())
(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)


import math
n = int(input())

def factors(x):
	listy = []
	for i in range(1, x + 1):
		if x % i == 0:
			listy.append(i)
	return listy
factors = factors(int(n))
min = math.inf
for x in factors:
	list2 = []
	a = x
	b = n / x
	if a <= b:
		if b - a < min:
			min = b - a
for x in factors:
	a = x
	b = n / x
	if b - a == min:
		print(int(a), int(b))


import math
line = input()
a = []
for x in line.split():
	a.append(int(x))
l = 1
r = a[0]
tmp = int(math.sqrt(a[0]))
for i in range(2, tmp + 1):
	if a[0] % i == 0:
		l = i
		r = a[0] // i
print(l, r)


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


(a, b) = (0, 0)
x = int(input())
res = x
for i in range(1, x):
	if x % i == 0 and abs(x / i - i) <= res:
		res = abs(x / i - i)
		a = int(x / i)
		b = int(i)
if a > b:
	(a, b) = (b, a)
if x == 1:
	(a, b) = (1, 1)
print(f'{a} {b}')


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)
ans.sort()
print(*ans)


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


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 = int(input())
a = 0
b = 0
m = n
for i in range(n, 0, -1):
	a1 = i
	b1 = n // a1
	if a1 * b1 == n:
		m1 = abs(a1 - b1)
		if m1 < m:
			a = min(a1, b1)
			b = max(a1, b1)
			m = m1
			if m == 0:
				break
print(a, b)


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


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

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())
t = int(math.sqrt(n))
for a in range(t, 0, -1):
	b = n // a
	if a * b == n:
		print(str(a) + ' ' + str(b))
		break


n = int(input())
ans = 1
minimum = 10 ** 10
for i in range(1, n // 2 + 1):
	if n % i == 0 and abs(n // i - i) < minimum:
		ans = i
		minimum = abs(n // i) - abs(i)
print(ans, n // ans)


from math import sqrt
num = int(input())
for factor in range(int(sqrt(num)), 0, -1):
	if num % factor == 0:
		print(factor, num // factor)
		break


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_int = lambda : int(sys.stdin.readline())
m = get_int()
i = 1
first = 1
sec = m
while i * i <= m:
	if m % i == 0:
		a = i
		b = m // i
	if a <= b:
		first = a
		sec = b
	else:
		break
	i += 1
print(first, sec)


n = int(input())
res = 10000000
a = 0
b = 0
i = 1
while i * i <= n:
	if n % i == 0:
		a = i
		b = n // i
	i += 1
print(a, b)


import sys
noOfPixels = int(input())
if noOfPixels == 1:
	print('1 1')
else:
	row = 1
	mini = sys.maxsize
	ans = []
	while True:
		if noOfPixels % row == 0:
			col = noOfPixels // row
			if row > col:
				break
			mini = min(mini, col - row)
			ans[:] = []
			ans.append(row)
			ans.append(col)
		row = row + 1
	print(ans[0], ans[1])


n = int(input())
a = 1
b = n
diff = n - 1
for i in range(2, n):
	if n % i == 0 and i * i <= n:
		if abs(i - n // i) < diff:
			diff = abs(i - n // i)
			a = i
			b = n // i
print(int(a), int(b))


a = int(input())
i = 1
results_a = []
results_i = []
result = []
while i <= a:
	res_i = a / i
	if res_i % 1 == 0 and res_i >= 0:
		res_i = round(res_i)
		results_a.append(res_i)
		results_i.append(i)
	i += 1
k = 0
lenght_i = len(results_i) - 1
while k <= lenght_i:
	c = results_i[k] - results_a[k]
	if c >= 0:
		q = results_a[k]
		u = results_i[k]
		break
	k += 1
print(q, u)


n = int(input())
a = 1
ans = 10 ** 18
while a * a <= n:
	if n % a == 0:
		b = n // a
		if b - a < ans:
			ans = b - a
			ans_a = a
	a += 1
print(ans_a, n // ans_a)


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
if index > a[index]:
	index = a[index]
print('%d %d' % (index, a[index]))


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


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


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


from math import sqrt
n = int(input())
a = int(sqrt(n))
while a > 0:
	if n % a == 0:
		print(a, n // a, sep=' ')
		exit()
	a -= 1


n = int(input())

def ispersqr(a):
	sr = a ** 0.5
	if sr - int(sr) == 0:
		return int(sr)
	else:
		return 0
ch = ispersqr(n)
if ch:
	print(ch, ch)
else:
	l = [i for i in range(2, int(n / 2) + 1) if n % i == 0]
	p = len(l)
	if p == 0:
		print(1, n)
	else:
		q = int(p / 2)
		print(l[q - 1], l[q])


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)


from math import sqrt
n = int(input())
diff = n
a = 0
b = 0
for i in range(1, n + 1, 1):
	if n % i == 0:
		temp = abs(i - n / i)
		if diff > temp:
			diff = temp
			a = min(i, n / i)
			b = max(i, n / i)
print(int(a), int(b))


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(input())
s = int(math.floor(math.sqrt(n)))
for b in range(s, n + 1):
	if n % b == 0:
		a = n // b
		if a <= b:
			print(a, b)
			exit()


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(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


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


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)


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


n = int(input())
razn = n
raznp = n
for i in range(1, n + 1):
	if n % i == 0 and abs(i - n / i) <= raznp:
		razn = abs(i - n / i)
		a = min(i, n / i)
		b = max(i, n / i)
		if razn < raznp:
			raznp = razn
print(int(a), int(b))


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=' ')