Today, Osama gave Fadi an integer $X$, and Fadi was wondering about the minimum possible value of $max(a, b)$ such that $LCM(a, b)$ equals $X$. Both $a$ and $b$ should be positive integers.

$LCM(a, b)$ is the smallest positive integer that is divisible by both $a$ and $b$. For example, $LCM(6, 8) = 24$, $LCM(4, 12) = 12$, $LCM(2, 3) = 6$.

Of course, Fadi immediately knew the answer. Can you be just like Fadi and find any such pair?


-----Input-----

The first and only line contains an integer $X$ ($1 \le X \le 10^{12}$).


-----Output-----

Print two positive integers, $a$ and $b$, such that the value of $max(a, b)$ is minimum possible and $LCM(a, b)$ equals $X$. If there are several possible such pairs, you can print any.


-----Examples-----
Input
2

Output
1 2

Input
6

Output
2 3

Input
4

Output
1 4

Input
1

Output
1 1

Source: codeforces | Difficulty: MEDIUM
Tags: Number theory

Mathematics

Complete search


Solutions:
import math
x = int(input())
sq = int(math.sqrt(x))
if x == 1:
	print('1 1')
else:
	for i in range(sq, 0, -1):
		if x % i == 0:
			if i * (x // i) // math.gcd(i, x // i) != x:
				continue
			if x // i == i:
				continue
			print(x // i, i)
			break


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

def lcm(a, b):
	return a * b / gcd(a, b)
a = int(input())
max1 = 1
for i in range(1, int(a ** 0.5) + 1):
	if a % i == 0 and lcm(i, a // i) == a:
		max1 = i
print(max1, int(a // max1))


from collections import defaultdict as dc
from collections import deque as dq
import bisect
import sys
import math
mod = 10 ** 9 + 7

def bs(z, x, n):
	l = 0
	r = len(z) - 1
	ans = -1
	mk = n
	while l < r:
		mid = (l + r) // 2
		if lcm(z[mid], x, n):
			if mk > max(z[mid], x):
				mk = max(z[mid], x)
				ans = z[mid]
			r = mid - 1
		else:
			l = mid + 1
	return ans

def digit(n):
	a = []
	while n > 0:
		a.append(n % 10)
		n = n // 10
	return a

def inp():
	p = int(input())
	return p

def line():
	p = list(map(int, input().split()))
	return p

def lcm(a, b, n):
	return n == a * b / math.gcd(a, b)
n = inp()
ans = n
a = 1
b = n
z = []
for i in range(1, int(pow(n, 0.5)) + 1):
	if n % i == 0:
		p = i
		q = n // i
		z.append(p)
		z.append(q)
z.sort()
ans = n
for i in range(len(z)):
	kl = bs(z, z[i], n)
	p = z[i]
	q = n // z[i]
	if lcm(p, q, n) and max(p, q) < ans:
		ans = max(p, q)
		a = p
		b = q
	if kl != -1 and max(kl, z[i]) < ans:
		a = kl
		b = z[i]
		break
print(a, b)


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

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

def myqs(x):
	i = 1
	a = 1
	while i <= x // i:
		if x % i == 0:
			if lcm(i, x // i) == x:
				a = i
		i += 1
	return str(a) + ' ' + str(x // a)
x = int(input())
print(myqs(x))


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
n = int(input())
i = int(n ** 0.5)
while i != 0:
	if n % i == 0:
		if gcd(i, n // i) == 1:
			print(i, n // i)
			exit()
	i -= 1


from sys import stdin, stdout
import math

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def lcm(a, b):
	return a * b // gcd(a, b)
x = int(stdin.readline())
lst = []
a = x
b = 1
for i in range(int(math.sqrt(x)), 0, -1):
	if x % i == 0 and lcm(x // i, x // (x // i)) == x:
		if max(x // i, x // (x // i)) < max(a, b):
			a = x // i
			b = x // (x // i)
stdout.write(str(b) + ' ' + str(a))


import math

def gcd(x, y):
	if y > x:
		(x, y) = (y, x)
	if y == 0:
		return x
	return gcd(y, x % y)

def lcm(x, y):
	return int(x * y / gcd(x, y))
n = int(input())
SquareNum = n ** 0.5
SquareNum = math.floor(SquareNum)
if n == 1:
	print(1, 1)
else:
	for i in range(SquareNum, 0, -1):
		if n % i == 0 and i ** 2 != n and (lcm(i, n // i) == n):
			print(i, n // i)
			break


n = int(input())
num = n
d = {}
while n % 2 == 0:
	d[2] = 2 if 2 not in d else d[2] * 2
	n //= 2
i = 3
ans = float('inf')
while i * i <= n:
	while n % i == 0:
		d[i] = i if i not in d else d[i] * i
		n //= i
	i += 2
if n > 2:
	d[n] = n
pf = list(d.items())
for i in range(1, 1 << len(pf)):
	p = 1
	for j in range(len(pf)):
		if i & 1 << j > 0:
			p *= pf[j][1]
	ans = min(ans, max(p, num // p))
if num == 1:
	print(1, 1)
else:
	print(num // ans, ans)


def factors(n):
	q = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				q.append(i)
			else:
				q.append(i)
				q.append(n // i)
		i = i + 1
	q.sort()
	return q

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

def lcm(a, b):
	return a * b / gcd(a, b)
import math
x = int(input())
l = factors(x)
vis = {}
ans = 10 ** 18
for i in range(len(l)):
	u = x // l[i]
	if l[i] in vis:
		break
	else:
		vis[l[i]] = 1
	if lcm(l[i], u) == x:
		y = max(l[i], u)
		ans = min(ans, y)
print(ans, x // ans)


import sys
import math as mt
input = sys.stdin.buffer.readline
t = 1
for ___ in range(t):
	x = int(input())
	x1 = x
	i = 2
	pf = []
	while i * i <= x:
		if x % i == 0:
			curr = 1
			while x % i == 0:
				curr *= i
				x //= i
			pf.append(curr)
		i += 1
	if x1 > 1:
		pf.append(x)
	n = len(pf)
	(a, b) = (10 ** 18 + 1, 10 ** 18 + 1)
	for i in range(1 << n):
		(a1, b1) = (1, 1)
		for j in range(n):
			if i >> j & 1:
				a1 *= pf[j]
			else:
				b1 *= pf[j]
		if max(a, b) > max(a1, b1):
			a = a1
			b = b1
	print(a, b)


def LMC(a, b):
	n = a * b
	while a != 0 and b != 0:
		if a > b:
			a = a % b
		else:
			b = b % a
	nod = a + b
	nok = n // nod
	return nok
from math import sqrt, ceil
n = int(input())
dividers = []
for i in range(1, ceil(sqrt(n))):
	if n % i == 0:
		dividers.append([i, n // i])
dividers_with_LMC = []
for el in dividers:
	if LMC(el[0], el[1]) == n:
		dividers_with_LMC.append(el)
if n == 1:
	print('1 1')
else:
	min_pair = dividers_with_LMC[0]
	for el in dividers_with_LMC:
		if max(el[0], el[1]) < max(min_pair[0], min_pair[1]):
			min_pair = el
	print(*el)


from math import gcd
n = int(input())
ans = 1
for i in range(1, int(n ** 0.5) + 1):
	if n % i == 0 and gcd(i, n // i) == 1:
		ans = i
print(ans, n // ans)


from math import *

def fact(n):
	l = []
	x = 1
	while x * x <= n:
		if n % x == 0:
			l.append(x)
		if n // x != x and n % (n // x) == 0:
			l.append(n // x)
		x += 1
	l.sort()
	return l
n = int(input())
if n == 1:
	print(1, 1)
	exit()
l = fact(n)
maxi = 10 ** 14
i = 0
j = len(l) - 1
ans = []
while i < j:
	if max(l[i], l[j]) < maxi and gcd(l[i], l[j]) == 1:
		ans = [l[i], l[j]]
		maxi = max(l[i], l[j])
	i += 1
	j -= 1
print(*ans)


from functools import reduce
import io
import os
import sys
from atexit import register
import random
import math
import itertools
from math import gcd
DEBUG = False
STRESSTEST = False
if not DEBUG:
	input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
sys.stdout = io.BytesIO()
register(lambda : os.write(1, sys.stdout.getvalue()))
tokens = []
tokens_next = 0

def nextStr():
	global tokens, tokens_next
	while tokens_next >= len(tokens):
		tokens = input().split()
		tokens_next = 0
	tokens_next += 1
	if type(tokens[tokens_next - 1]) == str:
		return tokens[tokens_next - 1]
	return tokens[tokens_next - 1].decode()

def nextInt():
	return int(nextStr())

def nextIntArr(n):
	return [nextInt() for i in range(n)]

def print(*argv, end='\n'):
	for arg in argv:
		sys.stdout.write((str(arg) + ' ').encode())
	sys.stdout.write(end.encode())

def genTestCase():
	raise NotImplementedError

def bruteforce(a):
	res = (a, 1)
	for i in range(1, a + 1):
		if i > res[0]:
			break
		for j in range(i, a + 1):
			if j > res[0]:
				break
			if i * j / gcd(i, j) == a:
				res = min(res, (j, i))
	return ' '.join(map(str, sorted(res)))

def doStressTest():
	while True:
		curTest = genTestCase()
		mySoln = solve(curTest)
		bruteforceSoln = bruteforce(curTest)
		if mySoln != bruteforceSoln:
			print('### Found case ###')
			print(curTest)
			print(f'{mySoln} should have been: {bruteforceSoln}')
			return

def factorize(x):
	orgX = x
	res = {}
	for i in [2] + list(range(3, int(x ** 0.5) + 1, 2)):
		while x % i == 0:
			res[i] = res.get(i, 0) + 1
			x = x // i
	if x > 1:
		res[x] = 1
	if False:
		c = reduce(lambda x, y: x ** res[x] * y ** res[y], res)
		assert c == orgX
	return res

def solve(a):
	d = factorize(a)
	x = sorted((i ** d[i] for i in d))
	if len(x) == 1:
		return f'1 {a}'
	res = (a, 1)
	for i in range(1, len(x) // 2 + 1):
		for comb in itertools.combinations(x, i):
			first = reduce(lambda x, y: x * y, comb)
			second = a // first
			if first < second:
				(first, second) = (second, first)
			res = min(res, (first, second))
	if res[1] < res[0]:
		res = (res[1], res[0])
	return f'{res[0]} {res[1]}'
if not DEBUG and STRESSTEST:
	raise Exception('Wrong flags!')
if STRESSTEST:
	doStressTest()
else:
	a = nextInt()
	res = solve(a)
	print(res)
sys.stdout.flush()


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

def isValid(a, b, x):
	temp = a * b / gcd(a, b)
	if temp == x:
		return True
	else:
		return False

def solve(x):
	if x == 1:
		print(1, 1)
		return
	maxi = x
	ansa = 1
	ansb = x
	limit = int(x ** 0.5) + 1
	for i in range(1, limit):
		if x % i == 0 and isValid(i, x / i, x) and (max(i, x / i) < maxi):
			maxi = max(i, x / i)
			ansa = i
			ansb = x // i
	print(ansa, ansb)

def main():
	x = int(input())
	solve(x)
main()


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')
import math

def computeGCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
x = int(input())
minsofar = x
pair = 0
factors = []
for s in range(1, math.ceil(math.sqrt(x)) + 1):
	if x % s == 0:
		pair = (s, x // s)
		gcd = computeGCD(pair[0], pair[1])
		if pair[0] * pair[1] // gcd == x:
			factors.append(pair)
for s in range(len(factors)):
	minny = max(factors[s])
	if minny < minsofar:
		minsofar = minny
		pair = factors[s]
print(str(factors[s][0]) + ' ' + str(factors[s][1]))


from math import *

def relative(a, b):
	if a == b and a != 1:
		return False
	elif a == b:
		return True
	for num in range(2, int(sqrt(max(a, b))) + 1):
		if a % num == 0 and b % num == 0:
			return False
	return True
inp = int(input())
middle = int(sqrt(inp))
counter = middle
break1 = False
while counter > 0 and (not break1):
	if inp % counter == 0:
		temp = inp / counter
		if relative(counter, temp):
			print(int(counter), int(temp))
			break1 = True
			break
	counter = counter - 1


a = int(input())
d = []
import math
if a == 1:
	print(1, 1)
else:
	for i in range(1, int(a ** 0.5) + 1):
		if a % i == 0:
			if a / i == i:
				d.append(i)
			else:
				d.append(i)
				d.append(int(a / i))
	d.sort()
	if len(d) % 2 != 0:
		for i in range(int(len(d) / 2)):
			if d[int(len(d) / 2) - 1 - i] * d[int(len(d) / 2) + 1 + i] / math.gcd(d[int(len(d) / 2) - 1 - i], d[int(len(d) / 2) + 1 + i]) == a:
				print(d[int(len(d) / 2) - 1 - i], d[int(len(d) / 2) + 1 + i])
				break
	else:
		for i in range(int(len(d) / 2)):
			if d[int(len(d) / 2) - 1 - i] * d[int(len(d) / 2) + i] / math.gcd(d[int(len(d) / 2) - 1 - i], d[int(len(d) / 2) + i]) == a:
				print(d[int(len(d) / 2) - 1 - i], d[int(len(d) / 2) + i])
				break


import math, time

def lcm(a, b):
	return a * b // math.gcd(a, b)
x = int(input())
start_time = time.time()
r = int(math.sqrt(x))
c = 0
while r >= 1:
	c = c - 1
	d = int(x / r)
	if x % r == 0:
		lc = lcm(d, r)
		if lc == x:
			print(r, d)
			raise SystemExit()
	r = r - 1


import fractions
X = int(input())
ans = [float('inf'), float('inf')]
for i in range(10 ** 6):
	i += 1
	if X % i == 0:
		j = X // i
		if fractions.gcd(i, j) == 1:
			if max(ans) > max(i, j):
				ans = [i, j]
if ans[0] == float('inf'):
	print(1, X)
else:
	print(ans[0], ans[1])


from math import gcd
x = int(input())
min_max = x
ans = [1, x]
for i in range(2, int(x ** 0.5) + 1):
	if x % i == 0:
		if gcd(i, x // i) == 1:
			if max(i, x // i) < min_max:
				ans = [i, x // i]
print(' '.join([str(item) for item in ans]))


import math
x = int(input())
i = int(x ** 0.5)
while i + 1 and (math.gcd(x // i, i) > 1 or x % i):
	i -= 1
print(i, x // i)


from math import gcd, sqrt
b = int(input())
srt = sqrt(b)
for i in range(int(srt) + 1, 0, -1):
	if b % i == 0 and gcd(i, b // i) == 1:
		print(i, b // i)
		break


import math
n = int(input())
i = 1
while i * i <= n:
	if n % i == 0:
		if math.gcd(n // i, i) == 1:
			q = i
	i += 1
print(q, n // q)


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

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

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools, itertools, operator, bisect
from collections import deque, defaultdict, OrderedDict
import collections

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	for _ in range(1):
		x = ri()
		m = x
		for i in range(1, int(math.sqrt(x)) + 1):
			if x % i == 0:
				d1 = i
				d2 = x // i
				if math.gcd(d1, d2) == 1:
					m = min(m, max(d1, d2))
		print(m, x // m)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			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, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			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()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

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

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
n = int(input())
a = 1
g = gcd(1, n)
for i in range(1, int(n ** 0.5) + 1):
	if n % i == 0:
		if gcd(i, n // i) <= g:
			a = i
print(min(a, n // a), max(a, n // a))


from math import sqrt, gcd
n = int(input())
for i in range(round(sqrt(n)) + 1, 0, -1):
	if n % i == 0 and gcd(i, n // i) == 1:
		print(i, n // i)
		break


import math

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

def brute(x):
	z = []
	for i in range(1, x + 1):
		for j in range(1, x + 1):
			if lcm(i, j) == x:
				z.append([max(i, j), min(i, j)])
	z.sort()
	return z[0]

def factors(n):
	i = 1
	z = []
	while i <= int(n ** 0.5) + 1:
		if n % i == 0:
			if n // i == i:
				z.append([i, i])
			else:
				z.append([max(i, n // i), min(n // i, i)])
		i = i + 1
	y = []
	for i in z:
		if lcm(i[0], i[1]) == n:
			y.append(i)
	y.sort()
	return y[0]
x = int(input())
print(*factors(x))


from math import gcd as __gcd, sqrt, ceil

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

def findNums(x):
	if x == 1:
		print(1, 1)
		return
	ans = 0
	for i in range(1, ceil(sqrt(x))):
		if x % i == 0 and lcm(i, x // i) == x:
			ans = i
	print(ans, x // ans)
findNums(int(input()))


from collections import defaultdict as dd
from math import sqrt, gcd
import sys
input = sys.stdin.readline
I = input
n = int(input())
nn = n
n = int(sqrt(n))
a = nn
b = nn
for i in range(1, n + 1):
	if nn % i == 0:
		aa = min(i, nn // i)
		bb = max(i, nn // i)
	if bb < b and gcd(aa, bb) == 1:
		a = aa
		b = bb
print(a, b)


def gcd(a, b):
	while a * b != 0:
		if a > b:
			a %= b
		else:
			b %= a
	return a + b

def lcm(a, b):
	return a * b // gcd(a, b)
x = int(input())
ans = x
i = 1
while i ** 2 <= x:
	if x % i == 0:
		j = x // i
		if lcm(i, j) == x and j < ans:
			ans = j
	i += 1
print(ans, x // ans)


import math
x = int(input())
d = math.floor(x ** (1 / 2))

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
ans = float('inf')
for a in range(1, d + 1):
	(div, mod) = divmod(x, a)
	if mod == 0:
		if gcd(a, div) == 1:
			ans = min(ans, max(a, div))
A = sorted([ans, x // ans])
print(A[0], end=' ')
print(A[1])


a = int(input())
b = int(a ** 0.5)
while b > 0:
	if a % b == 0:
		c = a // b
		if b == c == 1:
			print(b, c)
			break
		elif b != c:
			k = b
			l = c
			m = k * l
			while k > 0 and l > 0:
				if k > l:
					k %= l
				else:
					l %= k
			m = m // (k + l)
			if m == a:
				print(b, c)
				break
	b += -1


from math import sqrt

def HCF(a, b):
	a1 = max(a, b)
	b1 = min(a, b)
	while b1:
		(a1, b1) = (b1, a1 % b1)
	return a1
n = int(input())
for i in range(int(sqrt(n)) + 1, -1, -1):
	if not n % i and HCF(n // i, i) == 1:
		print(n // i, i)
		break


import math
s = set()
n = int(input())
d = {}
l1 = []
m = 10 ** 12
for r in range(1, int(n ** 0.5) + 1):
	if n % r == 0:
		if math.gcd(r, n // r) == 1:
			if m > max(r, n // r):
				m = max(r, n // r)
				ans = [r, n // r]
print(*ans)


import math
x = int(input())
i = 1
while i * i <= x:
	if x % i < 1 == math.gcd(x // i, i):
		r = i
	i += 1
print(r, x // r)


import sys
import math

def read_line():
	return sys.stdin.readline()[:-1]

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

def read_int_line():
	return [int(v) for v in sys.stdin.readline().split()]

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
x = read_int()
m = -1
for i in range(1, math.ceil(math.sqrt(x))):
	if x % i == 0:
		if gcd(i, x // i) == 1:
			if x // i > m:
				m = i
if x == 1:
	print(1, 1)
else:
	print(m, x // m)


from math import gcd
from math import sqrt
n = int(input())
for i in reversed(range(int(sqrt(abs(n))) + 2)):
	if n % i == 0 and gcd(i, n // i) == 1:
		break
print(n // i, i)


import math
n = int(input())
s = (1, n)
for i in range(2, int(n ** 0.5) + 1):
	if n % i == 0:
		k = n // i
		if k * i // math.gcd(i, k) == n:
			if k < s[1]:
				s = (i, k)
print(*s, end=' ')


from sys import stdin, stdout
import math, sys
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
import bisect as bi
import heapq

def I():
	return int(input())

def In():
	return map(int, input().split())

def printDivisors(n):
	i = 1
	ans1 = []
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				ans1.append(i)
			else:
				ans1.append(i)
				ans1.append(n // i)
		i = i + 1
	return ans1

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

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

def main():
	try:
		for _ in range(1):
			n = I()
			l = printDivisors(n)
			l.sort()
			n1 = len(l)
			ans = [1, 1]
			for x in range(len(l) // 2):
				(t1, t2) = (l[n1 - x - 1], l[x])
				if lcm(t1, t2) == n:
					if ans[-1] == 1:
						ans[0] = t2
						ans[-1] = t1
					elif t1 < ans[-1]:
						ans[0] = t2
						ans[-1] = t1
			if len(ans) == 1:
				print(ans[0], ans[0])
			else:
				print(ans[0], ans[-1])
	except:
		pass
M = 998244353
P = 1000000007
main()


import math
X = int(input())
if X == 1:
	print(1, 1)
	quit()
for i in range(int(math.sqrt(X)), 0, -1):
	if X % i == 0 and i != X // i:
		if math.gcd(i, X // i) == 1:
			ans = (i, X // i)
			break
print(*ans)


def get_primes():
	n = 10 ** 6
	m = n + 1
	numbers = [True] * m
	for i in range(2, int(n ** 0.5 + 1)):
		if numbers[i]:
			for j in range(i * i, m, i):
				numbers[j] = False
	primes = set()
	for i in range(2, m):
		if numbers[i]:
			primes.add(i)
	return primes
n = int(input())
from math import sqrt
from itertools import combinations
primes = get_primes()

def product(lis):
	ans = 1
	for each in lis:
		ans *= each
	return ans

def factorise(x):
	maxans = x
	pro = x
	di = {}
	while x != 1:
		for each in primes:
			while x % each == 0:
				x = x // each
				di[each] = 1 if each not in di else di[each] + 1
			if x == 1:
				break
		if x != 1:
			di[x] = 1
			break
	groups = []
	for each in di:
		groups.append(each ** di[each])
	if len(groups) == 1:
		return groups[0]
	maxans = product(groups)
	for k in range(1, len(groups)):
		for perm in combinations(groups, k):
			a = product(list(perm))
			b = pro // a
			maxans = min(maxans, max(a, b))
	return maxans
ans = factorise(n)
print(n // ans, ans)


import math

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(n):
	mx = 10 ** 13
	for a in range(1, int(math.sqrt(n)) + 10):
		if n % a == 0:
			if max(a, n // a) < mx and lcm(a, n // a) == n:
				mx = max(a, n // a)
				A = a
				B = n // a
	print('{} {}'.format(A, B))
while True:
	try:
		n = int(input())
		solve(n)
	except EOFError:
		break


import sys
input = sys.stdin.readline
import fractions

def make_divisors(n):
	divisors = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			divisors.append(i)
			if i != n // i:
				divisors.append(n // i)
	return divisors

def main():
	N = int(input())
	x = make_divisors(N)
	mi = [float('inf'), float('inf')]
	if len(x) == 1:
		print(1, 1)
		exit()
	if len(x) & 1:
		if x[-1] * x[-1] // fractions.gcd(x[-1], x[-1]) == N:
			mi = [x[-1], x[-1]]
	for i in range(0, len(x) - 1, 2):
		if x[i] * x[i + 1] // fractions.gcd(x[i], x[i + 1]) != N:
			continue
		if max(mi) > max(x[i], x[i + 1]):
			mi = [x[i], x[i + 1]]
	print(*mi)
main()


import math

def factors(x):
	lis = [1]
	a = math.sqrt(x)
	i = 1
	while i < a:
		if x % i == 0 and math.gcd(i, x // i) == 1:
			lis.append(i)
		i += 1
	return lis
x = int(input())
arr = factors(x)
print(arr[-1], x // arr[-1])


import math

def main():
	n = int(input())
	min = 1000000000000 + 1
	a = 1
	b = 1
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			if math.gcd(i, n // i) == 1 and max(i, n // i) < min:
				min = max(i, n // i)
				a = i
				b = n // i
	print(a, b)
main()


from math import gcd
x = int(input())
i = 1
res1 = 1
res2 = x
M = x
while i * i <= x:
	if x % i == 0:
		j = x // i
		if i * j / gcd(i, j) == x:
			if max(i, j) < x:
				res1 = i
				res2 = j
	i += 1
print(res1, res2)


import math

def factor(n):
	x = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				x.append(i)
			else:
				x.append(i)
				x.append(n // i)
		i = i + 1
	return x
import sys
input = sys.stdin.readline
a = int(input())
mini = math.inf
x = factor(a)
t = 0
r = 0
if a == 1:
	print(1, 1)
else:
	x.sort()
	for i in range(len(x)):
		if math.gcd(x[i], a // x[i]) == 1:
			if max(x[i], a // x[i]) < mini:
				mini = max(x[i], a // x[i])
				t = x[i]
				r = a // x[i]
	if t == 0:
		print(1, a)
	else:
		print(t, r)


import sys
import math
input = sys.stdin.readline

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

def main():
	X = int(input())
	smallest = 10 ** 12
	ret = None
	for n in range(1, int(math.sqrt(X)) + 1):
		if X % n == 0:
			(n1, n2) = (n, X // n)
			if lcm(n1, n2) != X:
				continue
			smallest = min(smallest, max(n1, n2))
			ret = (n, X // n)
	print(ret[0], ret[1])
main()


import math
from itertools import combinations as cb
X = int(input())
if X == 1:
	print(1, 1)
	exit()
ans = {}
k = X
while True:
	if k == 1:
		break
	q = k
	for i in range(2, int(math.sqrt(k)) + 2):
		if k % i == 0:
			if i in ans:
				ans[i] *= i
			else:
				ans[i] = i
			k //= i
			break
	if k == q:
		if k in ans:
			ans[k] *= k
		else:
			ans[k] = k
		break
Q = list(ans.values())
R = []
for i in range(1, len(Q) + 1):
	for W in cb(Q, i):
		tmp = 1
		for w in W:
			tmp *= w
		R.append((max(tmp, X // tmp), min(tmp, X // tmp)))
R.sort()
print(R[0][1], R[0][0])


n = int(input())
z = n
lfi = []
i = 2
while i * i <= n:
	if n % i == 0:
		count = 0
		while n % i == 0:
			n = n // i
			count += 1
		lfi.append((i, count))
	i += 1
if n != 1:
	lfi.append((n, 1))
mina = []
con = len(lfi)
for i in range(1 << con):
	num1 = 1
	num2 = 1
	for j in range(con):
		if i & 1 << j:
			num1 = num1 * pow(lfi[j][0], lfi[j][1])
	num2 = z // num1
	mina.append((max(num1, num2), num1, num2))
if mina == []:
	print(1, 1)
else:
	t = min(mina)
	print(t[1], t[2])


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

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

def compute(x):
	for i in range(int(x ** 0.5), 0, -1):
		if x % i == 0 and lcm(i, x // i) == x:
			return (i, x // i)
N = int(input())
print(*compute(N))


import math

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

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def main(x):
	a = int(math.sqrt(x))
	while True:
		if x % a == 0:
			b = x // a
			if lcm(a, b) == x:
				break
		a -= 1
	return (a, b)
x = int(input())
if isPrime(x):
	print(1, x)
else:
	solution = main(x)
	print(min(solution), max(solution))


import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
import itertools
mod = 10 ** 9 + 7
INF = float('inf')

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

def inpl():
	return list(map(int, sys.stdin.readline().split()))

def make_divisors(n):
	divisors = []
	for i in range(1, int(math.sqrt(n)) + 1):
		if n % i == 0:
			divisors.append(i)
			if i != n // i:
				divisors.append(n // i)
	divisors.sort()
	return divisors

def lcm(a, b):
	return a * b // math.gcd(a, b)
x = inp()
m = make_divisors(x)
res = [1, 1]
for i in range(len(m)):
	for j in range(i):
		if lcm(m[i], m[j]) == x:
			print(m[i], m[j])
			quit()
print(1, 1)


import sys
from fractions import gcd

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

def divisors(N: int) -> set:
	from math import sqrt
	s = {1, N}
	for i in range(2, int(sqrt(N)) + 1):
		if N % i == 0:
			s.add(i)
			s.add(N // i)
	return s
N = INT()
ans = ()
mn = INF
for div1 in divisors(N):
	div2 = N // div1
	if gcd(div1, div2) == 1:
		if mn > max(div1, div2):
			mn = max(div1, div2)
			ans = (div1, div2)
print(*ans)


X = int(input())
sq1 = X ** 0.5
sq = int(sq1)
u = 0

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
if X % sq1 == 0:
	sq -= 1
if X == 1:
	print(1, 1)
elif X == 2:
	print(1, 2)
elif X == 3:
	print(1, 3)
else:
	while sq > 0:
		if X % sq == 0:
			q = X // sq
			if gcd(sq, q) != 1 and sq != 1:
				sq -= 1
				continue
			else:
				print(sq, q)
				break
		sq -= 1


import math

def check1(x, y):
	ans1 = math.gcd(x, y)
	ans = x * y / ans1
	if ans == nn:
		return True
	else:
		return False
nn = int(input())
mm = int(math.sqrt(nn))
mxn = 10000000000000000000000000000000000
for i in range(1, mm + 1):
	if nn % i == 0:
		if check1(i, nn // i) == True:
			mxx = max(i, nn // i)
			mxn = min(mxn, mxx)
			(ans1, ans2) = (i, nn // i)
print(ans1, ans2)


from math import gcd

def lcm(n1, n2):
	return n1 / gcd(n1, n2) * n2

def getfactors(a, factor):
	for i in range(2, int(a ** 0.5) + 1):
		if a % i == 0:
			if max(factor) > max(i, int(a / i)) and lcm(i, int(a / i)) == a:
				factor[0] = i
				factor[1] = int(a / i)
a = int(input())
factor = [1, a]
getfactors(a, factor)
print(*factor, end=' ')


def lcd(a, b):
	while b != 0:
		(a, b) = (b, a % b)
	return a

def solve(x):
	lim = int(x ** (1 / 2))
	for b in range(lim, 0, -1):
		if x % b == 0:
			a = x // b
			if lcd(a, b) == 1:
				return (b, a)
inp = int(input())
r = solve(inp)
print('%d %d' % r)


import math
x = int(input())
c = x
(a, b) = (1, x)

def lcm(u, v):
	return u * v // math.gcd(u, v)
for i in range(1, x):
	if i * i > x:
		break
	if x % i == 0:
		if lcm(i, x // i) == x and max(i, x // i) < c:
			c = max(i, x // i)
			(a, b) = (i, x // i)
print(a, b)


import math

def compute_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def compute_lcm(x, y):
	lcm = x * y // compute_gcd(x, y)
	return lcm

def getFactors(n):
	if n == 1:
		return [1, 1]
	factors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0 and n // i != i:
			factors.append(i)
			factors.append(n // i)
		i = i + 1
	return sorted(factors)

def solve():
	n = int(input())
	arr = getFactors(n)
	l = len(arr) // 2 - 1
	r = len(arr) // 2
	while l >= 0:
		if compute_lcm(arr[l], arr[r]) == n:
			print(arr[l], arr[r])
			return
		l -= 1
		r += 1
solve()


import math

def gcd(a, b):
	while a % b != 0:
		r = a % b
		a = b
		b = r
	return b
x = int(input())
for i in range(math.floor(math.sqrt(x)), 0, -1):
	if x % i == 0 and gcd(x // i, i) == 1:
		print(i, x // i)
		break


def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def lcm(a, b):
	return a * b // gcd(a, b)
X = int(input())
M = X
ans_a = 1
ans_b = X
for i in range(1, int(X ** 0.5) + 1):
	if X % i == 0:
		a = i
		b = X // i
		if lcm(a, b) != X:
			continue
		if M > max(a, b):
			M = max(a, b)
			ans_a = a
			ans_b = b
print(ans_a, ans_b)


from math import gcd

def lcm(a, b):
	return a * b / gcd(a, b)
n = int(input())
mx = 10 ** 12 + 1
for i in range(1, int(n ** (1 / 2)) + 1):
	d = n // i
	if lcm(i, d) == n:
		mx = min(mx, max(i, d))
print(n // mx, mx)


import sys
from math import sqrt, ceil
X = int(sys.stdin.readline())

def gcd(a, b):
	if a > b:
		return gcd(b, a)
	if a == 0:
		return b
	return gcd(b % a, a)
for i in range(int(ceil(sqrt(X))), 0, -1):
	if X % i == 0 and gcd(i, X // i) == 1:
		bot = min(X // i, i)
		top = max(X // i, i)
		print('%d %d' % (bot, top))
		break


import math

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

def printDivisors(n):
	i = 1
	a = []
	while i <= math.sqrt(n):
		if n % i == 0:
			if hcf(i, n // i) == 1:
				a.append([i, n // i])
		i = i + 1
	return a
a = int(input())
b = printDivisors(a)
c = []
for i in range(len(b)):
	c.append(max(b[i]))
print(*b[c.index(min(c))])


from math import gcd

def lcm(a, b):
	return a * b // gcd(a, b)
x = int(input())
(cura, curb) = (1, x)
for i in range(1, int(x ** 0.5) + 1):
	if x % i == 0:
		if lcm(i, x // i) == x:
			if max(i, x // i) < max(cura, curb):
				(cura, curb) = (i, x // i)
print(cura, curb)


from sys import stdin, stdout
from math import gcd, sqrt

def lcm(a, b):
	return a // gcd(a, b) * b
x = int(stdin.readline().strip())
cntr = 1
ans = 0
while cntr <= sqrt(x) + 1:
	if x % cntr == 0 and lcm(cntr, x // cntr) == x:
		ans = cntr
	cntr += 1
stdout.write('{} {}\n'.format(ans, x // ans))


import math
x = int(input())
aux = math.floor(math.sqrt(x))
(a, b) = (1, x)
i = 1
while i <= aux:
	if x % i != 0:
		i += 1
		continue
	if math.gcd(i, x // i) == 1:
		a = i
		b = x // i
	i += 1
print(a, b)


from math import gcd, inf
import itertools

def factors(n):
	return set(itertools.chain.from_iterable(((i, n // i) for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def coprime(a, b):
	return gcd(a, b) == 1
x = int(input())
if x == 1:
	print(1, 1)
else:
	f = list(factors(x))
	mx = inf
	min_pair = None
	for i in range(len(f) - 1):
		a = f[i]
		b = x // a
		if a != b and coprime(a, b):
			mxx = max(a, b)
			if mxx < mx:
				mx = mxx
				min_pair = (a, b)
	print(*min_pair)


import math
x = int(input())
mi = 10 ** 12
for i in range(1, int(x ** 0.5) + 1):
	if x % i == 0:
		mi = min(mi, max(i, x * math.gcd(i, x // i) // i))
print(x * math.gcd(x // mi, mi) // mi, mi)


x = int(input())
from math import sqrt
factorlist = []

def gcd(a, b):
	c = max(a, b)
	d = min(a, b)
	while d != 0:
		(c, d) = (d, c % d)
	return c
for i in range(1, int(sqrt(x)) + 1):
	if x % i == 0 and gcd(i, x // i) == 1:
		factorlist.append(max(i, x // i))
print(str(min(factorlist)) + ' ' + str(x // min(factorlist)))


from math import sqrt

def pgcd(a, b):
	while b != 0:
		r = a % b
		(a, b) = (b, r)
	return a

def ppcm(a, b):
	if a == 0 or b == 0:
		return 0
	else:
		return a * b // pgcd(a, b)
n = int(input())
l = []
y = []
for i in range(1, int(sqrt(n)) + 1):
	if n % i == 0:
		l.append(i)
		y.append(n // i)
for i in range(len(l) - 1, -1, -1):
	if ppcm(l[i], y[i]) == n:
		a = l[i]
		b = y[i]
		break
print(a, b)


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


from math import gcd
X = int(input())
for a in range(int(X ** 0.5), -1, -1):
	if X % a == 0 and gcd(X // a, a) == 1:
		print(a, X // a)
		break


import math

def lcm(a, b):
	m = a * b
	while a != 0 and b != 0:
		if a > b:
			a %= b
		else:
			b %= a
	return m // (a + b)
n = int(input())
sm = 10 ** 12 + 1
(a, b) = (1, n)
for i in range(1, int(math.sqrt(n)) + 100):
	if n % i == 0 and n // i % i != 0:
		if max(n // i, i) < sm and lcm(n // i, i) == n:
			sm = max(n // i, i)
			(a, b) = (n // i, i)
print(a, b)


def getPrimes(n):
	isPrime = [True] * n
	p = []
	for i in range(2, n):
		if isPrime[i]:
			for j in range(i, (n - 1) // i + 1):
				isPrime[i * j] = False
			p.append(i)
	return p

def main():
	n = int(input())
	p = getPrimes(int(n ** 0.5 + 0.5) + 100)
	a = []
	for x in p:
		if n % x == 0:
			a.append([x, 0])
			while n % x == 0:
				n //= x
				a[-1][-1] += 1
	if n > 1 or len(a) == 0:
		a.append([n, 1])
	a = [x[0] ** x[1] for x in a]
	ans = solve(a)
	print(ans[0], ans[1])

def solve(a):
	n = len(a)
	ans = (float('inf'), (0, 0))
	for x in range(1 << n):
		(s0, s1) = (1, 1)
		for i in range(n):
			if x & 1 << i:
				s1 *= a[i]
			else:
				s0 *= a[i]
		ans = min(ans, (max(s0, s1), (s0, s1)))
	return ans[1]
main()


from math import gcd, floor
x = int(input())
r = 0
i = 1
while i ** 2 <= x:
	if not x % i:
		f = floor(x / i)
		lcm = i / gcd(i, f) * f
		if lcm == x:
			r = i
	i += 1
print(str(r) + ' ' + str(floor(x / r)))


from math import *
x = int(input())
for i in range(1, int(sqrt(x)) + 1):
	if x % i == 0 and gcd(i, x // i) == 1:
		z = i
print(z, x // z)


import math

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

def bscnn(a, b):
	return int(a * b / uscln(a, b))

def LCM(n):
	for i in range(int(math.sqrt(n)), 0, -1):
		if n % i == 0:
			if uscln(i, n // i) == 1:
				return (i, n // i)
	return (1, n)
n = int(input())
print(*LCM(n))


import math

def findLcm(a, b):
	lar = max(a, b)
	small = min(a, b)
	i = lar
	while True:
		if i % small == 0:
			return i
		i += lar

def main():
	x = int(input())
	a = math.floor(math.sqrt(x))
	for i in range(a, 0, -1):
		if x % i == 0 and findLcm(i, x / i) == x:
			print(i, x // i)
			break
main()


from math import sqrt, gcd
n = int(input())
for j in range(int(sqrt(n)), 0, -1):
	if j * (n // j) / gcd(j, n // j) == n:
		print(j, n // j)
		break


M = int(input())
i = 2
div = []
extr = M
while i * i <= M:
	if extr % i == 0:
		div.append(1)
		while extr % i == 0:
			div[-1] *= i
			extr //= i
	i += 1
if extr != 1:
	div.append(extr)
ans = M
for i in range(2 ** len(div)):
	A = 1
	for j in range(len(div)):
		if i % 2:
			A *= div[j]
		i //= 2
	ans = min(ans, max(A, M // A))
print(M // ans, ans)


import math
n = int(input())
a = 1
while a * a <= n:
	if n % a < 1 == math.gcd(n // a, a):
		r = a
	a += 1
print(r, n // r)


(z, zz) = (input, lambda : list(map(int, z().split())))
fast = lambda : stdin.readline().strip()
zzz = lambda : [int(i) for i in fast().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
x = int(z())
ans = x
for i in range(10 ** 6, 0, -1):
	if x % i == 0 and gcd(i, x // i) == 1:
		ans = min(ans, max(i, x // i))
print(x // ans, ans)


def sq(val):
	sq_val = 1
	while sq_val * sq_val <= val:
		sq_val += 1
	return sq_val

def find_primes_until(val):
	sieve = [None] * val
	primes = []
	start = 1
	while start < val:
		if sieve[start] is None:
			primes.append(start + 1)
		for index in range(start, val, start + 1):
			sieve[index] = True
		start += 1
	return primes

def solve(val):
	sq_val = sq(val)
	primes = find_primes_until(sq_val)
	primes_map = {}
	for prime in primes:
		count = 0
		while val % prime == 0:
			count += 1
			val /= prime
		if count > 0:
			primes_map[prime] = count
		if val == 1:
			break
	if val != 1:
		primes_map[val] = 1
	keys = list(primes_map.keys())

	def calculate_min(index, divider1, divider2):
		if index == len(keys):
			return (divider1, divider2)
		tuple1 = calculate_min(index + 1, divider1, divider2 * keys[index] ** primes_map[keys[index]])
		tuple2 = calculate_min(index + 1, divider1 * keys[index] ** primes_map[keys[index]], divider2)
		if max(tuple1) < max(tuple2):
			return tuple1
		else:
			return tuple2
	t = calculate_min(0, 1, 1)
	print(int(t[0]), int(t[1]))
solve(int(input()))


from math import *
from fractions import *
x = int(input())
r = ceil(sqrt(x))
r = r - 1
(a, b) = (0, 0)
for i in range(r, 0, -1):
	if x % i == 0:
		(a, b) = (i, x // i)
		g = gcd(a, b)
		if g == 1:
			break
		else:
			(a, b) = (0, 0)
			continue
if x == 1:
	print(1, 1)
else:
	print(a, b)


MX = 1000000
prime = [2]

def sieve():
	mark = [True for i in range(MX)]
	for i in range(3, MX, 2):
		if mark[i]:
			prime.append(i)
		if i < 1000:
			for j in range(i * i, MX, i):
				mark[j] = False
sieve()
x = int(input())
temp = x
fact = []
for i in range(len(prime)):
	if temp % prime[i] == 0:
		mul = 1
		while temp % prime[i] == 0:
			temp //= prime[i]
			mul *= prime[i]
		fact.append(mul)
if temp > 1:
	fact.append(temp)
mx = x
mx_a = 1
mx_b = x
lim = 1 << len(fact)
for mask in range(lim):
	a = 1
	for i in range(len(fact)):
		if mask & 1 << i:
			a *= fact[i]
	b = x // a
	if max(a, b) < mx:
		mx = max(a, b)
		mx_a = a
		mx_b = b
print('{} {}'.format(mx_a, mx_b))


def nod(a, b):
	while a > 0 and b > 0:
		if a > b:
			a %= b
		else:
			b %= a
	return max(a, b)
m = 10 ** 13
q1 = -1
i1 = -1
x = int(input())
sqrtx = int(x ** 0.5)
for i in range(1, sqrtx + 1):
	if x % i == 0:
		q = x // i
		if nod(q, i) * x == i * q and m > max(q, i):
			m = max(q, i)
			q1 = q
			i1 = i
print(q1, i1)


import math

def grt(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
n = int(input())
(a, b) = (1, n)
for i in range(1, int(math.sqrt(n)) + 1):
	if n % i == 0 and max(a, b) > max(i, n // i) and (a * b // grt(i, n // i) == n):
		(a, b) = (i, n // i)
print(a, b)


import math

def isrp(a, b):
	if a == 1 or b == 1:
		return True
	while 1:
		t = a % b
		if t == 0:
			break
		else:
			a = b
			b = t
	if b > 1:
		return False
	else:
		return True
x = int(input())
xn = int(math.sqrt(x)) + 1
for i in range(0, xn - 1):
	nn = xn - i
	if x % nn == 0 and isrp(nn, int(x / nn)):
		print(nn, end=' ')
		print(int(x / nn))
		break
	if i == xn - 2:
		print(1, end=' ')
		print(x)


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return [int(i) for i in input().split()]

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

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=2):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	new_number = 0
	while number > 0:
		new_number += number % base
		number //= base
	return new_number

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True
n = ii()
gcd = math.gcd
ans = 1000000000000
res = [0, 0]
flag = False
if prime(n) or n == 1:
	print(1, n)
	exit()
for i in range(2, int(n ** 0.5) + 1):
	if n % i == 0 and gcd(i, n // i) == 1:
		if max(i, n // i) < ans:
			res[0] = i
			res[1] = n // i
			ans = max(i, n // i)
			flag = True
if flag == True:
	print(res[0], res[1])
else:
	print(1, n)


def gcd(b, c):
	while b % c != 0:
		(c, b) = (b % c, c)
	return c

def ras(x):
	if x == 1:
		return [1, 1]
	i = 1
	a = []
	while i < x / i:
		if x % i == 0:
			a.append(i)
		i = i + 1
	y = len(a) - 1
	while y >= 0:
		c = a[y]
		b = int(x / a[y])
		if gcd(b, c) == 1:
			return (c, b)
		else:
			y = y - 1
x = int(input())
r = ras(x)
print(*r)


import math

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

def lcm(a, b):
	return a * b // gcd(a, b)
n = int(input())
ans = n
n2 = int(math.sqrt(n))
if n2 * n2 != n:
	n2 += 1
for i in range(2, n2):
	if n % i == 0 and lcm(i, n // i) == n:
		ans = min(ans, max(i, n // i))
(x, y) = (ans, n // ans)
if x > y:
	(x, y) = (y, x)
print(x, y)


from math import floor, sqrt

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

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

def main():
	x = int(input())
	m = floor(sqrt(x))
	for i in range(m + 1, 0, -1):
		if lcm(x // i, i) == x:
			print(f'{x // i} {i}')
			break
main()


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


from math import gcd
n = int(input())
l = []
for i in range(1, int(pow(n, 0.5)) + 3):
	a = n // i
	if n % i == 0 and gcd(i, a) == 1:
		l.append(max(a, i))
if len(l) == 0:
	print(1, n)
else:
	t = min(l)
	print(t, n // t)


import math
from functools import reduce
x = int(input())

def compute_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def compute_lcm(x, y):
	lcm = x * y // compute_gcd(x, y)
	return lcm

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
res = None
fList = list(factors(x))
fList.sort()
n = len(fList)
res = None
if n > 30:
	some = 12
else:
	some = 2
if n == 1:
	print('1 1')
else:
	for i in range(n // 2 - some, n):
		if res == None:
			if i == n:
				res = [1, n]
			else:
				for j in range(n // 2 - some + 1, n):
					if compute_lcm(fList[i], fList[j]) == x:
						res = [fList[i], fList[j]]
						break
		elif i < n:
			if fList[i] >= res[1]:
				break
			else:
				for j in range(n // 2 - some, n):
					if compute_lcm(fList[i], fList[j]) == x:
						if max(fList[i], fList[j]) < max(res):
							res = [fList[i], fList[j]]
						break
	(l, r) = res
	print(str(l) + ' ' + str(r))


a = int(input())
from math import gcd

def compute_lcm(x, y):
	lcm = x * y // gcd(x, y)
	return lcm
for i in range(int(a ** (1 / 2)), 0, -1):
	if a % i == 0 and compute_lcm(i, a // i) == a:
		print(i, a // i)
		break
else:
	print(1, a)


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

def lcm(a, b):
	return a * b / gcd(a, b)
n = int(input())
i = 1
while i ** 2 <= n:
	if n % i == 0:
		if lcm(i, n / i) == n:
			r = i
	i += 1
print(r, n // r)


import math

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

def lcm(a, b):
	return a * b / gcd(a, b)
y = int(input())
p = int(math.sqrt(y))
if p == y:
	print(1, 1)
else:
	for x in range(p + 1, 0, -1):
		if y % x == 0:
			z = y // x
			if lcm(z, x) == y:
				print(z, x)
				break


def all_factors(n):
	from functools import reduce
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def gcd(a, b):
	div = int(min(a, b))
	divid = int(max(a, b))
	while div > 0:
		temp = divid % div
		divid = div
		div = temp
	return divid

def lcm(a, b):
	return a * b // gcd(a, b)
x = int(input())
ls = list(all_factors(x))
ls.sort()
mini = ls[-1]
for z in range(0, len(ls) - 1):
	if lcm(ls[z], x // ls[z]) == x:
		if mini > max(ls[z], x // ls[z]):
			mini = max(ls[z], x // ls[z])
print(x // mini, end=' ')
print(mini)


from math import sqrt, gcd
(ans, posx, posy) = (1e+18, 0, 0)

def find(x, y):
	global ans, posx, posy
	if gcd(x, y) == 1:
		if ans > max(x, y):
			ans = max(x, y)
			posx = x
			posy = y
n = int(input())
for i in range(1, int(sqrt(n) + 1)):
	if n % i == 0:
		find(i, int(n / i))
print(posx, posy, ' ')


def gcd(a, b):
	(a, b) = (a, b) if a > b else (b, a)
	while b != 0:
		(b, a) = (a % b, b)
	return a

def my_fun(x):
	for i in range(int(x ** 0.5), 0, -1):
		if x % i == 0:
			if gcd(i, x // i) == 1:
				return (i, x // i)
	return (1, x)
x = int(input())
print(*my_fun(x))


from sys import stdin
from math import sqrt

def gcd(a, b):
	tmp = 0
	while b > 0:
		tmp = a
		a = b
		b = tmp % b
	return a

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

def divisors(n):
	ans = []
	for i in range(1, int(sqrt(n)) + 1):
		if n % i == 0:
			if n // i == i:
				pass
			elif lcm(n // i, i) == n:
				ans.append((n // i, i))
	return ans

def main():
	n = int(stdin.readline().strip())
	if n == 1:
		print(1, 1)
		return
	ans = divisors(n)
	if len(ans) > 1:
		ans.sort()
		mini = int(1e+18)
		idx = 0
		for i in range(len(ans)):
			if max(ans[i][0], ans[i][1]) < mini:
				mini = max(ans[i][0], ans[i][1])
				idx = i
		print(ans[idx][1], ans[idx][0])
	else:
		print(ans[0][1], ans[0][0])
main()


import math
x = int(input())
for i in range(int(math.sqrt(x)) + 1, 0, -1):
	a = i
	b = int(x / i)
	if x % i == 0 and a * b / math.gcd(a, b) == x:
		ans = i
		break
print(ans, x // ans)


n = int(input())
orig = n
factors = [1]
while n % 2 == 0:
	factors[0] *= 2
	n //= 2
if factors[0] == 1:
	factors.pop()
c = 3
while c * c < n:
	if n % c == 0:
		factors.append(1)
		while n % c == 0:
			factors[-1] *= c
			n //= c
	c += 2
if n > 1:
	factors.append(n)

def func(i, cut):
	if i == -1:
		return 1 if cut <= 1 else float('inf')
	a1 = func(i - 1, cut)
	a2 = func(i - 1, cut / factors[i]) * factors[i]
	return min(a1, a2)
x = func(len(factors) - 1, orig ** (1 / 2))
print(orig // x, x)


from math import *

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

def lcm(a, b):
	return a * b / gcd(a, b)
n = int(input())
for a in range(int(sqrt(n)), 0, -1):
	if n % a == 0:
		if lcm(a, n // a) == n:
			print(a, n // a)
			break


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


import math
t = int(input())
mini = 1000000000000
ans = 1
for i in range(1, int(pow(t, 0.5) + 1)):
	a = i
	b = t // i
	if a * b == t and b % a != 0 and (math.gcd(a, b) == 1):
		if max(a, b) < mini:
			mini = max(a, b)
			ans = a
A = []
A.append(ans)
A.append(t // ans)
print(A[0], end=' ')
print(A[1])


import math
lcm = int(input())
for i in range(int(lcm ** 0.5), 0, -1):
	if lcm % i == 0 and math.gcd(lcm // i, i) == 1:
		print(i, lcm // i)
		break


import sys, math, string, bisect
from itertools import *
input = sys.stdin.readline
from collections import deque, defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().strip()

def find_lcm(num1, num2):
	if num1 > num2:
		num = num1
		den = num2
	else:
		num = num2
		den = num1
	rem = num % den
	while rem != 0:
		num = den
		den = rem
		rem = num % den
	gcd = den
	lcm = int(int(num1 * num2) / int(gcd))
	return lcm

def maxCrossingSum(arr, l, m, h):
	sm = 0
	left_sum = -10000
	for i in range(m, l - 1, -1):
		sm = sm + arr[i]
		if sm > left_sum:
			left_sum = sm
	sm = 0
	right_sum = -1000
	for i in range(m + 1, h + 1):
		sm = sm + arr[i]
		if sm > right_sum:
			right_sum = sm
	return left_sum + right_sum

def maxSubArraySum(arr, l, h):
	if l == h:
		return arr[l]
	m = (l + h) // 2
	return max(maxSubArraySum(arr, l, m), maxSubArraySum(arr, m + 1, h), maxCrossingSum(arr, l, m, h))

def smallestSubWithSum(arr, n, x):
	curr_sum = 0
	min_len = n + 1
	start = 0
	end = 0
	while end < n:
		while curr_sum <= x and end < n:
			if curr_sum <= 0 and x > 0:
				start = end
				curr_sum = 0
			curr_sum += arr[end]
			end += 1
		while curr_sum > x and start < n:
			if end - start < min_len:
				min_len = end - start
			curr_sum -= arr[start]
			start += 1
	return min_len

def lcm(a, b):
	return a * b // math.gcd(a, b)
n = I()
for i in range(int(math.sqrt(n)) + 1, 0, -1):
	if n % i == 0 and lcm(n // i, i) == n:
		print(i, n // i)
		break


from math import gcd
x = int(input())
pairs = []
for i in range(1, int(x ** 0.5) + 1):
	if x % i == 0 and gcd(i, x // i) == 1:
		pairs.append([i, x // i])
ind = -1
m = 100000000000000
for i in range(len(pairs)):
	if m > max(pairs[i][0], pairs[i][1]):
		m = max(pairs[i][0], pairs[i][1])
		ind = i
print(*pairs[i])


import math

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
m = 1000000000000.0
x = int(input())
target = int(math.sqrt(x)) + 1
for i in range(1, target):
	if x % i != 0:
		continue
	d1 = x // i
	a1 = gcd(i, d1)
	if a1 == 1 or a1 == x:
		if min(i, d1) < m:
			m = max(i, d1)
			ans = [i, d1]
print(*ans)


x = int(input())
a = 1

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

def lcm(a, b):
	return a * b / gcd(a, b)
for i in range(2, int(x ** 0.5 + 1)):
	if x % i == 0:
		if lcm(i, x // i) == x:
			a = i
print(a, x // a)


from math import gcd
x = int(input())
arr = []
for a in range(1, x + 1):
	if a * a > x:
		break
	b = x // a
	if a * b == x:
		arr.append((a, b))
minmax = x + 1
ans = (1, x)
for (a, b) in arr:
	if max(a, b) < minmax and gcd(a, b) == 1:
		minmax = max(a, b)
		ans = (a, b)
print(ans[0], ans[1])


def pgcd(a, b):
	if b == 0:
		return a
	else:
		r = a % b
		return pgcd(b, r)
n = int(input())
n2 = int(n ** 0.5)
test = False
while n2 > 0:
	if n % n2 == 0 and n // n2 % n2 != 0 and (pgcd(n2, n // n2) == 1):
		print(n2, n // n2)
		test = True
		break
	n2 -= 1
if test == False:
	print(1, n)


from math import gcd
x = int(input())
for number in range(int(x ** 0.5), 0, -1):
	if x % number == 0 and gcd(number, x // number) == 1:
		print(number, x // number)
		break


import itertools

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return factors
n = int(input())
fs = []
last_f = 1
for f in prime_factors(n):
	if f == last_f:
		fs[-1] *= f
	else:
		fs.append(f)
		last_f = f

def findsubsets(S, m):
	return set(itertools.combinations(S, m))

def allsubsets(S):
	out = set([])
	for i in range(1, len(S) + 1):
		out = out | findsubsets(S, i)
	return out
alls = allsubsets(fs)
sol = [1, 1]
sol_m = 10 ** 13
for ss in alls:
	p1 = 1
	for si in ss:
		p1 *= si
	p2 = n // p1
	if max(p1, p2) < sol_m:
		sol = [p1, p2]
		sol_m = max(p1, p2)
print(sol[0], sol[1])


from math import gcd, sqrt
X = int(input())
(a, b) = (1, X)
for i in range(2, int(sqrt(X)) + 1):
	if X % i == 0 and gcd(i, X // i) == 1:
		(a, b) = (i, X // i)
print(a, b)


import math

def printDivisors(n):
	c = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				c.append(i)
			else:
				c.append(i)
				c.append(n // i)
		i = i + 1
	return c
n = int(input())
p = printDivisors(n)
c = sorted(p)
if c == [1]:
	print(1, 1)
else:
	l = []
	for i in range(len(c) // 2):
		if c[i] * c[len(c) - i - 1] // math.gcd(c[i], c[len(c) - i - 1]) == n:
			l.append([c[len(c) - i - 1], c[i]])
	l = sorted(l)
	print(l[0][0], l[0][1])


from math import sqrt
from math import floor

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

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

def factorize(n):
	i = floor(sqrt(n))
	while lcm(i, n // i) != n:
		if n % i == 0:
			i -= 1
		while n % i != 0:
			i -= 1
	return (i, n // i)

def solver():
	n = int(input())
	return factorize(n) if n != 1 else tuple((1, 1))
t = solver()
print(t[0], t[1])


from math import sqrt

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():
	x = int(input())
	m = x
	a = [1, x]
	for i in range(1, int(sqrt(x)) + 1):
		if x % i == 0:
			if lcm(i, x / i) == x:
				m = min(m, max(i, x / i))
				a = [i, x / i]
	print(a[0], ' ', int(a[1]))
for _ in range(1):
	solve()


import math
target = int(input())

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

def lcm(a, b):
	return a * b // gcd(a, b)
mini = 0
for i in range(1, int(math.sqrt(target)) + 1):
	if target % i == 0 and lcm(i, target // i) == target:
		mini = i
print(mini, end=' ')
print(target // mini)


from math import gcd, sqrt
n = int(input())
v = int(sqrt(n))
for i in range(v, -1, -1):
	if n % i == 0:
		(a, b) = (i, n // i)
		if gcd(a, b) == 1:
			break
print(a, b)


import math

def hcf(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
X = int(input())
arr = [0] * 2
if X == 1 or X == 2 or X == 3:
	print('1 ' + str(X))
else:
	signal = False
	for i in range(int(math.sqrt(X)), 1, -1):
		if X % i == 0:
			arr = [i, X // i]
			if hcf(arr[0], arr[1]) == 1:
				print(str(arr[0]) + ' ' + str(arr[1]))
				signal = True
				break
	if signal == False:
		print('1 ' + str(X))


import math

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 factors(n):
	s = list()
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			s.append(i)
			s.append(n // i)
		i += 1
	return s
x = int(input())
arr = factors(x)
arr = list(arr)
arr = sorted(arr)
(start, end) = (0, len(arr) - 1)
while start <= end:
	if lcm(arr[start], arr[end]) == x:
		(a, b) = (arr[start], arr[end])
	start += 1
	end -= 1
print(a, b)


from sys import *
from math import *

def lcm(a, b):
	return abs(a * b) // gcd(a, b)
n = int(stdin.readline())
a = 1
b = 1
for i in range(1, int(sqrt(n)) + 1):
	p1 = a
	p2 = b
	if n % i == 0:
		a = i
		b = n // i
		if lcm(a, b) != n:
			a = p1
			b = p2
print(a, b)


def GCD(a, b):
	if b == 0:
		return a
	else:
		return GCD(b, a % b)
x = int(input())
i = 1
l = 0
r = 0
while i * i < x:
	if x % i == 0 and GCD(x / i, i) == 1:
		l = i
		r = x / i
	i = i + 1
if x == 1:
	print(1, ' ', 1)
else:
	print(int(l), ' ', int(r))


import math

def next_prime(num):
	return num + 1

def find_all_factors(num):
	factors = [1, 1]
	last_tried = 1
	max_limit = int(math.sqrt(num)) + 1
	while num > 1 and last_tried <= max_limit:
		last_tried = next_prime(last_tried)
		addable = 1
		while True:
			if num % last_tried == 0:
				addable *= last_tried
				num = num // last_tried
			else:
				if addable != 1:
					factors.append(addable)
				break
	if num > 1:
		factors.append(num)
	return factors

def correct_factors(factors):
	corrected = [1]
	for i in factors:
		if corrected[-1] % i == 0:
			corrected[-1] *= i
		else:
			corrected.append(i)
	return corrected

def distribute_factors(num, factors, answers=[]):
	if len(answers) < len(factors):
		max1 = distribute_factors(num, factors, answers + [1])
		max2 = distribute_factors(num, factors, answers + [0])
		return min(max1, max2)
	else:
		num1 = 1
		for i in range(len(answers)):
			if answers[i]:
				num1 *= factors[i]
		if num1 == 0:
			return num
		num2 = num // num1
		return max(num1, num2)

def main(number):
	answer = distribute_factors(number, find_all_factors(number))
	return str(number // answer) + ' ' + str(answer)
number = int(input())
print(main(number))


def HCF(a, b):
	a1 = max(a, b)
	b1 = min(a, b)
	while b1:
		(a1, b1) = (b1, a1 % b1)
	return a1

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


import math
n = int(input())
x = int(math.sqrt(n)) + 1
a = []
for i in range(1, x):
	if n % i == 0:
		y = n // i
		if y != i:
			a.append(i)
			a.append(y)
l = len(a)
if a == []:
	print(1, n)
else:
	a = sorted(a)
	for i in range(l // 2, l):
		if math.gcd(a[i], n // a[i]) == 1:
			print(n // a[i], a[i])
			exit()


from fractions import gcd

def main():
	X = int(input())
	now = [10 ** 20, 10 ** 20]
	for i in range(1, int(X ** 0.5) + 1):
		if X % i == 0 and X == i * (X // i) // gcd(i, X // i):
			if max(i, X // i) < max(now):
				now = [i, X // i]
	print(now[0], now[1])
main()


import math
n = int(input())
for i in range(int(n ** 0.5), 0, -1):
	if n % i == 0 and math.gcd(i, n // i) == 1:
		ind = i
		break
print(ind, n // ind)


from math import gcd

def lcm(a, b):
	return a * b // gcd(a, b)
n = int(input())
inf = 9999999999999
(a, b) = (inf, inf)
if n == 1:
	print(1, 1)
	exit()
for i in range(1, int(n ** 0.5) + 1):
	if n % i == 0 and max(a, b) > max(i, n // i) and (lcm(i, n // i) == n):
		a = n // i
		b = i
print(a, b)


import math
num = input()
num = int(num)
a = 1
b = num
m = 99999999999999999
r = math.sqrt(num)
r = r + 1
r = int(r)
for i in range(1, r):
	if num % i == 0 and int(num / i) * i / math.gcd(int(num / i), i) == num:
		if max(int(num / i), i) < m:
			m = max(int(num / i), i)
			a = i
			b = int(num / i)
print('{a} {b}'.format(a=a, b=b))


def min_possible_divisors(X):
	a = 1
	A = []
	B = []
	for i in range(2, int(X ** 0.5) + 1):
		if X % i == 0:
			a = i
			b = X // a
			if b % a != 0 and hcf(a, b) == 1:
				A.append(a)
	if len(A) > 0:
		return str(max(A)) + ' ' + str(X // max(A))
	else:
		return str(1) + ' ' + str(X)

def hcf(a, b):
	while a > 0:
		h = b % a
		b = a
		a = h
	return b
X = int(input())
print(min_possible_divisors(X))


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

def Factor(n):
	Ans = []
	d = 1
	while d * d <= n:
		if n % d == 0:
			Ans.append([d, n // d])
		d += 1
	return Ans
x = int(input())
Ans = Factor(x)
min = Ans[0][1]
minI = 0
for i in range(len(Ans)):
	if Ans[i][1] < min and gcd(Ans[i][0], Ans[i][1]) == 1:
		min = Ans[i][1]
		minI = i
print(str(Ans[minI][0]) + ' ' + str(Ans[minI][1]))


import math
n = int(input())
p = i = 1
while i ** 2 <= n:
	if n % i < 1 == math.gcd(n // i, i):
		p = i
	i += 1
print(p, n // p)


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


import math

def lcm(a, b):
	return a * b // math.gcd(a, b)
x = int(input())
ans = 1
upper = math.ceil(x ** 0.5)
for i in range(1, upper):
	if x % i == 0 and lcm(i, x // i) == x:
		ans = i
print(ans, x // ans)


import sys, itertools, math
X = int(sys.stdin.readline())
best = X
ba = 0
bb = 0
for a in range(1, int(math.sqrt(X)) + 1):
	if X % a == 0:
		b = X // a
		if b < a:
			break
		if a * b // math.gcd(a, b) == X:
			if max(a, b) <= best:
				(ba, bb) = (a, b)
				best = max(a, b)
print(ba, bb)


try:
	n = int(input())
	A = []
	k = int(n ** (1 / 2))
	for i in range(1, k + 1):
		if n % i == 0:
			B = [i, n // i]
			A.append(B)
	for i in range(len(A) - 1, -1, -1):
		x = A[i][0]
		y = A[i][1]
		while y:
			(x, y) = (y, x % y)
		if x == 1:
			print(A[i][0], A[i][1])
			break
except:
	pass


def gcd(a, b):
	k = a % b
	while k:
		a = b
		b = k
		k = a % b
	return b
x = int(input())
ans = 1000000000000
for i in range(1, int(x ** 0.5) + 1):
	if x % i == 0:
		a = i
		b = x // i
		if gcd(a, b) == 1:
			ans = min(ans, b)
print(x // ans, int(ans))


from math import gcd
x = int(input())
sqrt = x ** 0.5
for i in range(int(sqrt), 0, -1):
	if x / i == int(x / i):
		if gcd(i, x // i) == 1:
			print(min(i, x // i), max(i, x // i))
			break


import math
from math import gcd
n = int(input())
t = math.ceil(n ** 0.5)
a = float('-inf')
b = float('inf')

def lcm(a, b):
	return a * b // gcd(a, b)
for i in range(t - 1, 0, -1):
	if n % i == 0 and lcm(i, n // i) == n:
		b = min(b, n // i)
		a = max(a, i)
if n == 1:
	print(1, 1)
else:
	print(b, a)


def factorize(n):
	(c, ans, mi, ma) = (2, 0, 1, n)
	while c * c < n:
		if n % c == 0:
			if lcm(c, n // c) == n:
				(mi, ma) = (c, n // c)
		c += 1
	return (mi, ma)

def lcm(a, b):
	return a // gcd(a, b) * b
from math import gcd
n = int(input())
print(*factorize(n))


import sys
import math
import collections
import bisect
from collections import deque as queue

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()
for t in range(1):

	def divisors(n):
		ans = []
		for i in range(1, int(math.sqrt(n) + 1)):
			if n % i == 0:
				if n / i == i:
					ans.append(i)
				else:
					ans.append(i)
					ans.append(n // i)
		return ans
	num = int(input())
	div = divisors(num)
	a = 10 ** 14
	b = 10 ** 14
	for i in div:
		a_temp = i
		b_temp = num // i
		lcm = a_temp * b_temp // math.gcd(a_temp, b_temp)
		if lcm == num:
			if max(a, b) > max(a_temp, b_temp):
				a = a_temp
				b = b_temp
	print(a, b)


import math

def lcm(a, b):
	return a * b // math.gcd(a, b)
x = int(input())
minl = x
min2 = 1
for i in range(2, int(x ** 0.5) + 1):
	a = i
	b = x // i
	if lcm(a, b) == x:
		if max(a, b) < minl:
			minl = max(a, b)
			min2 = min(a, b)
print(min2, minl)


from math import ceil, sqrt

def gcd(a, b):
	return gcd(b, a % b) if a % b else b
x = int(input())
for i in range(ceil(sqrt(x)), 0, -1):
	if x % i == 0 and gcd(i, x // i) == 1:
		print(i, x // i)
		break


from sys import stdin, stdout
import bisect
import math

def st():
	return list(stdin.readline().strip())

def inp():
	return int(stdin.readline())

def li():
	return list(map(int, stdin.readline().split()))

def mp():
	return map(int, stdin.readline().split())

def pr(n):
	stdout.write(str(n) + '\n')

def soe(limit):
	l = [1] * (limit + 1)
	prime = []
	for i in range(2, limit + 1):
		if l[i]:
			for j in range(i * i, limit + 1, i):
				l[j] = 0
	for i in range(2, limit + 1):
		if l[i]:
			prime.append(i)
	return prime

def segsoe(low, high):
	limit = int(high ** 0.5) + 1
	prime = soe(limit)
	n = high - low + 1
	l = [0] * (n + 1)
	for i in range(len(prime)):
		lowlimit = low // prime[i] * prime[i]
		if lowlimit < low:
			lowlimit += prime[i]
		if lowlimit == prime[i]:
			lowlimit += prime[i]
		for j in range(lowlimit, high + 1, prime[i]):
			l[j - low] = 1
	for i in range(low, high + 1):
		if not l[i - low]:
			if i != 1:
				print(i)

def power(a, n):
	r = 1
	while n:
		if n & 1:
			r = r * a
		a *= a
		n = n >> 1
	return r

def extgcd(a, b):
	if a == 0:
		return (b, 0, 1)
	(g, x1, y1) = extgcd(b % a, a)
	x = y1 - b // a * x1
	y = x1
	return (g, x, y)

def solve():
	n = inp()
	i = 1
	while i * i <= n:
		if n % i == 0 and i * (n // i) // math.gcd(i, n // i) == n:
			c = i
		i += 1
	print(c, n // c)
for _ in range(1):
	solve()


x = int(input())

def gcd(q, p):
	if p == 0:
		return q
	else:
		return gcd(p, q % p)

def findab(x):
	i = int(pow(x, 0.5))
	while i >= 1:
		if x % i == 0 and gcd(i, x / i) == 1:
			a = i
			b = x // i
			break
		i = i - 1
	print(a, b)
findab(x)


import sys
input = sys.stdin.readline
x = int(input())
factors = []

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

def lcm(a, b):
	return a * b // gcd(a, b)
for i in range(1, int(x ** 0.5) + 1):
	if x % i == 0:
		factors.append((i, x // i))
ans = (1, x)
for (a, b) in factors:
	if lcm(a, b) == x:
		ans = (a, b)
print(*ans)


import math

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

def lcm(a, b):
	return a * b / gcd(a, b)
q = int(input())
w = int(math.sqrt(q))
for i in range(w, 0, -1):
	if q % i == 0 and lcm(i, q // i) == q:
		print(i, q // i)
		break


from math import sqrt, gcd
n = int(input())
result = 10 ** 13
for i in range(1, int(sqrt(n)) + 1):
	if n % i == 0:
		a1 = max(i, n // i)
		a2 = min(i, n // i)
		if gcd(a1, a2) == 1 and a1 < result:
			result = a1
else:
	print(result, n // result)


import math
n = int(input())
ans = float('inf')
if n == 1:
	print(1, 1)
else:
	for i in range(1, int(n ** 0.5) + 2):
		if n % i == 0:
			if i != n // i:
				(a, b) = (n // i, i)
				if math.gcd(a, b) == 1:
					ans = min(ans, max(a, b))
	print(n // ans, ans)


from math import *
list1 = []
x = int(input())
for i in range(1, int(sqrt(x)) + 1):
	if x % i == 0:
		if gcd(i, x // i) == 1:
			list1.append([max(i, x // i), i, x // i])
list1.sort()
print(str(list1[0][1]), str(list1[0][2]))


from math import *
from collections import *
import sys
sys.setrecursionlimit(10 ** 9)
n = int(input())
for i in range(int(sqrt(n)), 0, -1):
	if n % i == 0 and gcd(n // i, i) == 1:
		print(i, n // i)
		break


def GCD(x, y):
	if x == 0:
		return y
	return GCD(y % x, x)

def LCM(x, y):
	return x * y / GCD(x, y)
X = int(input())
i = 1
while i ** 2 <= X:
	if X % i == 0:
		if LCM(i, X / i) == X:
			result = i
	i += 1
print(result, int(X / result))


from functools import reduce
import math
x = int(input())

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

def fs(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
lof = list(fs(x))
mn = x
for i in range(len(lof)):
	a = lof[i]
	b = x // a
	if lcm(a, b) == x:
		mn = min(max(a, b), mn)
print(mn, x // mn)


from math import *
from math import factorial
from collections import *
from operator import itemgetter
ii = lambda : int(input())
iia = lambda : list(map(int, input().split()))
isa = lambda : list(input().split())
n = ii()
x = [100000000000000, 100000000000000]
for i in range(1, int(sqrt(n)) + 1):
	a = i
	if n % i == 0:
		b = n // a
		if a * b / gcd(a, b) == n and max(a, b) < max(x):
			x[0] = a
			x[1] = b
print(*x)


from math import sqrt

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

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

def solve(n):
	l = []
	for i in range(1, int(sqrt(n)) + 1):
		if n % i == 0:
			l.append(i)
			l.append(n // i)
	return list(set(l))
x = int(input())
d = solve(x)
final = 10 ** 13
(a, b) = (1, x)
for i in d:
	if max(i, x // i) < final:
		if lcm(i, x // i) == x:
			(a, b) = (i, x // i)
			final = max(i, x // i)
print(a, b)


def binarySearch(arr, x):
	l = 0
	r = len(arr) - 1
	while l <= r:
		mid = (l + r) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] < x:
			l = mid + 1
		else:
			r = mid - 1
	return -1
x = int(input())
f = []
for i in range(1, int(x ** 0.5) + 1):
	if x % i == 0:
		if x % (x // i) == 0:
			f.append(x // i)
		f.append(i)
from math import *
ans = []
for i in range(len(f)):
	t = x // f[i]
	if gcd(f[i], t) == 1:
		if f[i] > t:
			ans.append([t, f[i]])
		else:
			ans.append([f[i], t])
index = 0
c = ans[0][1]
for i in range(len(ans)):
	if ans[i][1] < c:
		index = i
		c = ans[i][1]
print(*ans[index])


from math import sqrt

def checkprime(i, plist):
	rt = sqrt(i)
	for p in plist:
		if i % p == 0:
			return False
		if p > rt:
			plist.append(i)
			return True
	plist.append(i)
	return True

def factorise(X):
	plist = []
	factors = []
	f = 2
	rt = sqrt(X)
	if f <= rt:
		factor = 1
		while X % f == 0 and X != 0:
			factor *= f
			X //= f
		if factor > 1:
			factors.append(factor)
	f = 3
	while f <= rt:
		if checkprime(f, plist):
			factor = 1
			while X % f == 0 and X != 0:
				factor *= f
				X //= f
			if factor > 1:
				factors.append(factor)
		f += 2
	if X > 1:
		factors.append(X)
	return factors
X = int(input())
if X == 1:
	print(1, 1)
else:
	factors = factorise(X)
	factors.sort()
	(a, b) = (1, 1)
	size = len(factors)
	bins = [format(i, f'0{size}b') for i in range(2 ** size)]
	opti = 10 ** 12
	(optia, optib) = (0, 0)
	for bn in bins:
		(a, b) = (1, 1)
		for (n, bit) in enumerate(bn):
			if bit == '1':
				a *= factors[n]
			else:
				b *= factors[n]
		if max(a, b) < opti:
			opti = max(a, b)
			(optia, optib) = (a, b)
	print(optia, optib)


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
n = int(input())
import math
b = []
for i in range(1, math.ceil(n ** 0.5) + 1):
	if i * (n // i) == n:
		b.append([i, n // i])
l = float('inf')
for i in b:
	k = gcd(i[0], i[1])
	if i[0] * i[1] // k == n:
		if max(i) < l:
			t = i
			l = max(i)
print(*t)


import sys
import math
import heapq
import bisect
import re
from collections import deque
from decimal import *
from fractions import gcd
sys.setrecursionlimit(1000000000)

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def finput():
	return float(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())

def modst(q, s):
	res = 1
	while s:
		if s % 2:
			res *= q
		q *= q
		s //= 2
	return res

def main():
	n = int(sys.stdin.readline())
	for i in range(int(n ** 0.5) + 1, 0, -1):
		if n % i == 0 and gcd(i, n // i) == 1 or i == 1:
			r = i
			break
	print(r, n // r)
for i in range(1):
	main()


from math import *
n = int(input())
s = -1
for i in range(1, int(sqrt(n)) + 1):
	l = i * (n // i) // gcd(i, n // i)
	if n % i == 0 and l == n:
		s = i
print(s, n // s)


import sys
import collections
from collections import Counter, deque
import itertools
import math
import timeit
import random

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	divisors = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return divisors

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def flin(d, x, default=-1):
	left = right = -1
	for i in range(len(d)):
		if d[i] == x:
			if left == -1:
				left = i
			right = i
	if left == -1:
		return (default, default)
	else:
		return (left, right)

def ceil(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

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

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

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)
n = ii()
res = 1
for i in range(2, int(math.sqrt(n) + 1)):
	if n % i == 0:
		if lcm(i, n // i) == n:
			res = i
print(res, n // res)


import sys
from math import sqrt, gcd
from bisect import bisect
inp = sys.stdin.readline
read = lambda : list(map(int, inp().strip().split()))

def solve():
	n = int(inp())
	for i in range(int(sqrt(n) + 1), 0, -1):
		if n % i == 0 and gcd(i, n // i) == 1:
			print(i, n // i)
			break
solve()


import math
x = int(input())
ans = 10 ** 18
for i in range(1, int(x ** 0.5) + 1):
	if x % i == 0:
		if math.gcd(i, x // i) == 1:
			if max(i, x // i) < ans:
				ans = max(i, x // i)
				a = [i, x // i]
print(*a)


from math import sqrt, gcd

def lcm(a, b):
	return a * b / gcd(a, b)
n = int(input())
index = 1
m = float('inf')
for i in range(1, int(sqrt(n)) + 1):
	if n % i == 0 and lcm(i, int(n / i)) == n:
		if max(i, n / i) < m:
			m = max(i, n / i)
			index = i
print(index, int(n / index))


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
x = int(input())
r = 10 ** 15
for i in range(1, 1 + int(x ** 0.5)):
	if x % i == 0 and gcd(i, x // i) == 1:
		r = min(r, x // i)
print(x // r, r)


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

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

def fadi(X):
	l = []
	i = 2
	a = 1
	b = X
	while i * i <= X:
		if X % i == 0 and lcm(i, X / i) == X:
			a = i
			b = X / i
			i += 1
		else:
			i += 1
	print(str(int(a)) + ' ' + str(int(b)))
fadi(int(input()))


import math
x = int(input())
l = []
for i in range(1, int(math.sqrt(x)) + 1):
	if x % i == 0:
		l.append(i)
d = []
for j in l:
	if math.gcd(j, x // j) == 1:
		d.append(j)
print(d[len(d) - 1], x // d[len(d) - 1])


import sys
input = sys.stdin.readline

def hcf(a, b):
	while b:
		(a, b) = (b, a % b)
	return True if a == 1 else False
x = int(input())
for i in range(int(x ** 0.5) + 1, 0, -1):
	if x % i == 0 and hcf(max(x // i, i), min(x // i, i)):
		break
print(x // i, i)


from sys import stdin, stdout
X = int(input())
import math

def primeFactors(n):
	ans = []
	temp = 1
	while n % 2 == 0:
		temp *= 2
		n = n / 2
	if temp != 1:
		ans.append(int(temp))
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		temp = 1
		while n % i == 0:
			temp *= i
			n = n / i
		if temp != 1:
			ans.append(int(temp))
	if n > 2:
		ans.append(int(n))
	return ans
pfactors = primeFactors(X)
pfactors.sort()
from itertools import *
from operator import mul
from functools import reduce
diff = 10 ** 12
(mina, minb) = (None, None)
for pattern in product([True, False], repeat=len(pfactors)):
	a = reduce(mul, [x[1] for x in zip(pattern, pfactors) if x[0]], 1)
	b = reduce(mul, [x[1] for x in zip(pattern, pfactors) if not x[0]], 1)
	if abs(a - b) < diff:
		diff = abs(a - b)
		(mina, minb) = (a, b)
print(mina, minb)


from sys import stdin, setrecursionlimit
setrecursionlimit(pow(10, 9))
import math

def input():
	return stdin.readline().strip()

def are_coprimes(a, b):
	if not (a | b) & 1:
		return False
	return math.gcd(a, b) == 1

def get_pairs(x):
	min_num = x
	for i in range(int(math.sqrt(x)), 0, -1):
		if x % i == 0:
			if are_coprimes(i, x // i):
				return (i, x // i)
	return (1, x)
x = int(input())
ans = get_pairs(x)
print(*ans)


from math import sqrt, gcd
N = int(input())
sN = int(sqrt(N))
for i in range(sN):
	sNmi = sN - i
	if N % sNmi:
		continue
	second = N // sNmi
	if gcd(sNmi, second) == 1:
		print(sNmi, second)
		break


n = int(input())
import math
rem = 1

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

def lcm(a, b):
	return a * b / gcd(a, b)
for i in range(2, math.ceil(math.sqrt(n))):
	if n % i == 0:
		if lcm(n // i, i) == n:
			rem = i
print(rem, n // rem)


import math
n = int(input())
i = 1
minn = 1
while i * i <= n:
	if n % i == 0 and n * math.gcd(i, n // i) == n:
		minn = i
	i += 1
print(minn, n // minn)


def prime_factorize(n):
	factors = []
	orig_n = n
	d = 2
	while d * d <= orig_n and n > 1:
		if n % d == 0:
			pk = 1
			while n % d == 0:
				n //= d
				pk *= d
			factors.append(pk)
		d += 1
	if n > 1:
		factors.append(n)
	return factors
factors = prime_factorize(int(input()))
(ansA, ansB) = (10 ** 18, 10 ** 18)
for mask in range(1 << len(factors)):
	(a, b) = (1, 1)
	for i in range(len(factors)):
		if mask & 1 << i:
			a *= factors[i]
		else:
			b *= factors[i]
	if max(a, b) < max(ansA, ansB):
		(ansA, ansB) = (a, b)
print(ansA, ansB)


from math import gcd, floor
x = int(input())
for i in range(floor(x ** 0.5), 0, -1):
	(a, b) = (i, x // i)
	if a * b / gcd(a, b) == x:
		print(a, b)
		break


from sys import stdin
import math

def mp(l):
	result = 1
	for x in l:
		result = result * x
	return result

def prime_factors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n // i
	if n > 2:
		l.append(n)
	return l
n = int(stdin.readline().rstrip())
if n == 1:
	print(1, 1)
else:
	l = prime_factors(n)
	if l[0] == l[-1]:
		print(1, n)
	else:
		d = []
		s = list(set(l))
		for i in range(len(s)):
			d.append(s[i] ** l.count(s[i]))
		d.sort()
		r = [set()]
		for i in range(len(d)):
			for j in range(len(r)):
				z = r[j].copy()
				z.add(d[i])
				r.append(z)
		a = 999999999999999999999999
		b = 0
		diff = a - b
		for i in range(1, len(r) - 1):
			n1 = mp(list(r[i]))
			n2 = n // n1
			if abs(n1 - n2) < diff:
				a = max(n1, n2)
				b = min(n1, n2)
				diff = abs(n1 - n2)
		print(b, a)


t = int(input())
contador = 0
avance = int(t ** 0.5)
chico = 1
grande = t
mini = []

def mcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def mcm(a, b):
	return int(a * b / mcd(a, b))
while avance > 1 and contador == 0:
	if t % avance == 0:
		chico = avance
		grande = int(t / chico)
		if mcd(chico, grande) == 1:
			contador += 1
		elif len(mini) == 0:
			mini.append(chico)
			mini.append(grande)
		else:
			for i in mini:
				if mcm(i, grande) == t:
					chico = i
					contador += 1
					break
	avance -= 1
if contador == 0:
	print(1, t)
else:
	print(chico, grande)


import math
x = int(input())
m = 1000000000001
for i in range(1, int(math.sqrt(x)) + 1):
	k1 = m
	if x % i == 0:
		if x / math.gcd(x // i, i) == x:
			m = min(m, max(i, x // i))
	if m != k1:
		t = (i, x // i)
print(t[0], t[1])


from math import gcd

def factors(n):
	return list(([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))
n = int(input())
if n == 1:
	print('1 1')
else:
	(yet_min, elem) = (float('inf'), None)
	res = factors(n)
	for (i, e) in enumerate(res):
		if e[0] * e[1] // gcd(e[0], e[1]) == n:
			y = max(e)
			if y < yet_min:
				yet_min = y
				elem = e
	print(*elem)


from math import *
from sys import stdin, stdout
import itertools
import os
import sys
import threading
from collections import deque, Counter, OrderedDict, defaultdict
from heapq import *
from fractions import Fraction
mod = 100000009

def ii():
	return int(input())

def si():
	return str(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def fii():
	return int(stdin.readline())

def fsi():
	return str(stdin.readline())

def fmi():
	return map(int, stdin.readline().split())

def fli():
	return list(fmi())
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d:
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d:
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = defaultdict(list)
	for i in range(n):
		(x, y) = mi()
		d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans

def primeFactors(n):
	s = set()
	while n % 2 == 0:
		s.add(2)
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			s.add(i)
			n = n // i
	if n > 2:
		s.add(n)
	return s

def find_all(a_str, sub):
	start = 0
	while True:
		start = a_str.find(sub, start)
		if start == -1:
			return
		yield start
		start += len(sub)

def SieveOfEratosthenes(n, isPrime):
	isPrime[0] = isPrime[1] = False
	for i in range(2, n):
		isPrime[i] = True
	p = 2
	while p * p <= n:
		if isPrime[p] == True:
			i = p * p
			while i <= n:
				isPrime[i] = False
				i += p
		p += 1
	return isPrime

def dijkstra(edges, f, t):
	g = defaultdict(list)
	for (l, r, c) in edges:
		g[l].append((c, r))
	(q, seen, mins) = ([(0, f, ())], set(), {f: 0})
	while q:
		(cost, v1, path) = heappop(q)
		if v1 not in seen:
			seen.add(v1)
			path = (v1, path)
			if v1 == t:
				return (cost, path)
			for (c, v2) in g.get(v1, ()):
				if v2 in seen:
					continue
				prev = mins.get(v2, None)
				next = cost + c
				if prev is None or next < prev:
					mins[v2] = next
					heappush(q, (next, v2, path))
	return float('inf')
n = ii()
x = int(sqrt(n))
l = []
for i in range(1, x + 1):
	if n % i == 0:
		l.append([i, n // i])
z = l[0]
mx = n
for i in l:
	if i[0] * i[1] // gcd(i[0], i[1]) == n:
		if max(i) < mx:
			z = i
print(*z)


import math
x = int(input())
d = []
for i in range(2, int(x ** 0.5) + 1):
	if x % i == 0:
		d.append((i, x // i))
c = d[::-1]
for (i, j) in c:
	if math.gcd(i, j) == 1:
		print(i, j)
		break
else:
	print(1, x)


import math

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

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

def main():
	x = int(input())
	temp = -1
	mx = math.inf
	i = 2
	while i * i <= x:
		if x % i == 0 and lcm(i, x // i) == x:
			temp = max(i, int(x // i))
		if temp != -1:
			mx = min(mx, temp)
		i += 1
	if temp == -1:
		print(1, x)
	else:
		print(mx, int(x // mx))
	return
main()


import math

def lcm(a, b):
	g = math.gcd(max(a, b), min(a, b))
	return a * b // g

def main():
	x = int(input())
	facts = []
	for i in range(1, int(x ** 0.5) + 1):
		if x % i == 0:
			facts.append([i, x // i])
	min_val = float('inf')
	a = -1
	b = -1
	for i in facts:
		if max(i) < min_val and lcm(i[0], i[1]) == x:
			min_val = max(i)
			a = i[0]
			b = i[1]
	print(a, b)
main()


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
from decimal import *
BUFSIZE = 8192
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 main():
	n = int(input())
	for i in range(1, math.ceil(math.sqrt(n)) + 1):
		if n % i == 0 and i // math.gcd(i, n // i) * n // i == n:
			ans = i
	print(ans, n // ans)
main()


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

def lcm(a, b):
	return a * b // gcd(a, b)
c = []
for i in range(1, int(sqrt(n)) + 2):
	if n % i == 0:
		if lcm(i, n // i) == n:
			c.append(i)
			c.append(n // i)
print(c[-2], c[-1])


def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
n = int(input())
(a, b) = (1, n)
for i in range(2, n):
	if i * i > n:
		break
	if n % i == 0 and gcd(i, n // i) == 1:
		(a, b) = (i, n // i)
print(a, b)


import math
from decimal import *
import random

def facts(n):
	ans = [1, n]
	for i in range(2, int(math.sqrt(n)) + 2):
		if n % i == 0:
			ans.append(i)
			ans.append(n // i)
	return sorted(ans)
x = int(input())
fs = facts(x)
n = len(fs) - 1
(a, b) = (1, x)
for i in range(len(fs) // 2):
	if math.gcd(fs[n - i], fs[i]) == 1:
		(a, b) = (fs[i], fs[n - i])
print(a, b)


from collections import deque
x = int(input())

def gcd(a, b):
	while a % b:
		c = a % b
		a = b
		b = c
	return b

def lcm(a, b):
	return a * b / gcd(a, b)
hx = int(x ** 0.5) + 1
antuple = tuple([1, x])
for i in range(1, hx):
	if x % i == 0:
		d = int(x / i)
		if lcm(d, i) == x:
			if d < antuple[1]:
				antuple = tuple([i, d])
print(antuple[0], antuple[1])


from math import gcd
from sys import stdin

def main():
	input = lambda : stdin.readline()[:-1]
	X = int(input())
	lcm = lambda x, y: x * y // gcd(x, y)
	n = int(X ** 0.5)
	for a in range(n, 0, -1):
		(b, mod) = divmod(X, a)
		if not mod and lcm(a, b) == X:
			print(*sorted([a, b]))
			break
main()


def gcd(x, y):
	while y != 0:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	return x * y // gcd(x, y)
x = int(input())
for i in range(int(x ** 0.5 + 1), 0, -1):
	if x % i == 0 and lcm(i, x // i) == x:
		a = i
		b = x // i
		break
print('{} {}'.format(a, b))


n = int(input())
from math import gcd
ans = (99999999999999, 9999999999999)
for i in range(1, 1000005):
	c = n // i
	if c * i // gcd(c, i) == n:
		if max(i, c) < max(ans):
			ans = (i, c)
print(ans[0], ans[1])


from math import gcd

def divisor(n):
	ret = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			ret.append(i)
			if i * i != n:
				ret.append(n // i)
	return ret
x = int(input())
ans = float('inf')
for ai in divisor(x):
	b = x // ai
	if gcd(ai, b) == 1:
		tmp = max(ai, b)
		ans = min(ans, tmp)
print(x // ans, ans)


from math import sqrt

def nwd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def nww(a, b):
	return a // nwd(a, b) * b
liczba = int(input())
for x in range(int(sqrt(liczba)) + 1, 1, -1):
	if liczba % x == 0 and nww(x, liczba // x) == liczba:
		print(x, liczba // x)
		break
else:
	print(1, liczba)


from math import gcd, sqrt, floor

def lcm(x, y):
	return x * y // gcd(x, y)
X = int(input())
sqX = floor(sqrt(X))
for i in range(sqX, 0, -1):
	if X / i == X // i:
		if lcm(i, X // i) == X:
			print(i, X // i)
			break


import math

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
n = int(input())
ma = n
le = int(math.sqrt(n))
for i in range(1, 1 + le):
	if n % i == 0:
		a = i
		b = n // i
		temp = gcd(a, b)
		if temp == 1:
			if max(a, b) < ma:
				ma = max(a, b)
print(ma, n // ma)


import sys
sys.setrecursionlimit(10 ** 5 + 1)
inf = int(10 ** 20)
max_val = inf
min_val = -inf
RW = lambda : sys.stdin.readline().strip()
RI = lambda : int(RW())
RMI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
RWI = lambda : [x for x in sys.stdin.readline().strip().split()]
from math import gcd, floor
n = RI()
limit = floor(n ** 0.5)
for i in range(limit, 0, -1):
	(a, b) = (i, n // i)
	if a * b / gcd(a, b) == n:
		print(a, b)
		break


import math
x = int(input())
v = []
k = math.ceil(math.sqrt(x))
for i in range(1, k + 1):
	if x % i == 0:
		v.append(i)
ans = 9999999999999
flag = 0
for i in range(len(v)):
	lcm = v[i] * (x // v[i]) // math.gcd(v[i], x // v[i])
	if lcm == x:
		res = max(v[i], x // v[i])
		if res < ans:
			flag = 1
			ans = res
			p1 = v[i]
			p2 = x // v[i]
if flag:
	print(p1, p2)
else:
	print(1, x)


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log2, ceil
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from bisect import insort
from collections import Counter
from collections import deque
from heapq import heappush, heappop, heapify
from itertools import permutations, combinations
mod = int(1000000000.0) + 7
ip = lambda : int(stdin.readline())
inp = lambda : map(int, stdin.readline().split())
ips = lambda : stdin.readline().rstrip()
out = lambda x: stdout.write(str(x) + '\n')

def lcm(a, b):
	return a * b // gcd(a, b)
t = 1
for _ in range(t):
	x = ip()
	dic = {}
	for i in range(1, int(sqrt(x)) + 1):
		if x % i == 0:
			div1 = i
			div2 = x // i
			if lcm(div1, div2) == x:
				dic[max(div1, div2)] = '{} {}'.format(div1, div2)
	ans = dic[min(list(dic.keys()))]
	out(ans)


from math import gcd

def nok(a, b):
	return a * b // gcd(a, b)
a = int(input())
i = 1
while i ** 2 <= a:
	if a % i == 0 and nok(i, a // i) == a:
		b = i
	i += 1
print(b, a // b)


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

def lcm(a, b):
	return a * b / gcd(a, b)
x = int(input())
a = []
b = []
rootx = int(x ** 0.5)
for i in range(1, rootx + 1):
	if x % i == 0:
		sec = int(x / i)
		if i == 1:
			a.append(i)
			b.append(x)
		elif lcm(sec, i) == x:
			a.append(i)
			b.append(sec)
		else:
			continue
	else:
		continue
ans = str(a[-1]) + ' ' + str(b[-1])
print(ans)


import io
import os
from collections import Counter, defaultdict, deque

def primeFactors(n):
	assert n >= 1
	factors = Counter()
	while n % 2 == 0:
		factors[2] += 1
		n //= 2
	x = 3
	while x * x <= n:
		while n % x == 0:
			factors[x] += 1
			n //= x
		x += 2
	if n != 1:
		factors[n] += 1
	return factors

def solve(X):
	factors = sorted([k ** v for (k, v) in primeFactors(X).items()])
	best = (X, 1)
	for mask in range(1 << len(factors)):
		check1 = 1
		check2 = 1
		for i in range(len(factors)):
			if mask & 1 << i:
				check1 *= factors[i]
			else:
				check2 *= factors[i]
		assert check1 * check2 == X
		if check1 >= check2:
			best = min(best, (check1, check2))
		else:
			best = min(best, (check2, check1))
	return str(best[0]) + ' ' + str(best[1])
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
(X,) = [int(x) for x in input().split()]
ans = solve(X)
print(ans)


n = int(input())
sqrt = n ** 0.5
ar = []
ml = 1

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
a = 0
b = 0
for i in range(1, int(sqrt) + 1):
	if n % i == 0:
		if gcd(i, n // i) == 1:
			a = i
			b = n // i
print(a, b, end=' ')


import sys, collections, math, itertools, random, bisect
INF = sys.maxsize

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def input():
	return sys.stdin.readline().strip()
mod = int(1000000000.0 + 7)

def lcm(a, b):
	return a // math.gcd(a, b) * b
n = int(input())
if not n & n - 1:
	print(1, n)
else:
	cnt = 0
	for i in range(1, int(math.sqrt(n)) + 1):
		if lcm(i, n // i) == n:
			cnt = i
	print(cnt, n // cnt)


x = int(input())
tempx = x
if x == 1:
	print(1, 1)
else:
	arr = []
	i = 2
	cnt = 0
	new_arr = []
	while i * i <= x:
		if x % i == 0:
			arr.append(i)
			x /= i
		else:
			i += 1
	if x != 1:
		arr.append(int(x))
	arr.sort()
	arr.append(-1)
	for i in range(len(arr) - 1):
		if arr[i] == arr[i + 1]:
			cnt += 1
		else:
			new_arr.append(arr[i] ** (cnt + 1))
			cnt = 0
	num = set()
	num.add(new_arr[0])
	for i in range(1, len(new_arr)):
		temp = set()
		for j in num:
			temp.add(new_arr[i] * j)
		num |= temp
		num.add(new_arr[i])
	a = 10 ** 12
	b = 10 ** 12
	x = tempx
	for i in num:
		ans1 = int(i)
		ans2 = int(x // ans1)
		if max(ans1, ans2) < max(a, b):
			a = min(ans1, ans2)
			b = max(ans1, ans2)
	print(a, b)


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

def function(x):
	ans = [1, x]
	for i in range(2, int(x ** (1 / 2)) + 1):
		if x % i == 0 and hcf(i, x // i) == 1:
			if max(ans) > max([i, x // i]):
				ans = [i, x // i]
	return str(ans[0]) + ' ' + str(ans[1])
x = int(input())
print(function(x))


import math

def lcm(a, b):
	return a * b // math.gcd(a, b)
n = int(input())
i = 1
ans = 0
while i * i <= n:
	if n % i == 0 and lcm(i, n // i) == n:
		ans = i
	i += 1
print(ans, n // ans)


x = int(input())
c = x

def gcd(a, b):
	if a == 0:
		return b
	else:
		return gcd(b % a, a)
for i in range(1, int(x ** 0.5) + 1):
	if x % i == 0:
		a = i
		b = x // i
		if gcd(a, b) == 1:
			t = max(a, b)
			if t < c:
				c = t
print(c, x // c)


import sys
input = sys.stdin.readline
flush = sys.stdout.flush

def iin():
	return int(input())

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

def factors(a):
	fact = []
	if a % 2 == 0:
		ch = 0
		while a % 2 == 0:
			ch += 1
			a //= 2
		fact.append(pow(2, ch))
	i = 3
	while i * i <= a:
		if a % i == 0:
			ch = 0
			while a % i == 0:
				ch += 1
				a //= i
			fact.append(pow(i, ch))
		i += 2
	if a > 1:
		fact.append(pow(a, 1))
	return fact

def main():
	from math import gcd
	gcd = gcd
	x = iin()
	(a, b) = (1, x)
	i = 1
	while i * i <= x:
		if x % i == 0:
			(m, n) = (i, x // i)
			ch1 = gcd(m, n)
			if ch1 == 1:
				if max(a, b) > max(m, n):
					(a, b) = (m, n)
		i += 1
	print(a, b)
main()


from math import gcd
t = int(input())
c = [1, t]
d = t
for i in range(1, int(pow(t, 0.5)) + 1):
	if not t % i:
		x = i
		y = t // i
		e = gcd(x, y)
		g = min(x, y) * e
		h = max(x, y)
		if g * h // gcd(g, h) == t and max(g, h) < d:
			d = max(g, h)
			c = [g, h]
print(*c)


from sys import stdin
input = stdin.buffer.readline
t = int(input())
ot = t
mx = t
i = 2
prim = []
while i * i <= t:
	now = 1
	while t and t % i == 0:
		t //= i
		now = now * i
	if now != 1:
		prim.append(now)
	i += 1
if t:
	prim.append(t)
can = [1]
for i in prim:
	nw = []
	for x in can:
		nw.append(x * i)
		mx = min(mx, max(x * i, ot // (x * i)))
	can.extend(nw)
print(mx, ot // mx)


import math
n = int(input())
ans = float('inf')
a = 1
b = 1
for i in range(1, int(n ** 0.5) + 1):
	if n % i == 0:
		if math.gcd(i, n // i) == 1 and max(i, n // i) < ans:
			ans = max(i, n // i)
			a = i
			b = n // i
print(a, b)


import math
n = int(input())
k = n
if n == 2:
	print(1, 2)
elif n == 1:
	print(1, 1)
else:
	x = []
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			s = n // i
			if i * s // math.gcd(i, s) == n:
				k = max(i, s)
	print(k, n // k)


import math
x = int(input())
lst = []
sq = int(math.sqrt(x))
for i in range(1, sq + 1):
	if i * i == x:
		lst.append((i, i))
	elif x % i == 0:
		j = int(x / i)
		if j % i != 0 or i == 1:
			lst.append((i, j))
mini = x + 1
n = len(lst)
for i in range(n):
	if int(lst[i][0] * lst[i][1] / math.gcd(lst[i][0], lst[i][1])) == x:
		if lst[i][1] < mini:
			mini = lst[i][1]
			ele = lst[i][0]
			ele1 = lst[i][1]
print(ele, ele1)


def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
x = int(input())
f = []
ans = (1000000000000, 10000000000000000)
for i in range(1, int(x ** 0.5) + 1):
	if x % i == 0:
		f.append(i)
		f.append(x // i)
		if gcd(i, x // i) == 1:
			if max(i, x // i) < max(ans):
				ans = (i, x // i)
print(ans[0], ans[1])


def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)
x = int(input())
a = 1
b = x
z = 2
while x // z > z:
	if x % z == 0:
		if gcd(z, x // z) == 1:
			if max(z, x // z) < max(a, b):
				a = z
				b = x // z
	z += 1
t = []
t.append(a)
t.append(b)
print(*t)


import math
n = int(input())
c = int(n ** 0.5)
l = []

def lcm(x, y):
	return x * y // math.gcd(x, y)
for i in range(1, c + 1):
	if n % i == 0:
		l.append(max(i, n // i))
l.sort()
for i in l:
	x = lcm(i, n // i)
	if x == n:
		print(n // i, i)
		break


from math import sqrt, floor, gcd
x = int(input().strip())
y = floor(sqrt(x))
val = x
for i in range(2, y + 1):
	if x % i == 0:
		j = x // i
		if i * j // gcd(j, i) == x:
			val = max(i, j)
print(x // val, val)


from math import ceil, sqrt, gcd
x = int(input())
a = x
m = 1
n = x
for i in range(1, ceil(sqrt(x))):
	if x % i == 0 and gcd(i, x // i) == 1:
		b = max(i, x // i)
		if b < a:
			a = b
			(m, n) = (min(i, x // i), max(i, x // i))
print(m, n)


from itertools import chain, combinations
from operator import mul
from functools import reduce
import sys

def primes(n):
	primfac = [1]
	d = 2
	while d * d <= n:
		while n % d == 0:
			if primfac[-1] % d != 0:
				primfac.append(d)
			else:
				primfac[-1] *= d
			n //= d
		d += 1
	if n > 1:
		primfac.append(n)
	return primfac
X = int(input())
ps = list(sorted(primes(X)[1:]))
ans = 10 ** 13
amin = 1
bmin = 1

def rec(i, j, l):
	if l == 0:
		global ans, amin, bmin
		if max(i, j) < ans:
			ans = max(i, j)
			amin = i
			bmin = j
		return
	rec(i * ps[-l], j, l - 1)
	rec(i, j * ps[-l], l - 1)
rec(1, 1, len(ps))
print(amin, bmin)


import math
import bisect
from collections import Counter, defaultdict
from sys import stdin, stdout
input = stdin.readline
I = lambda : int(input())
M = lambda : map(int, input().split())
LI = lambda : list(map(int, input().split()))
n = I()
ans = 1
ans1 = n
for i in range(2, int(math.sqrt(n)) + 1):
	if n % i == 0 and max(i, n // i) < ans1 and (i * (n // i) // math.gcd(i, n // i) == n):
		ans = i
		ans1 = n // i
print(ans, ans1)


x = int(input())
if x == 1:
	print(1, 1)
	exit(0)
div = 2
factors = []
while x > 1 and div ** 2 <= x:
	p = 1
	while x % div == 0:
		x //= div
		p *= div
	if p != 1:
		factors.append(p)
	div += 1
if x > 1:
	factors.append(x)
min_min = float('inf')
for i in range(1 << len(factors)):
	a = b = 1
	for j in range(len(factors)):
		if i >> j & 1:
			a *= factors[j]
		else:
			b *= factors[j]
	if max(a, b) < min_min:
		min_min = max(a, b)
		(r_a, r_b) = (a, b)
print(r_a, r_b)


from __future__ import division, print_function
import os
import sys, math
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():
	n = int(input())
	k = int(math.sqrt(n))
	ans = n
	for i in range(1, k + 1):
		if n % i == 0:
			tmp = max(i, n / i)
			x = math.gcd(i, int(n / i))
			if x == 1:
				ans = min(ans, tmp)
	print(int(n / ans), int(ans))
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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def make_prime_factors_compress(n):
	prime_factors = []
	for k in range(2, int(n ** 0.5) + 1):
		cnt = 0
		while n % k == 0:
			cnt += 1
			n = n // k
		if cnt != 0:
			prime_factors.append((k, cnt))
	if n != 1:
		prime_factors.append((n, 1))
	return prime_factors
x = int(input())
prime_li = make_prime_factors_compress(x)
a = [0] * len(prime_li)
for i in range(len(prime_li)):
	(num, jo) = prime_li[i]
	a[i] = num ** jo
dp = [0] * (1 << len(prime_li))
ans = 10 ** 18
res = None
for bit_state in range(1 << len(prime_li)):
	tmp = 1
	for i in range(len(prime_li)):
		if bit_state & 1 << i:
			tmp *= a[i]
	if ans > max(tmp, x // tmp):
		ans = max(tmp, x // tmp)
		res = (tmp, x // tmp)
print(*res)


import math

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

def lcm(a, b):
	return a * b / gcd(a, b)
x = int(input())
ans = 9999999999999
ansa = 0
ansb = 0
a = False
if x == 1:
	print('1 1')
	a = True
if a == False:
	for i in range(1, int(math.sqrt(x)) + 1):
		if x % i == 0:
			if i == x / i:
				continue
			else:
				a = i
				b = x / i
				if lcm(a, b) == x:
					if max(a, b) < ans:
						ans = max(a, b)
						ansa = a
						ansb = b
	print(int(ansa), int(ansb))


from math import sqrt, gcd
j = int(input())
l = int(sqrt(j))
for i in range(l, -1, -1):
	if j % i == 0:
		h = i
		if gcd(i, j // i) == 1:
			break
print(h, j // i)


import math
x = int(input())
ans = x
for i in range(10 ** 6, 0, -1):
	if x % i == 0 and math.gcd(i, x // i) == 1:
		ans = min(ans, max(i, x // i))
print(x // ans, ans)


import math as m

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

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

def isprime(x):
	for i in range(2, m.ceil(m.sqrt(x)) + 1):
		if x % i == 0:
			return False
	return True
x = int(input())
if isprime(x):
	print(1, x)
else:
	for i in range(m.floor(m.sqrt(x)), 0, -1):
		if x % i == 0 and lcm(i, x // i) == x:
			print(i, x // i)
			break


from sys import stdin, stdout
import gc
from copy import deepcopy
from itertools import permutations
gc.disable()
input = stdin.readline
import math

def get_time(x, i):
	count = 0
	while x > 0 and x % i == 0:
		x //= i
		count += 1
	return count

def get_min_max(subset):
	num = 1
	for i in subset:
		num *= i ** divisor[i]
	return max(num, x // num)

def get_prime():
	mx = 10 ** 6 + 1
	prime = []
	seive = [1] * mx
	for i in range(2, mx):
		if seive[i] == 1:
			prime.append(i)
			for j in range(i * i, mx, i):
				seive[j] = 0
	return prime
x = int(input().strip())
if x == 1:
	print(1, 1)
	exit()
prime = get_prime()
divisor = dict()
for i in prime:
	if x % i == 0:
		divisor[i] = get_time(x, i)
l = []
for i in divisor:
	l.append(i)
if len(l) == 0:
	print(1, x)
	exit()
ans = float('inf')
for i in range(1, 2 ** len(l)):
	subset = []
	for k in range(len(l)):
		if 1 << k & i:
			subset.append(l[k])
	ans = min(ans, get_min_max(subset))
print(ans, x // ans)


import math
a = int(input())
for i in range(int(a ** 0.5) + 1, 0, -1):
	if a % i == 0 and a // math.gcd(i, a // i) == a:
		print(str(i) + ' ' + str(a // i))
		break


from collections import Counter
from functools import reduce
from itertools import combinations
from operator import mul
x = int(input())
xx = x
c = Counter()
for i in range(2, int(x ** 0.5) + 1):
	while xx % i == 0:
		c[i] += 1
		xx //= i
	if xx == 1:
		break
if xx > 1:
	c[xx] += 1
(mn, aa, bb) = (x, x, 1)
for i in range(1, len(c) // 2 + 1):
	for com in combinations(c.keys(), i):
		a = reduce(mul, (j ** c[j] for j in com), 1)
		b = x // a
		if max(a, b) < mn:
			(mn, aa, bb) = (max(a, b), a, b)
print(aa, bb)


def gcd(a: int, b: int) -> int:
	return a if b == 0 else gcd(b, a % b)
x = int(input())
i = int(x ** 0.5) + 1
while i:
	if x % i == 0 and gcd(i, x // i) == 1:
		exit(print(i, x // i))
	i -= 1


from collections import defaultdict, Counter
from math import ceil, floor, log2, gcd
from itertools import permutations, combinations
from functools import reduce
n = int(input())

def lcm(a, b):
	return abs(a * b) // gcd(a, b)
best = n + 1
for x in range(1, int(n ** 0.5) + 1):
	if n % x:
		continue
	elif lcm(x, n // x) == n:
		best = min(best, max(x, n // x))
print(best, n // best)


from math import gcd

def lcm(a, b):
	return a * b / gcd(a, b)
x = int(input())
test = int(x ** 0.5)
while test > 1 and (x % test != 0 or lcm(test, x // test) != x):
	test -= 1
print(test, x // test)


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():
	n = int(input())
	i = 2
	ans = 1
	while i * i < n:
		if n % i == 0 and lcm(i, n // i) == n:
			ans = i
		i += 1
	print(ans, n // ans)
solve()


import itertools
import math
from functools import reduce

def multiply(values):
	prod = 1
	for a in values:
		prod *= a
	return prod
value = int(input())
n = value
maxFactors = []
twos = 1
while n % 2 == 0:
	twos *= 2
	n /= 2
if twos != 1:
	maxFactors.append(twos)
for a in range(3, int(math.sqrt(n)) + 1, 2):
	total = 0
	while n % a == 0:
		total += 1
		n /= a
	if total != 0:
		maxFactors.append(a ** total)
if n > 2:
	maxFactors.append(n)
maxFactors = list(map(int, maxFactors))
maxFactors.sort()
allFactors = []
for a in range(len(maxFactors) + 1):
	allFactors += list(map(multiply, itertools.combinations(maxFactors, a)))
closest = allFactors[0]
difference = abs(closest - math.sqrt(value))
for a in allFactors:
	dif = abs(a - math.sqrt(value))
	if dif < difference:
		closest = a
		difference = dif
print(closest, int(value / closest))


n = int(input())
p = n
ans = {}
a = []
for i in range(2, int(n ** 0.5) + 1):
	if p % i == 0:
		ans[i] = 0
		while p % i == 0:
			p //= i
			ans[i] += 1
		a.append(i ** ans[i])
if p != 1:
	ans[p] = 1
	a.append(p)
if len(a) == 1:
	print(1, n)
else:
	mmax = [n, 1, n]
	for i in range(1, 2 ** len(a)):
		tmp = 1
		for j in range(len(a)):
			if i & 1 << j:
				tmp *= a[j]
		if mmax[0] > max(tmp, n // tmp):
			mmax = [max(tmp, n // tmp), tmp, n // tmp]
	print(mmax[1], mmax[2])


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

def lcm(a, b):
	m = a * b
	while a != 0 and b != 0:
		if a > b:
			a %= b
		else:
			b %= a
	return m // (a + b)
t = ceil(n ** 0.5)
if n != 1:
	t += 1
while 1:
	if n % t == 0 and lcm(t, n // t) == n or n == 1:
		a = t
		b = n // t
		break
	else:
		t -= 1
print(a, b)


import math
x = int(input())
l = list()
for i in range(1, int(x ** 0.5) + 1):
	if x % i == 0:
		if i != x // i:
			l.append(i)
			l.append(x // i)
		else:
			l.append(i)
l.sort()
minans = 10000000000000000000000000000000000000000000000000
a = 0
b = 0
for i in l:
	if math.gcd(i, x // i) == 1 and minans > max(i, x // i):
		minans = max(i, x // i)
		a = i
		b = x // i
print(a, b)


import math
x = int(input())

def lcm(a, b):
	return a * b // math.gcd(a, b)
for i in range(1, int(math.sqrt(x)) + 1):
	if x % i == 0 and lcm(i, x // i) == x:
		ans = i
print(ans, '', x // ans)


from math import ceil, sqrt, gcd

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def si():
	return input()

def lcm(x, y):
	s = x * y
	return s // gcd(x, y)
n = ii()
if n == 1:
	print(1, 1)
else:
	b = []
	y = 1
	x = int(sqrt(n)) + 1
	for i in range(1, x):
		if n % i == 0:
			if i != n // i:
				b.append(i)
		if i == n:
			b.append(i)
	for i in range(len(b) - 1, -1, -1):
		j = b[i]
		if lcm(j, n // j) == n:
			print(j, n // j)
			break


def B(n, arrr):
	a = bin(n).replace('0b', '')
	b = '0' * (len(arrr) - len(a)) + a
	return b

def product(bi, arrr):
	pro = 1
	for i in range(len(arrr)):
		if bi[i] == '1':
			pro = pro * arrr[i]
	return pro
x = int(input())
x1 = x
m = 0
ans = x1
arr = []
for i in range(2, int(x1 ** 0.5) + 1):
	if x % i == 0:
		y = 1
		while x % i == 0:
			x = x // i
			y = y * i
		arr.append(y)
for i in range(1, 2 ** len(arr)):
	p = product(B(i, arr), arr)
	q = x1 // p
	m = max(p, q)
	ans = min(m, ans)
print(ans, x1 // ans)


def GCP(a, b):
	if a == 0 or b == 0:
		return max(a, b)
	elif a > b:
		return GCP(a % b, b)
	else:
		return GCP(b % a, a)

def LCM(a, b):
	return a // GCP(a, b) * b
n = int(input())
best_div_1 = '1'
best_div_2 = str(n)
min_max_div = n
div = 1
while div * div <= n:
	if n % div == 0:
		if max(div, n // div) < min_max_div:
			if LCM(div, n // div) == n:
				min_max_div = max(div, n // div)
				best_div_1 = str(min(div, n // div))
				best_div_2 = str(max(div, n // div))
	div += 1
print(best_div_1, best_div_2)


def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
n = int(input())
x = int(n ** 0.5)
if x == 1:
	print(1, n)
else:
	for i in range(x, 0, -1):
		if n % i == 0 and i != n // i and (GCD(i, n // i) == 1):
			print(min(i, n // i), max(i, n // i))
			break


import sys
sys.setrecursionlimit(10000000)
mod = 10 ** 9 + 7
INF = float('inf')
from sys import stdin
readline = stdin.readline

def readInts():
	return list(map(int, readline().split()))

def readTuples():
	return tuple(map(int, readline().split()))

def I():
	return int(readline())
from math import gcd

def yaku(m):
	ans = []
	i = 1
	while i * i <= m:
		if m % i == 0:
			j = m // i
			ans.append(i)
			if j != i:
				ans.append(j)
		i += 1
	ans = sorted(ans)
	return ans
n = I()
lis = yaku(n)
ln = len(lis)
if n == 1:
	print(1, 1)
elif ln == 2:
	print(1, lis[-1])
elif ln % 2:
	cnt = 0
	while cnt < ln // 2:
		if lis[ln // 2 + cnt + 1] * lis[ln // 2 - cnt - 1] // gcd(lis[ln // 2 + cnt + 1], lis[ln // 2 - cnt - 1]) == n:
			print(lis[ln // 2 + cnt + 1], lis[ln // 2 - cnt - 1])
			break
		else:
			cnt += 1
else:
	cnt = 0
	while cnt < ln // 2:
		if lis[ln // 2 + cnt] * lis[ln // 2 - cnt - 1] // gcd(lis[ln // 2 + cnt], lis[ln // 2 - cnt - 1]) == n:
			print(lis[ln // 2 + cnt], lis[ln // 2 - cnt - 1])
			break
		else:
			cnt += 1


def factorise(n):
	dic = {}
	while n % 2 == 0:
		if 2 in dic:
			dic[2] += 1
		else:
			dic[2] = 1
		n = n / 2
	for i in range(3, int(n ** 0.5) + 1):
		while n % i == 0:
			if i in dic:
				dic[i] += 1
			else:
				dic[i] = 1
			n = n / i
	if n > 2:
		dic[n] = 1
	return dic
x = int(input())
dic = factorise(x)
factors = list(dic.keys())
arr = [i ** dic[i] for i in factors]
arr.sort()
l = len(factors)
if x == 1:
	print(1, 1)
elif factors[0] != x:
	all_sub = []
	for i in range(2 ** l):
		subset = []
		for j in range(l):
			if i & 1 << j != 0:
				subset.append(arr[j])
		all_sub.append(subset)
	m = 10 ** 13
	for i in all_sub:
		t = 1
		for j in i:
			t *= j
		m = min(max(t, x / t), m)
	print(int(m), int(x / m))
else:
	print(1, factors[0])


x = int(input())
arr = [1]
while x != 1:
	if x % 2 == 0:
		arr.append(2)
		x //= 2
		continue
	for i in range(3, 10 ** 6 + 9, 2):
		if x % i == 0:
			arr.append(i)
			x //= i
			break
	else:
		arr.append(x)
		x = 1
while arr.count(1) != 0:
	del arr[arr.index(1)]
arr.sort()
d = list(set(arr))
p = []
for i in range(len(d)):
	p.append(d[i] ** arr.count(d[i]))
d = []
for i in range(len(p) + 1):
	d.append(0)
q1 = 10 ** 12
q2 = 10 ** 12
while d[-1] != 1:
	a = 1
	b = 1
	for i in range(len(d) - 1):
		if d[i] == 1:
			a *= p[i]
		else:
			b *= p[i]
	if max(a, b) < max(q1, q2):
		q1 = a
		q2 = b
	d[0] += 1
	for i in range(len(d) - 1):
		if d[i] == 2:
			d[i] = 0
			d[i + 1] += 1
		else:
			break
print(q1, q2)


import math
n = int(input())
i = 2
a = 1
b = n
if n == 1:
	print(1, 1)
else:
	while i * i <= n:
		if n % i == 0:
			if math.gcd(n // i, i) == 1:
				if max(i, n // i) < max(a, b):
					a = i
					b = n // i
		i += 1
	print(a, b)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
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 list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

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

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

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

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

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

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def YES(c):
	return IF(c, 'YES', 'NO')

def Yes(c):
	return IF(c, 'Yes', 'No')

class Prime:

	def __init__(self, n):
		self.M = m = int(math.sqrt(n)) + 10
		self.A = a = [True] * m
		a[0] = a[1] = False
		self.T = t = [2]
		for j in range(4, m, 2):
			a[j] = False
		for i in range(3, m, 2):
			if not a[i]:
				continue
			t.append(i)
			for j in range(i * i, m, i):
				a[j] = False
		self.ds_memo = {}
		self.ds_memo[1] = set([1])

	def is_prime(self, n):
		return self.A[n]

	def division(self, n):
		d = collections.defaultdict(int)
		for c in self.T:
			while n % c == 0:
				d[c] += 1
				n //= c
			if n < 2:
				break
		if n > 1:
			d[n] += 1
		return d.items()

def main():
	t = 1
	pr = Prime(10 ** 12)
	rr = []
	for _ in range(t):
		x = I()
		t = [k ** v for (k, v) in pr.division(x)]
		l = len(t)
		r = x
		for i in range(1, 2 ** l - 1):
			k = 1
			for j in range(l):
				if i & 2 ** j:
					k *= t[j]
			u = max(k, x // k)
			if r > u:
				r = u
		rr.append(JA([x // r, r], ' '))
	return JA(rr, '\n')
print(main())


import math

def function(n):
	if n == 1:
		return f'{1} {1}'
	for i in range(math.floor(math.sqrt(n)), 1, -1):
		if n % i == 0:
			if math.gcd(i, int(n / i)) == 1:
				return f'{i} {int(n / i)}'
	return f'{1} {n}'
n = int(input())
print(function(n))


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
a = int(input())
b = int(a ** (1 / 2))
for i in range(b, 0, -1):
	if a % i == 0:
		lcm = a // gcd(i, a // i)
		if lcm == a:
			print(i, a // i)
			break


from math import gcd

def lcm(a, b):
	return a * b // gcd(a, b)
x = int(input())
i = 1
a = 1
while i * i <= x:
	if x % i == 0 and lcm(i, x // i) == x:
		a = i
	i += 1
print(a, x // a)


from math import gcd

def div_list(num):
	div = []
	for i in range(1, 1 + int(num ** 0.5)):
		if num % i == 0:
			div.append(i)
			div.append(num // i)
	return sorted(div)
X = int(input())
d = div_list(X)
l = len(d)
for (i, j) in zip(range(l // 2 - 1, -1, -1), range(l // 2, l)):
	if gcd(d[i], d[j]) == 1:
		print(d[i], d[j])
		break


import math
a = int(input())
b = int(a ** 0.5)
if a == 1:
	print(1, 1)
else:
	while b > 0:
		if a % b == 0 and float(a / b) != float(b) and (math.gcd(b, a // b) == 1):
			print(b, a // b)
			break
		b -= 1


import math

def LCM(a, b):
	return abs(a * b) // math.gcd(a, b)

def operator(t):
	min_ = math.inf
	val = math.floor(t ** 0.5)
	for i in range(val, 0, -1):
		(a, b) = divmod(t, i)
		if b == 0:
			if t == LCM(a, i) and min_ > max(i, a):
				return ' '.join(map(str, [i, a]))
t = int(input())
print(operator(t))


from math import gcd, floor, sqrt

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

def prim(a):
	k = int(1000000000000.0)
	k1 = k
	for i in range(2, floor(sqrt(a)) + 1):
		if a % i == 0 and lcm(a, i, a // i) and (max(k, k1) > max(i, a // i)):
			k = i
			k1 = a // i
	if k == int(1000000000000.0) == k1:
		print(1, a)
	else:
		print(k, k1)
prim(int(input()))


import math
t = int(input())
i = 1
ans = t
while i ** 2 < t:
	if int(t % i) == 0 and int(math.gcd(i, t // i)) == 1:
		ans = i
	i += 1
print(str(ans) + ' ' + str(t // ans))


def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
n = int(input())
ans = [1, n]
for i in range(int(n ** 0.5) + 1, 0, -1):
	if n % i == 0:
		if gcd(n // i, i) == 1:
			ans = sorted([n // i, i])
			break
print(*ans)


import math

def fadi_and_lcm(x):
	minn = [1, x]
	for i in range(2, math.ceil(math.sqrt(x))):
		if x % i == 0:
			if lcm(i, x // i) == x:
				if max(i, x // i) < max(minn[0], minn[1]):
					minn = [i, x // i]
	return str(minn[0]) + ' ' + str(minn[1])

def gcd(num1, num2):
	if num1 == 0:
		return num2
	return gcd(num2 % num1, num1)

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

def main():
	num = input()
	print(fadi_and_lcm(int(num)))
main()


def f(num1, num2, i):
	global a1, a2
	if i == len(ar):
		if max(num1, num2) < max(a1, a2):
			(a1, a2) = (num1, num2)
		return
	kek = ar[i]
	lol = 1
	while i < len(ar) and ar[i] == kek:
		i += 1
		lol *= kek
	f(num1 * lol, num2, i)
	f(num1, num2 * lol, i)
x = int(input())
ar = []
i = 2
while i * i <= x:
	if x % i == 0:
		x //= i
		ar.append(i)
	else:
		i += 1
ar.append(x)
(a1, a2) = (10 ** 12, 10 ** 12)
f(1, 1, 0)
print(a1, a2)


import sys

def fastio():
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()

def debug(*var, sep=' ', end='\n'):
	print(*var, file=sys.stderr, end=end, sep=sep)
INF = 10 ** 20
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import gcd
from math import ceil
from collections import defaultdict as dd, Counter
from bisect import bisect_left as bl, bisect_right as br
M = 1000010
(x,) = I()
fac = dd(int)
primes = []
p = [1] * M
temp = x
for i in range(2, M):
	if not p[i]:
		continue
	for j in range(2 * i, M, i):
		p[j] = 0
	primes.append(i)
f = True
for i in primes:
	if x % i:
		continue
	fac[i] = 0
	while x % i == 0:
		fac[i] += 1
		x //= i
	f = False
fac[x] += 1
fac[temp // x] += 1
ok = []
for i in fac:
	ok.append(i ** fac[i])
ans = INF
k = len(ok)
for i in range(1, 2 ** k):
	cur = 1
	for j in range(k):
		if i >> j & 1:
			cur *= ok[j]
	ta = cur
	if temp % ta:
		continue
	tb = temp // ta
	if max(ta, tb) < ans:
		ans = max(ta, tb)
		a = ta
		b = tb
print(a, b)


X = int(input())
Xo = X
factor = []
test = 2
while test * test <= X:
	curr = 0
	while X % test == 0:
		X //= test
		curr += 1
	if curr > 0:
		factor.append(pow(test, curr))
	test += 1
if X > 1:
	factor.append(X)
X = Xo
poss = [1]
for fact in factor:
	for v in poss[:]:
		if fact * v * fact * v <= X:
			poss.append(fact * v)
best = max(poss)
print(best, X // best)


import math

def factorize(n):
	result = []
	for i in [2, 3, 5]:
		t = 1
		while n % i == 0:
			t *= i
			n //= i
		if t > 1:
			result.append(t)
	increments = [4, 2, 4, 2, 4, 6, 2, 6]
	d = 7
	inc = 0
	while d * d <= n:
		t = 1
		while n % d == 0:
			t *= d
			n //= d
		if t > 1:
			result.append(t)
		d += increments[inc]
		inc += 1
		if inc == 8:
			inc = 0
	if n > 1:
		result.append(n)
	return result

def recurse(i, a, b, divisors):
	if i == len(divisors):
		return max(a, b)
	return min(recurse(i + 1, a * divisors[i], b, divisors), recurse(i + 1, a, b * divisors[i], divisors))
n = int(input())
div = factorize(n)
res = recurse(0, 1, 1, div)
print(res, n // res)


import math

def intinputlist():
	l = [int(x) for x in input().split()]
	return l

def printlist(l):
	print(*l)

def power(x, y, p):
	res = 1
	x = x % p
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

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

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

def divisorsof(n):
	l = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n / i)
		i = i + 1
	return l
x = int(input())
div = divisorsof(x)
d1 = x
d2 = 1
for i in range(len(div)):
	if lcm(div[i], x / div[i]) == x and max(div[i], x / div[i]) < max(d1, d2):
		d1 = div[i]
		d2 = x / div[i]
print(int(d1), int(d2))


import sys

def mcd(p, q):
	if p % q == 0:
		return q
	return mcd(q, p % q)

def mcm(a, b):
	return a // mcd(a, b) * b
a = int(sys.stdin.readline())
if a == 1:
	print(1, 1)
else:
	ans = 0
	i = 1
	while i * i <= a:
		if a % i == 0 and mcm(i, a // i) == a:
			ans = i
		i += 1
	print(ans, a // ans)


x = int(input())
pri = []
i = 2
xx = x
while xx > 1 and i ** 2 <= x:
	if xx % i == 0:
		xx //= i
		pri.append(i)
	else:
		i += 1
if xx > 1:
	pri.append(xx)
d = {}
for i in pri:
	d[i] = 0
for i in pri:
	d[i] += 1
best = 1
nn = []
for i in d:
	nn.append(i ** d[i])
for i in range(2 ** len(d)):
	kan = 1
	dupa = []
	for j in range(len(nn)):
		dupa.append(i % 2)
		if i % 2 == 1:
			kan *= nn[j]
		i //= 2
	if kan ** 2 <= x and kan > best:
		best = kan
print(best, x // best)


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

def lcm(a, b):
	return a * b // gcd(a, b)
n = int(input())
fact = []
for i in range(1, int(n ** 0.5) + 2):
	if n % i == 0:
		if i ** 2 == n:
			fact.append(i)
		else:
			fact.append(i)
			fact.append(n // i)
fact.sort()
if n == 1:
	print('1 1')
elif len(fact) % 2 == 0:
	i = len(fact) // 2 - 1
	j = len(fact) // 2
	while True:
		if lcm(fact[i], fact[j]) == n:
			print(fact[i], fact[j])
			break
		else:
			i -= 1
			j += 1
else:
	i = len(fact) // 2 - 1
	j = len(fact) // 2 + 1
	while True:
		if lcm(fact[i], fact[j]) == n:
			print(fact[i], fact[j])
			break
		else:
			i -= 1
			j += 1


def NOD(a, b):
	while b != 0:
		(a, b) = (b, a % b)
	return a
x = int(input())
Min = 10 ** 12
for i in range(2, int(x ** 0.5) + 2):
	if i * (x // i) // NOD(i, x // i) == x:
		Max = max(i, x // i)
		if Max < Min:
			Min = Max
if Min == 10 ** 12:
	Min = x
print(x // Min, Min)


from itertools import compress, islice, cycle, count

def croft():
	for p in (2, 3, 5):
		yield p
	roots = {9: 3, 25: 5}
	primeroots = frozenset((1, 7, 11, 13, 17, 19, 23, 29))
	selectors = (1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0)
	for q in compress(islice(count(7), 0, None, 2), cycle(selectors)):
		if q in roots:
			p = roots[q]
			del roots[q]
			x = q + 2 * p
			while x in roots or x % 30 not in primeroots:
				x += 2 * p
			roots[x] = p
		else:
			roots[q * q] = q
			yield q
primes = croft

def decompose(n):
	for p in primes():
		if p * p > n:
			break
		if n % p == 0:
			t = 1
			while n % p == 0:
				t *= p
				n //= p
			yield t
	if n > 1:
		yield n

def brute(a, b, x, i):
	if i < len(x):
		u = brute(a * x[i], b, x, i + 1)
		v = brute(a, b * x[i], x, i + 1)
		return u if max(u) < max(v) else v
	else:
		return (a, b)
n = int(input())
print(*brute(1, 1, [v for v in decompose(n)], 0))


import math

def lcm(x, y):
	return x * y // math.gcd(x, y)

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
from functools import reduce
n = int(input())
if isPrime(n):
	print(1, n)
else:
	s = list(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
	t = len(s)
	s.sort()
	for i in range(int(t / 2)):
		if lcm(s[int(t / 2) - i - 1], s[int(t / 2) + i]) == n:
			print(s[int(t / 2) - i - 1], s[int(t / 2) + i])
			break


import math

def get_primes(X):
	primes = []
	num = 2
	while num * num <= X:
		num_pow = 0
		while X % num == 0:
			X //= num
			num_pow += 1
		if num_pow:
			primes.append((num, num_pow))
		num += 1
	if X:
		primes.append((X, 1))
	return primes
pair = (math.inf, math.inf)
X = int(input())
primes = get_primes(X)

def backtrack(idx, num1, num2):
	global pair
	if idx >= len(primes):
		if num1 * num2 // math.gcd(num1, num2) == X and max(num1, num2) < max(*pair):
			pair = (num1, num2)
		return
	(prime, prime_cnt) = primes[idx]
	for cnt in range(prime_cnt + 1):
		backtrack(idx + 1, num1 * prime ** cnt, num2 * prime ** (prime_cnt - cnt))
backtrack(0, 1, 1)
print('{} {}'.format(*pair))


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


def solve():
	n = int(input())
	if n == 1:
		print(1, 1)
		return
	x = n
	factors = []
	i = 2
	while i * i <= n:
		while n % i == 0:
			factors.append(i)
			n //= i
		i += 1
	if n > 1:
		factors.append(n)
	distFactors = []
	currFactor = factors[0]
	prod = 1
	for f in factors:
		if f == currFactor:
			prod *= f
		else:
			distFactors.append(prod)
			currFactor = f
			prod = f
	distFactors.append(prod)
	n = len(distFactors)
	ans = [x, 1]
	a = [1, 1]

	def backtrack(a, k):
		if k == n:
			if max(a) < max(ans):
				ans[0] = a[0]
				ans[1] = a[1]
		else:
			curr = distFactors[k]
			k += 1
			a[0] *= curr
			backtrack(a, k)
			a[0] //= curr
			a[1] *= curr
			backtrack(a, k)
			a[1] //= curr
		return
	backtrack(a, 0)
	print(ans[0], ans[1])
solve()


t = int(input())
from math import sqrt, floor, ceil, gcd
sq1 = floor(sqrt(t))
while t % sq1 != 0:
	sq1 -= 1
sq2 = t // sq1
while gcd(sq1, sq2) > 1:
	sq1 -= 1
	while t % sq1 != 0:
		sq1 -= 1
	sq2 = t // sq1
print(sq1, sq2)


from functools import reduce
import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def arr():
	return [int(i) for i in input().split()]

def sarr():
	return [int(i) for i in input()]

def starr():
	return [str(x) for x in input().split()]

def inn():
	return int(input())

def svalue():
	return tuple(map(str, input().split()))

def parr():
	return [value() for i in range(n)]
mo = 1000000007

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
n = inn()
a = factors(n)
ln = len(a)
(x, y) = (100000000, 10000000)
mx = 100000000000000
for i in range(ln):
	val = n // a[i]
	res = gcd(a[i], val)
	res = val * a[i] // res
	if res == n:
		if max(val, a[i]) < mx:
			mx = max(val, a[i])
			(x, y) = (a[i], val)
print(x, y)


import math
n = int(input())
ans = n
i = 1
c1 = 1
c2 = n
while i <= math.sqrt(n):
	if n % i == 0:
		if n // i == i:
			t = i * i // math.gcd(i, i)
			if i < ans and t == n:
				ans = min(i, ans)
				c1 = i
				c2 = i
		else:
			t = i * (n // i) // math.gcd(i, n // i)
			if max(i, n // i) < ans and t == n:
				c1 = i
				c2 = n // i
				ans = min(ans, max(i, n // i))
	i += 1
print(c1, c2)


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
from typing import List

def solve(X):
	PX = X
	SX = int(math.sqrt(X))
	MAXN = SX + 1000
	p = [True for _ in range(MAXN)]
	p[0] = p[1] = False
	for i in range(MAXN):
		if p[i]:
			v = i + i
			while v < MAXN:
				p[v] = False
				v += i
	p = [i for i in range(MAXN) if p[i]]
	Y = []
	for u in p:
		if u > X:
			break
		if X % u == 0:
			c = 0
			while X % u == 0:
				c += 1
				X //= u
			Y.append(u ** c)
	if X > 1:
		Y.append(X)
	if not Y:
		return [1, 1]
	if len(Y) == 1:
		return [Y[0], 1]
	q = {1}
	for y in Y:
		q = {v * y for v in q if v * y <= SX} | q
	u = max(q)
	v = PX // u
	return [u, v]
X = int(input())
(a, b) = solve(X)
print('{} {}'.format(a, b))


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

def lcm(a, b):
	return a * b / gcd(a, b)
import math
f = []

def printDivisors(n):
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				f.append(i)
			else:
				f.append(i)
				f.append(n // i)
		i = i + 1
n = int(input())
printDivisors(n)
f.sort()
l = len(f)
if l % 2 == 0:
	s1 = l // 2 - 1
	s2 = l // 2
else:
	s1 = l // 2 - 1
	s2 = l // 2 + 1
if n == 1:
	print('1 1')
else:
	while True:
		if lcm(f[s1], f[s2]) == n:
			print(f[s1], f[s2])
			break
		else:
			s1 -= 1
			s2 += 1


x = int(input())
xx = x
li = []
for i in range(2, x):
	if xx % i == 0:
		cnt = 0
		while xx % i == 0:
			xx //= i
			cnt += 1
		li.append(i ** cnt)
	if xx == 1:
		break
	if i * i > x:
		li.append(xx)
		break
mn = x + 1
for i in range(2 ** len(li)):
	tmp = 1
	for j in range(len(li)):
		if i >> j & 1:
			tmp *= li[j]
	y = max(tmp, x // tmp)
	if y < mn:
		mn = y
		ans = (tmp, x // tmp)
print(*ans)


import math
n = int(input())
i = n ** 0.5
if i % 1 == 0:
	i -= 1
else:
	i = i // 1
if n % 2 == 0:
	k = 1
else:
	k = 2
	if i % 2 == 0:
		i -= 1
if n <= 3:
	i = 1
else:
	while i > 0:
		if n % i == 0:
			if math.gcd(int(i), int(n / i)) != 1:
				i -= k
				continue
			break
		i -= k
print(int(i), int(n / i))


n = int(input())
import math
a = 0
b = float('inf')
for i in range(1, int(math.sqrt(n) + 1)):
	if n % i == 0:
		bb = n // i
		if i * bb / math.gcd(i, bb) == n and abs(bb - i) < abs(a - b):
			a = i
			b = bb
print(a, b)


def gcd(a, b):
	while b != 0:
		a %= b
		k = a
		a = b
		b = k
	return a

def lcm(a, b):
	return a * b / gcd(a, b)
x = int(input())
pairs = []
if x == 1:
	print('1 1')
else:
	a = 1
	while a * a < x:
		if x % a == 0:
			b = x // a
			pairs.append((a, b))
		a += 1
	min = 9999999999999999999999999999
	mp = (0, 0)
	for p in pairs:
		if lcm(p[0], p[1]) == x:
			if p[0] + p[1] < min:
				min = p[0] + p[1]
				mp = p
	print(mp[0], mp[1])


import math

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
x = int(input())
t = int(math.sqrt(x))
for i in range(t, 0, -1):
	if x % i == 0 and gcd(int(x / i), i) == 1:
		a = int(i)
		b = int(x / i)
		break
print(a, b)


import math

def div(n):
	arr = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				arr.append(i)
			else:
				arr.append(i)
				arr.append(n // i)
		i += 1
	return arr

def lcm(a, b):
	return a * b // math.gcd(a, b)
n = int(input())
arr = div(n)
minn = 10 ** 13
a = 1
b = n
for i in range(len(arr)):
	if lcm(arr[i], n // arr[i]) == n:
		if max(arr[i], n // arr[i]) < minn:
			minn = min(max(arr[i], n // arr[i]), minn)
			a = arr[i]
			b = n // arr[i]
print(a, b)


import math
n = int(input())
s = int(math.sqrt(n))
l = []
for i in range(1, s + 1):
	l2 = []
	if n % i == 0:
		l2.append(i)
		l2.append(n // i)
		l.append(l2)
l3 = []
for i in l:
	if i[1] % i[0] != 0:
		l3.append(i)
if len(l3) == 0:
	print(1, n)
else:
	l3.sort(key=lambda x: x[1])
	for i in l3:
		if int(i[0] * i[1] // math.gcd(i[0], i[1])) == n:
			print(*i)
			break


from math import sqrt
from collections import Counter

def poss(i=0, c=1):
	if i == m:
		subs.append(c)
		return
	poss(i + 1, c)
	poss(i + 1, c * a[i])

def facts(x):
	while x % 2 == 0:
		l.append(2)
		x //= 2
	for i in range(3, int(sqrt(x)) + 1, 2):
		while x % i == 0:
			l.append(i)
			x //= i
	if x > 1:
		l.append(x)
l = []
subs = []
x = int(input())
facts(x)
c = Counter(l)
a = sorted((i ** c[i] for i in c.keys()))
l = r = 1
for i in a:
	r *= i
i = 0
cm = r
m = len(a)
poss()
l = min(subs, key=lambda y: max(y, x // y))
r = x // l
if l > r:
	(l, r) = (r, l)
print(l, r)


import math

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
n = int(input())
q = math.sqrt(n)
i = int(q)
while i > 0:
	if n % i == 0 and gcd(i, n // i) == 1:
		print(i, n // i)
		break
	i -= 1


import math
n = int(input())
for j in range(int(n ** 0.5), 0, -1):
	if n % j == 0:
		if math.gcd(j, n // j) == 1:
			break
print(j, n // j)


import math
n = int(input())

def primeFactors(n):
	ans = []
	fac = 1
	while n % 2 == 0:
		n = n // 2
		fac *= 2
	if fac != 1:
		ans.append(fac)
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		fac = 1
		while n % i == 0:
			n = n // i
			fac *= i
		if fac != 1:
			ans.append(fac)
	if n > 2:
		ans.append(n)
	return ans

def dfs(prod, ind):
	global ma
	if prod > li:
		return
	ma = max(ma, prod)
	if ind == len(ans):
		return
	dfs(prod * ans[ind], ind + 1)
	dfs(prod, ind + 1)
ans = primeFactors(n)
li = math.floor(math.sqrt(n))
ma = 1
dfs(1, 0)
print(ma, n // ma)


import sys
input = sys.stdin.readline
import math

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)
t = int(input())
m = 1000000000000
tup = []
for i in range(1, int(t ** 0.5) + 1):
	if t % i == 0:
		j = t // i
		if gcd(i, j) == 1:
			if m > max(i, j):
				tup = [i, j]
				m = max(i, j)
print(tup[0], tup[1])


from math import gcd

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

def solve():
	x = int(input())
	(ansx, ansy) = (1, x)
	for i in range(1, int(x ** 0.5) + 1):
		if x % i == 0:
			if l(i, x // i) == x:
				if max(i, x // i) < max(ansx, ansy):
					(ansx, ansy) = (i, x // i)
	print(ansx, ansy)
solve()


import math

def divisors(n):
	i = 1
	l = list()
	while i <= math.sqrt(n):
		if n % i == 0:
			l.append(i)
		i = i + 1
	return l

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

def lcm(a, b):
	return a * b / gcd(a, b)
n = int(input())
div = divisors(n)
for i in range(len(div) - 1, -1, -1):
	if lcm(div[i], n // div[i]) == n:
		print(str(div[i]) + ' ' + str(n // div[i]))
		break


import sys

def hcf(a, b):
	while b != 0:
		(a, b) = (b, a % b)
	return a

def lcm(a, b):
	return a * b // hcf(a, b)
X = int(sys.stdin.readline())
if X == 1:
	print(1, 1)
else:
	i = 2
	mini = X
	ans = [1, X]
	while i * i <= X:
		if X % i == 0:
			if i != X // i and lcm(i, X // i) == X:
				val = max(i, X // i)
				if val < mini:
					mini = val
					ans[0] = i
					ans[1] = X // i
		i += 1
	print(ans[0], ans[1])


from math import sqrt
from math import inf

def sub(n):
	b = 0
	barr = []
	while b < 1 << n:
		arr = [0] * n
		for i in range(n):
			if b & 1 << i:
				arr[i] = 1
		barr += [arr]
		b += 1
	return barr

def pf(n):
	if n == 1:
		return [1]
	arr = []
	x = 1
	if n % 2 == 0:
		while n % 2 == 0:
			n = n // 2
			x = x * 2
		arr += [x]
	for i in range(3, int(sqrt(n)) + 1, 2):
		x = 1
		if n % i == 0:
			while n % i == 0:
				n = n // i
				x = x * i
			arr += [x]
	if n != 1:
		arr += [n]
	return arr
x = int(input())
parr = pf(x)
n = len(parr)
mini = inf
barr = sub(n)
sol = []
for i in range(len(barr)):
	a = 1
	b = 1
	for j in range(n):
		if barr[i][j] == 0:
			a = a * parr[j]
		else:
			b = b * parr[j]
	m = max(a, b)
	if m < mini:
		mini = m
		sol = [a, b]
print(sol[0], sol[1])


from math import *
x = int(input())
fac = []
for i in range(1, int(pow(x, 0.5)) + 1):
	if x % i == 0:
		fac.append(i)
		fac.append(x // i)
res = [float('inf'), float('inf')]
for i in fac:
	y = gcd(i, x // i)
	if x // i * i // y == x:
		if min(x // i, i) <= max(res):
			res = [i, x // i]
print(*res)


import fractions
import functools
import itertools
import math
import operator
import random

def try_composite(a, d, n, s):
	if pow(a, d, n) == 1:
		return False
	for i in range(s):
		if pow(a, 2 ** i * d, n) == n - 1:
			return False
	return True

def is_prime(n, precision_for_huge_n=16):
	if n in known_primes:
		return True
	if any((n % p == 0 for p in known_primes)) or n in (0, 1):
		return False
	(d, s) = (n - 1, 0)
	while not d % 2:
		(d, s) = (d >> 1, s + 1)
	if n < 1373653:
		return not any((try_composite(a, d, n, s) for a in (2, 3)))
	if n < 25326001:
		return not any((try_composite(a, d, n, s) for a in (2, 3, 5)))
	if n < 118670087467:
		if n == 3215031751:
			return False
		return not any((try_composite(a, d, n, s) for a in (2, 3, 5, 7)))
	if n < 2152302898747:
		return not any((try_composite(a, d, n, s) for a in (2, 3, 5, 7, 11)))
	if n < 3474749660383:
		return not any((try_composite(a, d, n, s) for a in (2, 3, 5, 7, 11, 13)))
	if n < 341550071728321:
		return not any((try_composite(a, d, n, s) for a in (2, 3, 5, 7, 11, 13, 17)))
	return not any((try_composite(a, d, n, s) for a in known_primes[:precision_for_huge_n]))
known_primes = [2, 3]
known_primes += [x for x in range(5, 1000, 2) if is_prime(x)]

def brent(n):
	if n % 2 == 0:
		return 2
	(y, c, m) = (random.randint(1, n - 1), random.randint(1, n - 1), random.randint(1, n - 1))
	(g, r, q) = (1, 1, 1)
	while g == 1:
		x = y
		for i in range(r):
			y = (y * y % n + c) % n
		k = 0
		while k < r and g == 1:
			ys = y
			for i in range(min(m, r - k)):
				y = (y * y % n + c) % n
				q = q * abs(x - y) % n
			g = fractions.gcd(q, n)
			k = k + m
		r = r * 2
	if g == n:
		while True:
			ys = (ys * ys % n + c) % n
			g = fractions.gcd(abs(x - ys), n)
			if g > 1:
				break
	return g

def factorint(n):
	if n == 1:
		return {1: 1}
	f = {}
	s = [n]
	while s:
		n = s[-1]
		d = brent(n)
		if d == 1 or d == n:
			if is_prime(n):
				s.pop()
				f[n] = f.get(n, 0) + 1
		else:
			s.pop()
			s.append(n // d)
			s.append(d)
	return f
X = int(input())
Xf = factorint(X)
divisor = lambda s: functools.reduce(operator.mul, (list(Xf.keys())[i] ** list(Xf.values())[i] for i in s), 1)
subsets = lambda : itertools.chain.from_iterable((itertools.combinations(range(len(Xf)), ni) for ni in range(len(Xf) + 1)))
b = min((d for d in (divisor(s) for s in subsets()) if d >= X ** 0.5))
print('%d %d' % (X // b, b))


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

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

def printDivisors(n):
	factor = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				factor.append(i)
			else:
				factor.append(i)
				factor.append(n // i)
		i = i + 1
	return factor
n = int(input())
factor = printDivisors(n)
factor.sort()
lau = len(factor)
if lau % 2 == 0:
	shh1 = lau // 2 - 1
	shh2 = lau // 2
else:
	shh1 = lau // 2 - 1
	shh2 = lau // 2 + 1
if n == 1:
	print('1 1')
else:
	while True:
		if lcm(factor[shh1], factor[shh2]) == n:
			print(factor[shh1], factor[shh2])
			break
		else:
			shh1 -= 1
			shh2 += 1


def getbit(n, k):
	return (n & 1 << k) >> k
x = int(input())
a = []
for i in range(2, int(x ** 0.5) + 2):
	if x % i == 0:
		c = 0
		while x % i == 0:
			x //= i
			c += 1
		a.append(i ** c)
if x != 1:
	a.append(x)
ans = [21674627468627481, 0]
for mask in range(1 << len(a)):
	n1 = 1
	n2 = 1
	for i in range(len(a)):
		if getbit(mask, i):
			n1 *= a[i]
		else:
			n2 *= a[i]
	if max(ans) > max(n1, n2):
		ans = [n1, n2]
print(*ans)


def gcd(x, y):
	if y == 0:
		return x
	else:
		return gcd(y, x % y)
x = int(input())
ans = 1
for i in range(1, int(pow(x, 0.5) + 1)):
	if x % i == 0 and gcd(i, x / i) == 1:
		ans = i
print(ans, int(x / ans))


def phantichsonguyento(n):
	result = []
	for i in range(2, n):
		dem = 0
		while True:
			if n % i != 0:
				break
			else:
				dem += 1
				n //= i
		if dem:
			if dem > 1:
				for j in range(dem):
					result.append(i)
			else:
				result.append(i)
	return result
from math import *
n = int(input().strip())
for i in range(int(sqrt(n)), 0, -1):
	if n % i == 0 and gcd(n // i, i) == 1:
		print(i, n // i)
		break


n = int(input())
from math import *
maxi = n
for i in range(1, int(sqrt(n)) + 1):
	if n % i == 0:
		if gcd(i, n // i) == 1:
			maxi = min(maxi, n // i)
print(maxi, n // maxi)


import sys, math
input = sys.stdin.readline

def inp():
	return int(input())

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

def insr():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())
t = 1
for tt in range(t):
	n = inp()
	a = []
	for i in range(1, math.ceil(n ** (1 / 2))):
		if n % i == 0:
			a.append(i)
	a.reverse()
	for i in range(len(a)):
		if math.gcd(a[i], n // a[i]) == 1:
			print(a[i], n // a[i])
			break
	if n == 1:
		print(1, 1)


from sys import stdin, stdout
import math

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

def lcm(a, b):
	return a / gcd(a, b) * b
input = stdin.readline
t = 1
for _ in range(t):
	x = int(input())
	m = float('inf')
	a = 1
	b = x
	for i in range(1, int(math.sqrt(x)) + 2):
		if x % i == 0:
			if max(i, x // i) < m and lcm(i, x // i) == x:
				m = max(i, x // i)
				a = i
				b = x // i
	print(a, b)


import math

def answer(n):
	if n == 1:
		return [1, 1]
	if n == 2:
		return [1, 2]
	if n == 3:
		return [1, 3]
	i = int(math.sqrt(n)) + 1
	while i > 0:
		if n % i == 0:
			if math.gcd(i, n // i) == 1:
				return [i, n // i]
		i -= 1
	return

def main():
	X = int(input())
	print(' '.join(map(str, answer(X))))
	return
main()


import math
m = int(input())
n = int(math.sqrt(m))
l = []
for i in range(1, n + 1):
	if m % i == 0:
		tmp = m // i
		if math.gcd(tmp, i) == 1:
			l.append((i, tmp))
l.reverse()
print('{} {}'.format(l[0][0], l[0][1]))


from fractions import gcd
import math
N = int(input())
ans = 10 ** 16
for n in range(1, int(math.sqrt(N)) + 2):
	if N % n == 0:
		b = N // n
		if gcd(b, n) == 1 and max(b, n) < ans:
			ans = max(b, n)
			a1 = b
			a2 = n
print(a2, a1)


from collections import Counter
from collections import defaultdict
import math
from sys import maxsize
n = int(input())
f = 0
for i in range(int(pow(n, 0.5)), 0, -1):
	if n % i == 0 and math.gcd(n // i, i) == 1:
		print(n // i, i)
		f = 1
		break
if f == 0:
	print(1, n)


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


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

def lcm(a, b):
	return a * b / gcd(a, b)
n = int(input())
a = 10 ** 26
b = 10 ** 26
i = 1
while i * i <= n:
	if n % i == 0:
		if lcm(i, n / i) == n:
			if max(a, b) > max(i, n // i):
				a = i
				b = n // i
	i = i + 1
print(min(a, b), end=' ')
print(max(a, b))


def gcd(n, m):
	if m == 0:
		return n
	else:
		return gcd(m, n % m)

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


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


def gcd(x, y):
	while y != 0:
		(x, y) = (y, x % y)
	return x
from math import sqrt
x = int(input())
n = sqrt(x)
a = 1
b = x
for i in range(1, int(n + 1)):
	if x % i == 0:
		c = x // i
		if gcd(c, i) == 1:
			if c % i:
				a = i
				b = c
print(int(a), int(b))


import math
x = int(input())
c = 100000000000001
l = []
for i in range(2, int(math.sqrt(x)) + 1):
	if x % i == 0:
		k = x // i * i // math.gcd(x // i, i)
		if k == x:
			if max(x // i, i) <= c:
				c = min(c, max(i, x // i))
				l = [i, x // i]
if len(l) == 0:
	l.append(1)
	l.append(x)
print(*l)


import math
n = int(input())
(a, b) = (n, n)
x = math.floor(math.sqrt(n))
for i in range(2, x + 1):
	if n % i == 0:
		c = i
		d = n // i
		if math.gcd(c, d) == 1 and max(c, d) < max(a, b):
			(a, b) = (c, d)
print(a, b)


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
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 value():
	return map(int, input().split())

def array():
	return [int(i) for i in input().split()]

def calc(a, b):
	if max(a, b) % min(a, b) == 0:
		return False
	for i in range(2, int(sqrt(min(a, b))) + 1):
		if a % i == 0 and b % i == 0:
			return False
	return True
n = int(input())
ans = [1, n]
for i in range(2, int(sqrt(n)) + 1):
	if n % i == 0 and calc(i, n // i):
		if max(i, n // i) < max(ans):
			ans = [i, n // i]
print(*ans)


import math
for _ in range(1):
	n = int(input())
	i = 1
	while i * i <= n:
		if n % i == 0 and math.gcd(i, n // i) == 1:
			ans = i
		i += 1
	print(ans, n // ans)


n = int(input())
i = 1
from math import gcd
l = [1, n]
t = n
while i * i <= n:
	if n % i == 0 and gcd(i, n // i) == 1:
		temp = max(i, n // i)
		if temp < t:
			t = temp
			l = [i, n // i]
	i += 1
print(*l)


import sys
import math
import itertools
import functools
import collections
import operator

def ii():
	return int(input())

def mi():
	return map(int, input().split())

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

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

def wr(arr):
	return ' '.join(map(str, arr))

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)
x = ii()
d = divs(x)
d.sort()
dl = len(d)
ans = x
for i in range(dl // 2):
	if x % d[i] == 0 and lcm(d[i], x // d[i]) == x:
		ans = d[i]
print(ans, x // ans)


def gcd(a, b):
	if a < b:
		(a, b) = (b, a)
	r = a % b
	if r == 0:
		return b
	else:
		return gcd(b, r)
n = int(input())
(a, b, m) = (1, n, n)
for i in range(1, n):
	if i * i >= n:
		break
	if n % i == 0:
		x = i
		y = n // i
		k = max([x, y])
		if gcd(x, y) == 1 and k <= m:
			(a, b, m) = (x, y, k)
print('{} {}'.format(a, b))


import math
from itertools import combinations
n = int(input())
a = 1
b = n
maxi = n
temp = n
l = []
count = 1
while n % 2 == 0:
	n = n // 2
	count *= 2
if count != 1:
	l.append(count)
for j in range(3, int(math.sqrt(n)) + 1, 2):
	count = 1
	while n % j == 0:
		n = n // j
		count = count * j
	if count != 1:
		l.append(count)
if n > 2:
	l.append(n)
for i in range(1, len(l)):
	x = combinations(l, i)
	for k in x:
		val = 1
		for j in k:
			val *= j
		if max(val, temp // val) < maxi:
			maxi = max(val, temp // val)
			a = val
			b = temp // val
print(a, b)


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

def nok(a, b):
	return a * b // gcd(a, b)
n = int(input())
p = 1
while p * p <= n:
	if n % p == 0 and nok(n // p, p) == n:
		m = p
	p += 1
print(m, n // m)


x = int(input())
from math import gcd
n = 1
res = 1
while n * n <= x:
	if x % n == 0 and gcd(n, x // n) == 1:
		res = n
	n += 1
print(res, x // res)


import math as mt
n = int(input())
x = int(n ** 0.5)
for i in range(x, 0, -1):
	if n % i == 0 and mt.gcd(i, n // i) == 1:
		print(i, n // i)
		break


import math

def check(mx1, mx2):
	for i in range(2, int(math.sqrt(mx1)) + 1):
		if mx1 % i == 0 and (mx2 % i == 0 or mx2 % (mx1 // i) == 0):
			return False
	if mx2 % mx1 == 0:
		return False
	return True

def main():
	x = int(input())
	(mx11, mx21) = (1, x)
	for i in range(2, int(math.sqrt(x)) + 3):
		if x % i == 0:
			(mx1, mx2) = (i, x // i)
			if check(mx1, mx2):
				(mx11, mx21) = (mx1, mx2)
	print(mx11, mx21)
t = 1
for i in range(t):
	main()


import math
(n, Min) = (int(input()), 10000000000000000000000000000000)
luu = [0, 0]
for i in range(1, int(n ** 0.5) + 1):
	if n % i == 0 and i * (n // i) // math.gcd(i, n // i) == n and (Min > max(i, n // i)):
		luu = [i, n // i]
print(luu[0], luu[1])


import math
n = int(input())
mu = int(math.sqrt(n))
if n == 1:
	print('1 1')
else:
	for i in range(mu, 0, -1):
		if n % i == 0:
			if n // i == i:
				continue
			if i * (n // i) // math.gcd(i, n // i) != n:
				continue
			print(n // i, i)
			break


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

def fadi(n):
	for i in range(int(n ** (1 / 2)), 1, -1):
		if n % i == 0:
			if gcd(n // i, i) == 1:
				print(n // i, i)
				return
	else:
		print(1, n)
		return
t = int(input())
fadi(t)


INF = 10 ** 10

def main():
	n = get_int()
	for x in range(int(n ** 0.5), 0, -1):
		if n % x == 0 and math.gcd(x, n // x) == 1:
			print(x, n // x)
			return
import sys
import math
out = []
get_int = lambda : int(input())
get_list = lambda : list(map(int, input().split()))
main()


import sys
from collections import Counter
input = sys.stdin.readline

def prime_factor(n):
	factors = []
	f = 2
	while n % 2 == 0:
		factors.append(f)
		n //= f
	f = 3
	while f * f <= n:
		if n % f == 0:
			factors.append(f)
			n //= f
		else:
			f += 2
	if n != 1:
		factors.append(n)
	return factors
n = int(input())
factor = prime_factor(n)
L = Counter(factor)
nf = []
for i in L:
	nf.append(pow(i, L[i]))
poss = [1]
for fact in nf:
	for v in poss[:]:
		if fact * v * fact * v <= n:
			poss.append(fact * v)
best = max(poss)
print(best, n // best)


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

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

def divisor(x):
	divisors = []
	for i in range(1, int(x ** 0.5) + 1):
		if x % i == 0:
			divisors.append(i)
			if i != x / i:
				divisors.append(x / i)
	return divisors
n = int(input())
x = divisor(n)
r = 0
for i in x:
	if lcm(i, int(n / i)) == n:
		r = i
print(int(r), int(n // r))


import math
x = int(input())
mina = 10 ** 13
a = -1
b = -1

def gcd(a, b):
	if a == 0:
		return b
	else:
		return gcd(b % a, a)
for i in range(1, int(math.sqrt(x)) + 2):
	if x % i == 0:
		if gcd(i, x // i) == 1:
			if max(i, x // i) < mina:
				mina = max(i, x // i)
				a = i
				b = x // i
print(a, end=' ')
print(b)


def solve():
	n = int(input())
	if n == 1:
		print(1, 1)
		return
	x = n
	factors = []
	i = 2
	while i * i <= n:
		if n % i == 0:
			cur = 1
			while n % i == 0:
				n //= i
				cur *= i
			factors.append(cur)
		i += 1
	if n > 1:
		factors.append(n)
	n = len(factors)
	ans = [x, 1]
	a = [1, 1]

	def backtrack(a, k):
		if k == n:
			if max(a) < max(ans):
				ans[0] = a[0]
				ans[1] = a[1]
		else:
			curr = factors[k]
			k += 1
			a[0] *= curr
			backtrack(a, k)
			a[0] //= curr
			a[1] *= curr
			backtrack(a, k)
			a[1] //= curr
		return
	backtrack(a, 0)
	print(ans[0], ans[1])
solve()


import math
x = int(input())
max = -1
i = 2
b = math.sqrt(x)
while i <= b:
	if x % i == 0 and math.gcd(i, x // i) == 1:
		max = i
	i += 1
if max == -1:
	print(1, x)
else:
	print(max, x // max)


N = int(input())
M = N
A = []
flag = True
while flag == True:
	flag = False
	for i in range(2, int(N ** 0.5) + 1):
		if N % i == 0:
			hoge = i
			while N % hoge == 0:
				hoge *= i
			A.append(hoge // i)
			N //= hoge // i
			flag = True
			break
A.append(N)
ans = M
for i in range(2 ** len(A)):
	hoge = 1
	for j in range(len(A)):
		if i & 1 == 1:
			hoge *= A[j]
		i >>= 1
	ans = min(ans, max(M // hoge, hoge))
print(ans, M // ans)


import math
x = int(input())
j = math.ceil(x ** 0.5)
while j >= 1:
	if x % j == 0:
		p = x // j
		if math.gcd(j, p) == 1:
			print(j, p)
			break
	j += -1


import math

def coprime(a, b):
	ok = True
	if b % a == 0:
		ok = False
	else:
		for i in range(2, int(math.sqrt(a)) + 1):
			if b % i == 0:
				ok = False
				break
	return ok

def facts(n):
	ans = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			ans.append(i)
			ans.append(n // i)
	ans = sorted(ans)
	return ans
x = int(input())
fs = facts(x)
(pnt1, pnt2) = (len(fs) // 2 - 1, len(fs) // 2)
(a, b) = (0, 0)
while pnt1 > 0:
	if math.gcd(fs[pnt1], fs[pnt2]) == 1:
		(a, b) = (fs[pnt1], fs[pnt2])
		break
	pnt1 -= 1
	pnt2 += 1
if a == 0 and b == 0:
	print(1, x)
else:
	print(a, b)


def make_prime_factors_distinct(n):
	prime_factors = []
	for k in range(2, int(n ** 0.5) + 1):
		if n % k == 0:
			prime_factors.append(k)
			while n % k == 0:
				n = n // k
	if n != 1:
		prime_factors.append(n)
	return prime_factors
x = int(input())
prime_li = make_prime_factors_distinct(x)
a = [0] * len(prime_li)
for i in range(len(prime_li)):
	num = 1
	while True:
		if x % prime_li[i] ** num != 0:
			break
		num += 1
	num -= 1
	a[i] = prime_li[i] ** num
ans = 10 ** 18
for bit_state in range(1 << len(prime_li)):
	tmp = 1
	for i in range(len(prime_li)):
		if bit_state & 1 << i:
			tmp *= a[i]
	if ans > max(tmp, x // tmp):
		ans = max(tmp, x // tmp)
		res = (tmp, x // tmp)
print(*res)


from math import sqrt

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
x = int(input())
x1 = int(sqrt(x))
for i in range(x1, 0, -1):
	if x % i == 0:
		a = i
		b = x // i
		if a * b // gcd(a, b) == x:
			print(a, b)
			break


import sys
from math import gcd

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())

def solve():
	X = mint()
	r = (max(1, X), 1, X)
	for i in range(1, X + 1):
		if i * i > X:
			break
		if X % i == 0:
			v = X // i
			if gcd(i, v) == 1:
				r = min(r, (max(i, v), i, v))
	print(*r[1:])
solve()


def get_bit(val, id):
	return val >> id & 1
X = int(input())
tmp = X
val = []
for i in range(2, 1000001):
	num = 1
	while X % i == 0:
		X /= i
		num *= i
	if num > 1:
		val.append(num)
if X > 1:
	val.append(X)
resA = 10 ** 12
resB = 10 ** 12
n = len(val)
for state in range(0, 1 << n):
	A = 1
	B = 1
	for i in range(0, n):
		if get_bit(state, i) == 0:
			A *= val[i]
		else:
			B *= val[i]
	if max(A, B) < max(resA, resB):
		resA = A
		resB = B
print(int(resA), int(resB))


import math
X = int(input())
ans = X
ans_p = (1, X)
for n in range(1, int(X ** 0.5 + 1)):
	if X % n == 0:
		vl = math.gcd(n, X // n)
		if vl == 1:
			mx = max(n, X // n)
			mn = min(n, X // n)
			if mx < ans:
				ans = mx
				ans_p = (mn, mx)
print(*ans_p)


import math

def LCM(n1, n2):
	return n1 * n2 // math.gcd(n1, n2)
x = int(input())
(a, b) = (-1, -1)
for i in range(1, int(x ** 0.5) + 1):
	if x % i == 0:
		if LCM(i, x // i) == x:
			(a, b) = (i, x // i)
print(a, b)


def fun(n, m):
	if n % m == 0:
		return m
	else:
		return fun(m, n % m)
n = int(input())
l = int(n ** 0.5)
for i in range(l, -1, -1):
	if n % i == 0 and fun(i, n // i) == 1:
		break
print(i, n // i)


import math

def lcm(a, b):
	a = int(a)
	b = int(b)
	return a * b / math.gcd(a, b)

def fun(n):
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0 and lcm(i, n / i) == n:
			ans = i
	return ans
n = int(input())
ans = fun(n)
print(ans, n // ans)


n = int(input())
if n == 1:
	print(1, end=' ')
	print(1)
else:
	arr = []
	now = n
	for j in range(2, int(pow(n, 0.5)) + 1):
		if n % j == 0:
			k = 1
			while n % j == 0:
				n = n // j
				k *= j
			arr.append(k)
	if n != 1:
		arr.append(n)
	ans = 9999999999999999
	ans_1 = -1
	ans_2 = -1
	if len(arr) == 1:
		print(1, end=' ')
		print(now)
	else:
		a = 1 << len(arr) - 1
		while a > 0:
			p = 1
			q = 1
			k = a
			l = len(arr) - 1
			while k >= 0:
				if k & 1:
					p *= arr[l]
					l -= 1
				else:
					q *= arr[l]
					l -= 1
				if l == -1:
					break
				k = k >> 1
			z = max(p, q)
			if ans > z:
				ans = z
				ans_1 = p
				ans_2 = q
			a -= 1
		print(ans_1, end=' ')
		print(ans_2)


import math
x = int(input())
for i in range(int(math.sqrt(x)), 0, -1):
	if x % i == 0:
		if math.gcd(i, x // i) == 1:
			print(str(i) + ' ' + str(x // i))
			break


def LCM(a, b, x):
	hcf = HCF(a, b)
	lcm = a * b // hcf
	if int(lcm) == x:
		return True
	else:
		return False

def HCF(a, b):
	x = max(a, b)
	y = min(a, b)
	if x % y == 0:
		return y
	else:
		return HCF(y, x % y)
x = int(input())
factors_Array = []
factors_Array.append(1)
factors_Array.append(x)
if x ** 0.5 != int(x ** 0.5):
	for i in range(2, int(x ** 0.5) + 1):
		if x % i == 0:
			factors_Array.append(i)
			factors_Array.append(x // i)
elif x ** 0.5 == int(x ** 0.5):
	for i in range(2, int(x ** 0.5)):
		if x % i == 0:
			factors_Array.append(i)
			factors_Array.append(x // i)
if x ** 0.5 == int(x ** 0.5):
	factors_Array.append(int(x ** 0.5))
factors_Array.sort()
pairs = []
n = len(factors_Array)
for i in range(len(factors_Array) // 2):
	a = factors_Array[i]
	b = factors_Array[n - i - 1]
	if LCM(a, b, x):
		pairs.append([a, b])
ans = max(pairs)
for i in range(2):
	print(ans[i], end=' ')


from collections import Counter
import string
import math
import sys

def array_int():
	return [int(i) for i in sys.stdin.readline().split()]

def vary(number_of_variables):
	if number_of_variables == 1:
		return int(sys.stdin.readline())
	if number_of_variables >= 2:
		return map(int, sys.stdin.readline().split())

def makedict(var):
	return dict(Counter(var))
mod = 100000007

def printDivisors(n):
	divisors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				divisors.append(i)
			else:
				divisors.extend((i, n // i))
		i = i + 1
	return divisors
n = vary(1)
z = printDivisors(n)
if len(z) == 2 or len(z) == 1:
	print(1, n)
else:
	ans = float('inf')
	for i in range(len(z)):
		if z[i] * (n // z[i]) // math.gcd(z[i], n // z[i]) == n:
			ans = min(ans, max(z[i], n // z[i]))
	print(ans, n // ans)


def gcd(a, b):
	if a % b == 0:
		return b
	return gcd(b, a % b)
n = int(input())
i = 1
maxa = 10 ** 18
ans = 0
while i * i <= n:
	if n % i == 0:
		num1 = i
		num2 = n // i
		if gcd(num1, num2) == 1:
			if max(num1, num2) < maxa:
				ans = i
			maxa = min(maxa, max(num1, num2))
	i += 1
print(ans, n // ans)


import math

def lc(n):
	if n == 1:
		return '1' + ' ' + '1'
	x = int(n ** 0.5)
	for i in range(x, 0, -1):
		if n % i == 0 and math.gcd(i, n // i) == 1:
			return str(n // i) + ' ' + str(i)
n = int(input())
print(lc(n))


def STR():
	return list(input())

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def MAP2():
	return map(float, input().split())

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

def STRING():
	return input()
from heapq import heappop, heappush
from bisect import *
from collections import deque, Counter
from math import *
from itertools import permutations
dx = [-1, 1, 0, 0]
dy = [0, 0, 1, -1]

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

def pfs(n):
	a = []
	i = 1
	while i * i <= n:
		if n % i == 0:
			if n // i == i:
				a.append(i)
			else:
				a.append(i)
				a.append(n // i)
		i += 1
	return a
x = INT()
if x == 1:
	print(1, 1)
	exit(0)
r = pfs(x)
ans = []
for i in range(len(r)):
	if lcm(r[i], x // r[i]) == x:
		ans.append([r[i], x // r[i], r[i] + x // r[i]])
ans = sorted(ans, key=lambda x: x[2])
z = ans[0]
print(z[0], z[1])


def function(a, b):
	if b % a == 0:
		return False
	else:
		for i in range(2, a // 2 + 1):
			if a % i == 0 and b % i == 0:
				return False
		return True
import math
X = int(input())
if X == 1:
	print('1', '1')
else:
	x = int(math.sqrt(X))
	i = x
	k = 'y'
	while k == 'y' and i >= 2:
		if X % i == 0:
			y = X // i
			if i != y:
				if function(i, y):
					print(i, y)
					k = 'n'
		i = i - 1
	if k == 'y':
		print('1', X)


import math

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
n = int(input())
value = math.ceil(n ** 0.5)
for i in range(1, value):
	if n % i == 0:
		x = i
		y = n // i
		z = gcd(x, y)
		if z == 1:
			xx = x
			yy = y
if n == 1:
	print(1, 1)
else:
	print(xx, yy)


from math import gcd, sqrt, ceil
from sys import stdin

def lcm(a, b):
	lcm = a / gcd(a, b) * b
	return lcm
num = int(stdin.readline())
ans = 1
for i in range(1, ceil(sqrt(num)) + 1):
	if num % i == 0 and lcm(i, num // i) == num:
		ans = i
print(ans, int(num / ans))


import os
import sys
from io import BytesIO, IOBase
import math

def prod(a, onemore):
	cnt = onemore
	for x in a:
		cnt *= x
	return cnt

def main():
	k = int(input())
	boss = []
	if k == 1:
		print(1, 1)
		return
	ans = 999999999999999999999999999999999999
	one = 1
	two = 1
	for x in range(1, math.floor(math.sqrt(k)) + 2):
		if k % x == 0:
			a = k // x
			b = x
			if a * b // math.gcd(a, b) == k:
				if max(a, b) < ans:
					one = a
					two = b
	print(one, two)
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')
main()


import itertools
x = int(input())
x0 = x
i = 2
d = 2
last_pr = 1
divs = []
while d * d <= x:
	if x % d == 0:
		x = x // d
		last_pr *= d
	else:
		if last_pr != 1:
			divs.append(last_pr)
		last_pr = 1
		d += 1
if d == x and last_pr * x != 1:
	divs.append(last_pr * x)
else:
	if last_pr != 1:
		divs.append(last_pr)
	if x != 1:
		divs.append(x)
m = x0
ma = 1
mb = x0
for i in range(len(divs) + 1):
	combs = itertools.combinations(divs, i)
	for comb in combs:
		a = 1
		b = 1
		for d in divs:
			if d in comb:
				a *= d
			else:
				b *= d
		if max(a, b) < m:
			m = max(a, b)
			ma = a
			mb = b
print(ma, mb)


def primfacs(n):
	i = 2
	primfac = []
	while i * i <= n:
		tmp = 1
		while n % i == 0:
			tmp *= i
			n = n // i
		primfac.append(tmp)
		i = i + 1
	if n > 1:
		primfac.append(n)
	primfac.sort(reverse=True)
	return primfac
X = int(input())
ps = primfacs(X)
products = set([1])
for p in ps:
	new_set = []
	for product in products:
		new_set.append(product * p)
	products.update(new_set)
a = 1
b = X
min_max = X
for p in products:
	new_b = X // p
	new_max = max(p, new_b)
	if new_max < min_max:
		a = p
		b = new_b
		min_max = new_max
print(a, b)


from math import gcd
from math import sqrt
from math import ceil

def lcm(a, b):
	lcm = a * b // gcd(a, b)
	return lcm
x = int(input())
ans = x
for i in range(1, ceil(sqrt(x))):
	if x % i == 0:
		a = i
		b = x // i
		c = max(a, b)
		if c < ans and lcm(a, b) == x:
			ans = c
print(min(ans, x // ans), max(ans, x // ans))


import sys
from math import gcd
reader = (line.rstrip() for line in sys.stdin)
input = reader.__next__
X = int(input())

def isqrt(n):
	x = n
	y = x + 1 >> 1
	while y < x:
		x = y
		y = x + n // x >> 1
	return x
f1 = isqrt(X)
while X % f1 > 0 or gcd(X // f1, f1) > 1:
	f1 -= 1
print(f1, X // f1)


from sys import maxsize, stdout, stdin, stderr
mod = int(1000000000.0 + 7)

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

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

def S():
	return input().strip()

def grid(r, c):
	return [lint() for i in range(r)]
from collections import defaultdict, Counter
import math
from itertools import groupby

def gcd(a, b):
	while b:
		a %= b
		tmp = a
		a = b
		b = tmp
	return a

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

def check_prime(n):
	for i in range(2, n):
		if n % i == 0:
			return 0
	return 1
n = I()
ans = None
i = 1
while i ** 2 <= n:
	if n % i == 0 and lcm(i, n // i) == n:
		ans = i
	i += 1
print(ans, n // ans)


from math import ceil, gcd

def fact(x):
	A = []
	A.append(x)
	for i in range(2, ceil(x ** 0.5)):
		if x % i == 0:
			A.append(x // i)
	A.sort()
	return A

def lcm(a, b):
	return a * b / gcd(a, b)
x = int(input())
A = fact(x)
for i in range(len(A)):
	a = A[i]
	b = x // a
	if lcm(a, b) == x:
		print(b, a)
		break


from math import gcd
x = int(input())
i = 1
min = 1000000000000
while i ** 2 <= x:
	if x % i == 0:
		a = i
		b = x // i
		if a * b // gcd(a, b) == x:
			if max(a, b) < min:
				min = max(a, b)
	i += 1
print(min, x // min)


import math
n = int(input())
for a in range(math.ceil(n ** 0.5), 0, -1):
	if n % a == 0:
		b = n // a
		if math.gcd(a, b) == 1:
			print(a, b)
			break


n = int(input())
import math
l = []
m = int(pow(n, 0.5))
ans = [n, n]
for i in range(1, m + 1):
	if n % i == 0:
		z = n // i
		if z * i // math.gcd(z, i) == n:
			l.append((min(z, i), max(z, i)))
l = sorted(l, key=lambda x: x[1])
print(l[0][0], l[0][1])


MOD = 1000000007
MOD2 = 998244353
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
mn = 10 ** 15
from math import gcd
X = ii()
for i in range(1, int(X ** 0.5) + 1):
	if X % i == 0 and gcd(i, X // i) == 1:
		mn = min(mn, X // i)
print(X // mn, mn)


def main():
	import sys
	from collections import defaultdict
	input = sys.stdin.readline
	X = int(input())
	X_raw = X
	if X == 1:
		print(1, 1)
		exit()
	x = int(X ** 0.5)
	if x ** 2 > X:
		x -= 1
	if (x + 1) ** 2 <= X:
		x += 1
	prime = defaultdict(int)
	for d in range(2, x + 1):
		while X % d == 0:
			prime[d] += 1
			X //= d
	if X != 1:
		prime[X] += 1
	if len(prime) == 1:
		print(1, X_raw)
		exit()
	ans = []
	for d in prime.keys():
		ans.append(d ** prime[d])
	M = len(ans)
	dp = [[0] * (x + 1) for _ in range(M + 1)]
	dp[0][1] = 1
	for i in range(M):
		for j in range(x + 1):
			if dp[i][j]:
				if j * ans[i] <= x:
					dp[i + 1][j * ans[i]] = 1
				dp[i + 1][j] = 1
	for a in range(x, -1, -1):
		if dp[-1][a]:
			print(a, X_raw // a)
			break
main()


import math
x = int(input())
for i in range(1, int(math.sqrt(x)) + 1):
	if x % i == 0 and math.gcd(i, x // i) == 1:
		m = i
print(x // m, end=' ')
print(m)


def gcd(a, b):
	if a < b:
		(a, b) = (b, a)
	while b > 0:
		(a, b) = (b, a % b)
	return a
x = int(input())
a = 1
while a * a < x:
	a += 1
if a * a > x:
	a = a - 1
while x % a != 0 or gcd(a, x // a) > 1:
	a = a - 1
print(a, x // a)


from math import gcd
n = int(input())
first = 1
second = n
answer = [first, second]
while True:
	first += 1
	if n % first != 0:
		second = int(n // first) + 1
	else:
		second = int(n // first)
		if gcd(first, second) == 1:
			answer = [first, second]
	if first > second or first == second:
		break
print(answer[0], answer[1])


import os, sys
from io import BytesIO, IOBase

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
import math
import math

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

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n // i
	if n > 2:
		l.append(n)
	return l
for i in range(1):
	n = ii()
	i = 1
	m = 100000000000000.0
	while i * i <= n:
		if n % i == 0 and lcm(i, n // i) == n:
			a = n // i
			b = i
			if max(a, b) < m:
				m = max(a, b)
				ans = i
		i += 1
	print(ans, n // ans)


def hcf(a, b):
	if a > b:
		c = a % b
	else:
		c = b % a
	if c == 0:
		return min(a, b)
	else:
		return hcf(min(a, b), c)
n = int(input())
j = int(n ** 0.5)
mx = 1
if j ** 2 != n:
	for i in range(1, j + 1):
		if n % i == 0 and hcf(i, int(n / i)) == 1:
			mx = i
else:
	for i in range(1, j):
		if n % i == 0 and hcf(i, int(n / i)) == 1:
			mx = i
print(str(mx) + ' ' + str(int(n / mx)))


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

def lcm(a, b):
	return a * b / gcd(a, b)
x = int(input())
ans = 1
for i in range(1, int(pow(x, 0.5)) + 1):
	if x % i == 0 and lcm(i, x / i) == x:
		ans = i
print(ans, int(x / ans))


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

def lcm(a, b):
	return a * b // hcfnaive(a, b)
x = int(input())
fac = x
for i in range(2, int(x ** 0.5) + 1):
	if x % i == 0 and lcm(i, x // i) == x:
		fac = min(fac, x // i)
print(x // fac, fac)


def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
n = int(input())
arr = [1]
i = 1
(answer_a, answer_b) = (1, 1)
while i * i < n:
	if n % i == 0:
		a = i
		b = n // i
		if gcd(a, b) == 1:
			(answer_a, answer_b) = (a, b)
	i += 1
print(answer_a, answer_b)


import collections, math
local = False
if local:
	file = open('inputt.txt', 'r')

def inp():
	if local:
		return file.readline().rstrip()
	else:
		return input().rstrip()

def ints():
	return [int(_) for _ in inp().split()]

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

def lcm(a, b):
	return a * b / gcd(a, b)
X = int(inp())
sqrtX = int(math.sqrt(X)) + 1
(ansA, ansB) = (1, X)
maxAns = X
for i in range(2, sqrtX):
	if X % i == 0:
		a = i
		b = X // i
		if lcm(a, b) == X:
			if max(a, b) < maxAns:
				maxAns = max(a, b)
				ansA = a
				ansB = b
print(str(ansA) + ' ' + str(ansB))


import math

def lcm(a, b):
	return a * b // math.gcd(a, b)
x = int(input())
l = []
i = 1
ed = math.floor(x ** 0.5)
while i <= ed:
	if x % i == 0:
		l.append([i, x // i])
	i += 1
mx = max(l[0][0], l[0][1])
l1 = [l[0][0], l[0][1]]
for i in l:
	if lcm(i[0], i[1]) == x:
		if max(i[0], i[1]) < mx:
			l1 = [i[0], i[1]]
print(*l1)


def returnGCD(x, y):
	if y > x:
		return euclidean_algo(y, x)
	while y != 0:
		(x, y) = (y, x % y)
	return x

def factors(n):
	lst = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			lst.append([i, n // i])
	return lst
original = int(input())
facts = factors(original)
facts.sort()
currentlist = 0
current = 10000000000000000000000
for i in facts:
	a = max(i)
	if a < current and i[0] * i[1] / returnGCD(i[1], i[0]) == original:
		currentlist = i
		current = a
print(currentlist[0], currentlist[1])


n = int(input())
import math
r = int(n ** 0.5) + 1
a = []

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)
for _ in range(1, r):
	if n / _ == int(n / _) and lcm(_, n // _) == n:
		b = [_, n / _]
		b.sort()
		a.append(b)

def sort1(val):
	return val[1]
a.sort(key=sort1)
print(int(a[0][0]), int(a[0][1]))


import math

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
x = int(input())
for a in range(int(math.sqrt(x)), 0, -1):
	if x % a != 0:
		continue
	b = x // a
	if gcd(a, b) == 1:
		print(a, b)
		break


x = int(input())
import math
import fractions

def union_lcm(lists):
	if len(lists) == 1:
		return lists[0]
	elif len(lists) > 1:
		num = lists[0]
		for i in range(1, len(lists)):
			num = num * lists[i] // fractions.gcd(num, lists[i])
		return num
mini = 10 ** 12
minipare = (1, 10 ** 12)
sqrt = int(math.sqrt(x)) + 1
for i in range(1, sqrt + 1):
	if x % i == 0:
		a = i
		b = x // i
		if union_lcm([a, b]) == x and max(a, b) < mini:
			minipare = (a, b)
	else:
		pass
print(*minipare)


x = int(input())
if x == 1:
	print(1, 1)
else:
	r = x ** (1 / 2)
	r0 = int(r)
	if r0 * r0 == x:
		r0 -= 1
	fl = True

	def check(x1, x2):
		mmin = min(x1, x2)
		res = True
		if mmin != 1:
			f = True
			while f:
				if x1 % mmin == 0 and x2 % mmin == 0:
					f = False
					res = False
				mmin -= 1
				if mmin == 1:
					f = False
		return res
	while fl:
		if x % r0 == 0:
			a = x // r0
			b = x // a
			if check(a, b):
				fl = False
			else:
				r0 -= 1
		else:
			r0 -= 1
		if r0 == 0:
			fl = False
			a = 1
			b = x
	print(a, b)


from random import randint

def quickMulMod(a, b, m):
	ret = 0
	while b:
		if b & 1:
			ret = (a + ret) % m
		b //= 2
		a = (a + a) % m
	return ret

def quickPowMod(a, b, m):
	ret = 1
	while b:
		if b & 1:
			ret = quickMulMod(ret, a, m)
		b //= 2
		a = quickMulMod(a, a, m)
	return ret

def isPrime(n, t=5):
	t = min(n - 3, t)
	if n < 2:
		return False
	if n == 2:
		return True
	d = n - 1
	r = 0
	while d % 2 == 0:
		r += 1
		d //= 2
	tested = set()
	for i in range(t):
		a = randint(2, n - 2)
		while a in tested:
			a = randint(2, n - 2)
		tested.add(a)
		x = quickPowMod(a, d, n)
		if x == 1 or x == n - 1:
			continue
		for j in range(r - 1):
			x = quickMulMod(x, x, n)
			if x == n - 1:
				break
		else:
			return False
	return True

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

def factor(n):
	if n == 1:
		return []
	if isPrime(n):
		return [n]
	fact = 1
	cycle_size = 2
	x = x_fixed = 2
	c = randint(1, n)
	while fact == 1:
		for i in range(cycle_size):
			if fact > 1:
				break
			x = (x * x + c) % n
			if x == x_fixed:
				c = randint(1, n)
				continue
			fact = gcd(x - x_fixed, n)
		cycle_size *= 2
		x_fixed = x
	return factor(fact) + factor(n // fact)

def f():
	x = int(input())
	if x == 1:
		print('1 1')
		return
	if isPrime(x):
		print('1 {}'.format(x))
		return
	fa = factor(x)
	fa.sort()
	fa.append(1)
	parts = []
	tmp = 1
	for i in range(len(fa) - 1):
		tmp *= fa[i]
		if fa[i] != fa[i + 1]:
			parts.append(tmp)
			tmp = 1
	if len(parts) == 1:
		print('1 {}'.format(x))
		return
	parts.sort()
	ans = x
	bar = int(x ** 0.5)
	memo = [1]
	for p in parts[::-1]:
		l = len(memo)
		for i in range(l):
			tmp = p * memo[i]
			if tmp > bar:
				ans = min(ans, tmp)
			else:
				memo.append(tmp)
	print('{} {}'.format(ans, x // ans))
f()


import sys
from sys import stdin, stdout
import bisect
import math
import heapq

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())
import math

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def modInverse(b, m):
	g = math.gcd(b, m)
	if g != 1:
		return -1
	else:
		return pow(b, m - 2, m)

def modDivide(a, b, m):
	a = a % m
	inv = modInverse(b, m)
	if inv == -1:
		print('Division not defined')
	else:
		return inv * a % m

def main():
	n = inin()
	l = Divisors(n)
	x = 1000000000000
	a = b = 0
	for i in l:
		j = max(i, n // i)
		q = math.gcd(i, n // i)
		if x > j * q:
			x = j * q
			a = i * q
			b = n // i * q
	print(b, a)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			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')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def readnumbers(zero=0):
	conv = ord if py2 else lambda x: x
	A = []
	numb = zero
	sign = 1
	i = 0
	s = sys.stdin.buffer.read()
	try:
		while True:
			if s[i] >= b'0'[0]:
				numb = 10 * numb + conv(s[i]) - 48
			elif s[i] == b'-'[0]:
				sign = -1
			elif s[i] != b'\r'[0]:
				A.append(sign * numb)
				numb = zero
				sign = 1
			i += 1
	except:
		pass
	if s and s[-1] >= b'0'[0]:
		A.append(sign * numb)
	return A
main()


import math

def divisors(n):
	i = 1
	l = []
	while i <= int(n ** 0.5):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(n // i)
				l.append(i)
		i = i + 1
	return l
for _ in range(1):
	n = int(input())
	ans = n
	l = divisors(n)
	for i in l:
		j = n // i
		a = i
		b = j
		if a * b // math.gcd(a, b) == n:
			ans = min(ans, max(i, j))
	print(ans, n // ans)


import math
x = int(input())
root = int(math.sqrt(x))
for i in range(root, 0, -1):
	if x % i == 0:
		j = x // i
		if math.gcd(i, j) == 1:
			print(i, j)
			exit()


from bisect import bisect_left as bl
from bisect import bisect_right as br
import heapq
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline
M = mod = 998244353

def factors(n):
	return sorted(list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))))

def li():
	return [int(i) for i in input().rstrip('\n').split()]

def st():
	return input().rstrip('\n')

def val():
	return int(input().rstrip('\n'))

def li2():
	return [i for i in input().rstrip('\n').split(' ')]

def li3():
	return [int(i) for i in input().rstrip('\n')]

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

def lcm(a, b):
	return a * b / gcd(a, b)
x = val()
ans = x
currans = [1, x]
for i in range(1, int(x ** 0.5) + 1):
	if x // i == x / i:
		temp = gcd(i, x // i)
		if gcd(i, x // i) == 1:
			if ans > max(i, x // i):
				ans = max(i, x // i)
				currans = [i, x // i]
print(*currans)


import math

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

def lcm(a, b):
	ans = a * b // gcd(a, b)
	return ans
n = int(input())
ans = n
a1 = 1
a2 = n
for i in range(1, int(math.ceil(math.sqrt(n))) + 1):
	if n % i == 0:
		if lcm(i, n // i) == n:
			maxi = max(i, n // i)
			if ans > maxi:
				a1 = i
				a2 = n // i
				ans = maxi
print(a1, a2)


import math
n = int(input())
a = b = 10 ** 12
for i in range(1, int(math.sqrt(n) + 1)):
	if n % i == 0:
		temp = int(n / i)
		if n / math.gcd(i, temp) == n and max(i, temp) < max(a, b):
			a = i
			b = temp
print(a, b)


import math

def check(x, y):
	ans = x * y / math.gcd(x, y)
	if ans == n:
		return True
	else:
		return False
n = int(input())
m = int(math.sqrt(n))
mx = 10000000000000000000000000000000000
for i in range(1, m + 1):
	if n % i == 0:
		if check(i, n // i) == True:
			mxx = max(i, n // i)
			mx = min(mx, mxx)
			(ans1, ans2) = (i, n // i)
print(ans1, ans2)


from sys import *

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

def solve(x):
	i = 1
	t = 1
	while i * i < x:
		if x % i == 0 and gcd(i, x // i) == 1:
			t = i
		i += 1
	return (t, x // t)
	pass
test = 1
for t in range(0, test):
	n = int(input())
	ans = solve(n)
	print(ans[0], ans[1])


from math import gcd
p = int(input())
a = []
b = []
i = 1
while i * i <= p:
	if p % i == 0:
		a.append(i)
		b.append(int(p / i))
	i += 1
a.reverse()
b.reverse()
for i in range(len(a)):
	if gcd(int(a[i]), int(b[i])) == 1:
		print(a[i], b[i])
		quit()


primes = []
primeFactors = []
factors = []

def gcd(a, b):
	while b != 0:
		c = b
		b = a % b
		a = c
	return a

def sieve():
	global primes
	bs = [1] * 1000010
	bs[0] = bs[1] = 0
	for i in range(2, 1000001):
		if bs[i] == 1:
			for j in range(i * i, 1000001, i):
				bs[j] = 0
			primes.append(i)

def p_factorize(N):
	global primes
	global primeFactors
	for p in primes:
		Count = 0
		while N % p == 0:
			N //= p
			Count += 1
		if Count:
			primeFactors.append((p, Count))
	if N != 1:
		primeFactors.append((N, 1))

def factorize(res, index):
	global primeFactors
	global factors
	prod = 1
	if index == len(primeFactors):
		factors.append(res)
		return
	(x, y) = primeFactors[index]
	for i in range(y + 1):
		factorize(res * prod, index + 1)
		prod *= x
x = int(input())
minim = x
ans1 = 1
ans2 = x
sieve()
p_factorize(x)
factorize(1, 0)
for f in factors:
	if minim > max(f, x // f) and gcd(f, x // f) == 1:
		minim = max(f, x // f)
		ans1 = f
		ans2 = x // f
print(f'{ans1} {ans2}')


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

def f(X):
	a = 1
	i = int(X ** (1 / 2) // 1)
	while a == 1:
		if X % i == 0 and pgcd(X // i, i) == 1:
			a = 0
		else:
			i -= 1
	t = (i, X // i)
	return t
X = int(input())
print(f(X)[0], f(X)[1])


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

def lcm(a, b):
	return a * b // gcd(a, b)
x = int(input())
minn = x
for i in range(1, int(x ** 0.5) + 1):
	if x % i == 0 and lcm(i, x // i) == x:
		minn = min(minn, max(i, x // i))
print(x // minn, minn)


import sys
import math
from collections import defaultdict, Counter
n = int(input())
a = 1
b = 1
d = []
tot = 1
cur = 1
while n % 2 == 0:
	cur *= 2
	tot *= 2
	n //= 2
if cur != 1:
	d.append(cur)
	cur = 1
if a != 1:
	flag = 0
else:
	flag = 1
for i in range(3, int(math.sqrt(n)) + 1, 2):
	if n % i == 0 and flag == 0:
		while n % i == 0:
			cur *= i
			tot *= i
			n //= i
		d.append(cur)
		cur = 1
		if a <= b:
			flag = 1
	elif n % i == 0 and flag == 1:
		while n % i == 0:
			cur *= i
			tot *= i
			n //= i
		d.append(cur)
		cur = 1
		if b < a:
			flag = 0
if n > 2:
	d.append(n)
	tot *= n
if tot == 1:
	print(1, 1)
else:
	a = 1
	b = tot
	ans = tot
	for i in range(pow(2, len(d))):
		cur = 1
		for j in range(len(d)):
			if i & 1 << j:
				cur *= d[j]
		if max(cur, tot // cur) < ans:
			ans = max(cur, tot // cur)
			a = cur
			b = tot // cur
	print(a, b)


from math import *
x = int(input())
a = 1
b = x
for i in range(1, ceil(sqrt(x))):
	j = x // i
	if x % i == 0 and gcd(i, j) == 1 and (max(i, j) < max(a, b)):
		(a, b) = (i, j)
print(a, b)


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


import math

def lcm(a, b):
	return int(a * b / int(math.gcd(a, b)))
n = int(input())
a = 1000000000000000000
b = 1000000000000000000
for x in range(1, int(math.sqrt(n)) + 1):
	c = lcm(x, int(n / x))
	if n % x == 0 and c == n:
		if max(x, n / x) < max(a, b):
			a = x
			b = int(n / x)
print(a, b)


import math

def printDivisors(n, l):
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
		i = i + 1
	return l
x = int(input())
lis = []
arr = printDivisors(x, lis)
maxi = 10000000000000000000000000000000000000000001
for i in arr:
	val = x // i
	if math.gcd(i, val) == 1:
		if max(i, val) < maxi:
			a = i
			b = val
			maxi = max(i, val)
print(int(a), int(b))


from math import gcd
n = int(input())
if n == 1:
	print('1 1')
	exit(0)
x = int(n ** 0.5)
if x * x == n:
	x = x - 1
for i in range(x, 0, -1):
	if n % i == 0:
		l = n // i
		if l * i // gcd(l, i) == n:
			print(i, n // i)
			exit(0)


import sys
import math

def read_line():
	return sys.stdin.readline()[:-1]

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

def read_int_line():
	return [int(v) for v in sys.stdin.readline().split()]

def read_float_line():
	return [float(v) for v in sys.stdin.readline().split()]

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

def printDivisors(n):
	i = 1
	(a, b) = (0, 0)
	while i <= math.sqrt(n):
		if n % i == 0:
			if gcd(i, n // i) == 1:
				a = i
				b = n // i
		i = i + 1
	return (a, b)
x = read_int()
ans = printDivisors(x)
print(*ans)


def gcd(a, b):
	while b:
		t = a % b
		a = b
		b = t
	return a
n = int(input())
p = int(pow(n, 0.5))
res = pow(10, 13)
for i in range(1, p + 1):
	if n % i == 0:
		a1 = max(i, n // i)
		a2 = min(i, n // i)
		if gcd(a1, a2) == 1 and a1 < res:
			res = a1
else:
	print(res, n // res)


from math import sqrt

def nok(a, b):
	while a != 0 and b != 0:
		if a > b:
			a %= b
		else:
			b %= a
	if a + b == 1:
		return True
	return False
x = int(input())
x1 = int(sqrt(x))
while x != 1:
	if x % x1 == 0 and x1 ** 2 != x and nok(x1, x // x1):
		break
	x1 -= 1
p = x // x1
print(x1, p)


z = input
mod = 10 ** 9 + 7
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0:
			return 0
	return 1
for _ in range(1):
	n = int(z())
	for i in range(ceil(n ** 0.5), 0, -1):
		p = gcd(i, n // i)
		if i * (n // i) // p == n:
			break
	print(i, n // i)


x = int(input())
if x == 1 or x == 2:
	print('1 {}'.format(x))
	exit()

def compute_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	return x * y // compute_gcd(x, y)
ans = 0
for i in range(1, int(x ** 0.5) + 1):
	if x % i == 0 and lcm(i, x // i) == x:
		ans = i
print('{} {}'.format(ans, x // ans))


import math
n = int(input())

def lcm(array, n):
	(first, second) = (array[0], array[1])
	lcms = first * second // math.gcd(first, second)
	if lcms == n:
		return 1
	else:
		return 0
minimum = 999999999999
answer = []
for i in range(1, int(n ** 0.5 + 1)):
	if n % i == 0:
		if i ** 2 != n:
			maxs = max(i, n // i)
			curr = [i, n // i]
			if lcm(curr, n) == 1:
				if maxs < minimum:
					minimum = maxs
					answer = [i, n // i]
		else:
			maxs = max(i, i)
			curr = [i, i]
			if lcm(curr, n) == 1:
				if maxs < minimum:
					minimum = maxs
				answer = [i, i]
for ele in answer:
	print(ele, end=' ')


import math
x = int(input())
resL = -1
resR = -1
res = -1
i = 1
while i * i <= x:
	if x % i == 0:
		a = i
		b = x // i
		if a * b / math.gcd(a, b) == x:
			if res == -1 or max(a, b) < res:
				resL = a
				resR = b
				res = max(a, b)
	i += 1
print(resL, resR)


def lcm(x, y):
	import math
	return x * y // math.gcd(x, y)
n = int(input())
r = []
for i in range(1, int(n ** 0.5) + 1):
	if n % i == 0:
		r.append([n // i, i])
r.reverse()
for k in r:
	if lcm(k[0], k[1]) == n:
		print(k[0], k[1])
		break


import math

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 div(k):
	m = 100000000000000
	for i in range(1, math.floor(math.sqrt(k)) + 1):
		if k % i == 0 and lcm(i, k // i) == k:
			m = min(max(k // i, i), m)
	return m
n = int(input())
a = div(n)
print(a, n // a)


def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
x = int(input())
tf = True
if int(x ** (1 / 2)) == x ** (1 / 2):
	l = int(x ** (1 / 2)) - 1
else:
	l = int(x ** (1 / 2))
for i in range(l, 0, -1):
	if x % i == 0:
		if gcd(i, x // i) == 1:
			print(i, x // i)
			tf = False
			break
if tf:
	print(1, x)


def gcd(a, b):
	while a % b != 0:
		c = b
		b = a % b
		a = c
	return b
import math
X = int(input())

def min(X):
	x = int(math.sqrt(X))
	for i in range(x, 0, -1):
		if X / i % 1 == 0:
			if gcd(i, X / i) == 1:
				return str(i) + ' ' + str(X // i)
print(min(X))


import math
n = int(input())
m = n
for i in range(2, int(math.sqrt(n)) + 1):
	if n % i == 0:
		if math.gcd(n // i, i) == 1:
			if m > max(n // i, i):
				m = max(n // i, i)
print(n // m, m)


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

def func(x):
	result = [1, x]
	n = int(x ** (1 / 2)) + 1
	for i in range(2, n):
		if x % i == 0 and gcd(i, x // i) == 1:
			if max(result) > max([i, x // i]):
				result = [i, x // i]
	return str(result[0]) + ' ' + str(result[1])
x = int(input())
print(func(x))


from math import sqrt, gcd

def solve(x):
	i = 2
	ans = [1, x]
	while i <= sqrt(x):
		if x % i == 0 and max(ans) > max(i, x // i) and (x // gcd(i, x // i) == x):
			ans = [i, x // i]
		i += 1
	return ans
x = int(input())
print(*solve(x))


def rec(ind, cc=1, dd=1):
	global pp, a, b
	if ind == len(pp):
		if max(cc, dd) < max(a, b):
			(a, b) = (cc, dd)
		return
	rec(ind + 1, cc * pp[ind], dd)
	rec(ind + 1, cc, dd * pp[ind])
x = int(input())
p = []
vis = [0 for i in range(10 ** 6 + 4)]
vis[0] = 1
vis[1] = 1
for i in range(2, 10 ** 6 + 4):
	if vis[i] == 0:
		p.append(i)
		vis[i::i] = len(vis[i::i]) * [1]
pp = []
ind = 0
xx = x
while xx > 1 and ind < len(p):
	co = 1
	while xx % p[ind] == 0:
		xx //= p[ind]
		co *= p[ind]
	ind += 1
	if co == 1:
		continue
	pp.append(co)
if xx > 1:
	pod = 1
	for i in pp:
		pod *= i
	print(xx, pod)
elif x == 1:
	print(1, 1)
else:
	a = 1
	b = x
	rec(0)
	print(a, b)


from math import gcd
lcm = lambda x, y: x * y // gcd(x, y)

def get_divisors(n):
	x = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			x.append((i, n // i))
	return x
n = int(input())
a = get_divisors(n)[0]
for (x, y) in get_divisors(n):
	if max(a) > max(x, y) and lcm(x, y) == n:
		a = (x, y)
print(*a)


import math
a = int(input())
l = list()
k = 0
if a == 1:
	print('1', '1')
else:
	x = 1
	while pow(x, 2) < a:
		if a % x == 0 and a * math.gcd(x, int(a / x)) == a:
			ans = x
		x += 1
	print(int(ans), int(a / ans))


from bisect import bisect_left

def gcd(a, b):
	while b:
		a %= b
		(a, b) = (b, a)
	return a

def divisors(n):
	d = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			d.append(i) if i * i == n else d.extend([i, n // i])
	return list(sorted(d))

def solve():
	n = int(input())
	if n == 1:
		print(1, 1)
		return
	for i in divisors(n):
		if i * i <= n or gcd(i, n // i) > 1:
			continue
		else:
			print(n // i, i)
			return
solve()


from math import sqrt, ceil
n = int(input())
a = []
b = []
c = 0

def commfact(a, b):
	for i in range(2, ceil(sqrt(min(a, b))) + 1):
		if a % i == 0 and b % i == 0:
			return 0
	return 1
for i in range(2, ceil(sqrt(n)) + 1):
	if n % i == 0:
		c = c + 1
		b = [i, int(n / i)]
		a.append(b)
for i in range(len(a) - 1, -1, -1):
	if a[i][1] % a[i][0] != 0 and a[i][0] % a[i][1] != 0 and commfact(a[i][1], a[i][0]):
		print(a[i][0], a[i][1])
		c = -1
		break
if c != -1:
	print(1, n)


from math import *

def LCM(a, b):
	g = gcd(a, b)
	return a * b // g

def FadiLcm(num):
	maxs = num ** 0.5
	for i in range(int(maxs), 0, -1):
		if num % i == 0:
			div = i
			div2 = num // div
			if num // div == div:
				continue
			if LCM(div, div2) != num:
				continue
			break
	one = div
	two = num // div
	return str(one) + ' ' + str(two)

def main():
	n = eval(input())
	print(FadiLcm(n))
main()


import math

def main():
	prime = []
	n = int(input())
	if n == 2:
		print(1, 2)
		return
	x = n
	two = 1
	while x % 2 == 0:
		x = x / 2
		two = two * 2
	prime.append(two)
	for i in range(3, int(math.floor(math.sqrt(n))) + 1, 2):
		temp = 1
		while x % i == 0:
			x = x / i
			temp = temp * i
		if temp != 1:
			prime.append(temp)
		if i > x:
			break
	if x > 1:
		prime.append(x)
	previous = 1
	min = 1000000000000
	ansa = 1
	ansb = 1
	for i in range(int(math.pow(2, len(prime)))):
		a = 1
		b = 1
		j = 1
		x = i
		for value in prime:
			if (x - math.pow(2, j - 1)) % math.pow(2, j) == 0:
				a = a * value
				x = x - math.pow(2, j - 1)
			else:
				b = b * value
			j = j + 1
		if min > max(a, b):
			ansa = a
			ansb = b
			min = max(a, b)
	print(int(ansa), int(ansb))
main()


import math

def printDivisors(n):
	i = 1
	factors = []
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				factors.append(i)
			else:
				factors.append(n // i)
				factors.append(i)
		i = i + 1
	return factors

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)
n = int(input())
if n == 1:
	print(1, 1)
else:
	factors = printDivisors(n)
	i = len(factors) - 1
	while i >= 0:
		if n // factors[i] == factors[i]:
			i -= 1
		elif gcd(factors[i], factors[i - 1]) == 1:
			break
		else:
			i -= 2
	print(factors[i], n // factors[i])


def factors(x):
	result = []
	i = 1
	while i * i < x:
		if x % i == 0:
			result.append(i)
		i += 1
	return result

def gcd(big, small):
	mod = big % small
	if mod == 0:
		return small
	return gcd(small, mod)

def find_nums(lcm):
	f = factors(lcm)
	biggest = lcm
	for i in f:
		bigger = lcm // i
		if bigger < biggest and gcd(i, bigger) == 1:
			biggest = bigger
	return str(lcm // biggest) + ' ' + str(biggest)

def solution(inp):
	return find_nums(inp)

def main():
	print(solution(int(input())))
main()


from math import *
n = int(input())
l = []
k = sqrt(n)
k = floor(k)
k = k + 1
m = n
i = 2
(f, g) = (1, n)
while i < k + 1:
	if n % i == 0:
		a = gcd(i, n // i)
		s = max(i, n // i)
		if a == 1 and s < m:
			m = s
			f = i
			g = n // i
	i = i + 1
print(f, g)


import math

def lcm(a, b):
	return a * b // math.gcd(a, b)
n = int(input())
x = n
if n == 1:
	print(1, 1)
	exit(0)
m = 10000000000000000000000
for i in range(1, n):
	if i * i > n:
		break
	if x % i == 0 and lcm(x // i, i) == x:
		m = min(m, x // i)
print(m, x // m)


def gcd(a, b):
	if a == 0:
		return b
	else:
		return gcd(b % a, a)
x = int(input())
for i in range(int(x ** 0.5), 0, -1):
	if x % i == 0 and gcd(i, x // i) == 1:
		break
print(i, x // i)


import math
n = int(input())
f = 1
ans = [1000000000000000.0, 1000000000000000.0]
while f * f <= n:
	if n % f == 0 and int(math.gcd(f, int(n / f))) == 1:
		if max(f, n / f) < max(ans[0], ans[1]):
			ans[0] = f
			ans[1] = n / f
	f += 1
print(int(ans[0]), int(ans[1]), sep=' ')


import math

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
n = int(input())
p = int(math.sqrt(n))
j = p
while j >= 1:
	if n % j == 0:
		if gcd(j, n // j) == 1:
			print(j, n // j)
			break
	j += -1


from math import *

def gcd(a, b):
	c = 1
	(a, b) = (max(a, b), min(a, b))
	while c != 0:
		c = a % b
		(a, b) = (b, c)
	return a

def find_min_of_max(lists):
	a = lists[0]
	b = lists[1]

def countCoprimePairs(n):
	coprime_list = []
	maximum_list = []
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			if gcd(i, n // i) == 1:
				coprime_list.append([i, n // i])
				maximum_list.append(max(i, n // i))
	if coprime_list == []:
		print('1 ' + str(n))
		return
	min_index = min(enumerate(maximum_list), key=lambda x: x[1])[0]
	ans = coprime_list[min_index]
	print(str(ans[0]) + ' ' + str(ans[1]))
N = int(input())
countCoprimePairs(N)


import math
q = int(input())
k = math.inf
for i in range(1, int(q ** 0.5) + 1):
	if q % i == 0 and math.gcd(i, q // i) == 1:
		k = min(k, q // i)
print(q // k, k)


def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
x = int(input())
BORDER = 1000006
a = 1
b = x
for i in range(1, BORDER):
	if x % i == 0:
		d1 = i
		d2 = x // i
		if gcd(d1, d2) == 1:
			if max(d1, d2) < max(a, b):
				a = d1
				b = d2
print(a, b)


import math
x = int(input())
ans = 10 ** 13
ab = [1, 1]
for i in range(1, int(x ** (1 / 2)) + 1):
	if x % i == 0:
		a = x // i
		b = i
		g = math.gcd(a, b)
		a *= g
		b *= g
		if ans > max(a, b):
			ans = max(a, b)
			ab = [a, b]
print(ab[0], ab[1])


import math
x = int(input())
n = int(math.sqrt(x))
for i in reversed(range(1, n + 1)):
	if x % i == 0:
		a = math.gcd(i, x // i)
		if a == 1:
			print(i, x // i)
			exit()
		else:
			continue


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
n = int(input())
for i in range(int(n ** 0.5), 0, -1):
	if n % i == 0:
		if abs(n / gcd(i, int(n / i)) - n) < 1e-06:
			a = i
			b = int(n / i)
			break
print(a, b)


a = int(input())
q = round(a ** (1 / 2))
if q ** 2 > a:
	q = q - 1

def nod(a, b):
	while a != 0 and b != 0:
		if a > b:
			a %= b
		else:
			b %= a
	return a + b
while q > 0:
	if a % q == 0:
		p = a // q
		if p * q // nod(p, q) == a:
			print(q, p)
			break
	q = q - 1


n = int(input())
import math
x = int(math.sqrt(n))
l = []
for i in range(1, x + 1):
	if n % i == 0:
		l.append([i, n // i])
z = l[0]
mx = n
for i in l:
	if i[0] * i[1] // math.gcd(i[0], i[1]) == n:
		if max(i) < mx:
			z = i
print(*z)


import os
import sys
from io import BytesIO, IOBase
from math import sqrt, gcd

def factors(x):
	fack = set()
	for i in range(1, int(sqrt(x)) + 1):
		if x % i == 0:
			fack.add(i)
			fack.add(x // i)
	return fack

def solution(n):
	fack = factors(n)

	def lcm(x, y):
		return x * y // gcd(x, y)
	cur = float('inf')
	for x in fack:
		if lcm(x, n // x) == n and max(x, n // x) < cur:
			res = f'{x} {n // x}'
			cur = max(x, n // x)
	write(res)

def main():
	n = r_int()
	solution(n)
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))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def write(*args, end='\n'):
	for x in args:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(end)

def r_array():
	return [int(x) for x in input().split()]

def r_int():
	return int(input())
main()


import math
N = int(input())
a = 0
b = 0
m = 10 ** 12

def lcm(a, b):
	return a * b // math.gcd(a, b)
for n in range(1, int(math.sqrt(N)) + 1):
	if N % n == 0 and lcm(n, N // n) == N and (max(n, N // n) < m):
		a = n
		b = N // n
print(a, b)


import math
n = int(input())
ans = n
p = 1
q = n
for i in range(1, int(math.sqrt(n)) + 1):
	if n % i == 0:
		a = i
		b = n // i
		if max(a, b) < ans and math.gcd(a, b) == 1:
			p = a
			q = b
print(p, q)


import math
n = int(input())
m = 1
n //= m
a = 1
i = int(math.sqrt(n))
while i >= 1:
	if n % i == 0 and math.gcd(i, n // i) == 1:
		a = i
		break
	i -= 1
print(a * m, int(n / a * m))


import math
x = int(input(''))
n = int(x ** 0.5)
if n == 1:
	print(1, x)
else:
	for i in range(n, 0, -1):
		if x % i == 0 and i * i != x:
			if abs(i * int(x / i)) // math.gcd(i, int(x / i)) == x:
				break
	print(i, int(x / i))


n = int(input())
from itertools import combinations as comb

def Factor(n):
	Ans = []
	d = 2
	while d * d <= n:
		if n % d == 0:
			Ans.append(d)
			n //= d
		else:
			d += 1
	if n > 1:
		Ans.append(n)
	return Ans

def gcd(a, b):
	while b != 0:
		(a, b) = (b, a % b)
	return a
p = Factor(n)
if n == 1:
	print(1, 1)
	exit()
(a, b) = (1 * p[0], 1)
t = 0
c = 0
if len(p) == 1:
	print(a, b)
	exit()
(a, b) = (1, 1)
var = []
tmp = 1
t = p[0]
for i in range(len(p)):
	if p[i] == t:
		tmp *= t
	else:
		var.append(tmp)
		tmp = p[i]
		t = p[i]
var.append(tmp)
if len(var) == 2:
	print(*var)
	exit()
if len(var) == 1:
	print(1, var[0])
	exit()
var = sorted(var)
k = []
for g in range(len(var)):
	for e in comb(var, g):
		tmp = list(e)
		c = 1
		for j in range(len(tmp)):
			c *= tmp[j]
		k.append(c)
(a, b) = (1, 1)
m = max(k) + 10
for i in range(len(k)):
	for j in range(len(k)):
		if k[i] * k[j] == n and max(k[i], k[j]) < m and (i != j):
			(a, b) = (k[i], k[j])
			m = max(k[i], k[j])
print(a, b)


from math import gcd
n = int(input())
minm = pow(10, 15)
ans = (0, 0)
for d in range(1, int(n ** (1 / 2)) + 1):
	if n % d == 0 and gcd(d, n // d) == 1 and (d + n // d < minm):
		minm = d + n // d
		ans = (d, n // d)
print(ans[0], ans[1])


import math
x = int(input())
n = int(x ** 0.5) + 1
t = [float('inf'), float('inf')]
for i in range(1, n + 1):
	if x % i == 0:
		if t[0] > max(i, x // i) and i != x // i and (math.gcd(i, x // i) == 1):
			t[0] = max(i, x // i)
			t[1] = min(i, x // i)
if x == 1:
	t[0] = t[1] = 1
print(t[1], t[0])


def gcd(a, b):
	if a * b == 0:
		return max(a, b)
	elif a > b:
		return gcd(a % b, b)
	else:
		return gcd(a, b % a)
import math

def intsqrt(n):
	return math.floor(math.sqrt(n))

def ans(n):
	n1 = intsqrt(n)
	for i in range(n1, 0, -1):
		if n % i == 0 and gcd(i, n // i) == 1:
			return [i, n // i]
n = int(input())
array = ans(n)
print(' '.join(map(str, array)))


from itertools import combinations
from functools import reduce

def getPrimeFactors(a):
	factors = []
	for i in range(2, int(a ** 0.5) + 2):
		val = 1
		while a % i == 0:
			a //= i
			val *= i
		if val != 1:
			factors.append(val)
	return factors
a = int(input())
factors = getPrimeFactors(a)
factors.append(1)
m = (float('inf'), float('inf'))
for x in range(1, 7):
	comb = combinations(factors, x)
	for i in comb:
		ans = reduce(lambda x, y: x * y, i)
		b = a // ans
		m = min(m, (max(ans, b), min(ans, b)))
print(str(m[1]) + ' ' + str(m[0]))


def check(a, b):
	while True:
		q = b // a
		r = b % a
		if r == 0:
			break
		b = a
		a = r
	return a == 1
x = int(input())
for i in reversed(range(1, int(x ** 0.5) + 1)):
	if x % i == 0:
		y = x // i
		if i == 1:
			print(i, y)
			exit()
		elif check(i, y):
			print(i, y)
			exit()


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


def lcm(p, q):
	min = 1
	max = 1
	if p < q:
		min = p
		max = q
	else:
		min = q
		max = p
	LCM = max
	for i in range(1, min + 1):
		if max * i % min == 0:
			LCM = max * i
			break
	return LCM
x = int(input())
a = 1
for i in range(1, x):
	if i * i < x:
		a = i
	else:
		break
b = 1
while a >= 1:
	if x % a == 0:
		b = int(x / a)
		if lcm(a, b) == x:
			break
	a = a - 1
print(a, ' ', b)


import sys
import math
from collections import defaultdict, deque
input = sys.stdin.readline

def inar():
	return [int(el) for el in input().split()]

def main():
	x = int(input())
	ans = 10 ** 12
	pair = [0, 0]
	for i in range(1, int(x ** 0.5) + 1):
		if x % i == 0:
			l = i * (x // i) / math.gcd(i, x // i)
			if l == x:
				if ans > max(i, x // i):
					ans = max(i, x // i)
					pair[0] = i
					pair[1] = x // i
	print(*pair)
main()


from collections import defaultdict
from itertools import combinations

def prime_factor(num):
	c = defaultdict(int)
	while not num % 2:
		c[2] += 1
		num //= 2
	for i in range(3, int(num ** 0.5) + 1, 2):
		while not num % i:
			c[i] += 1
			num //= i
	if num > 2:
		c[num] += 1
	l = [1]
	for (i, j) in c.items():
		l.append(pow(i, j))
	return l

def multi(lis):
	curr = 1
	for i in lis:
		curr *= i
	return curr
x = int(input())
l = prime_factor(x)
minim = (1, x)
for i in range(1, len(l) // 2 + 1):
	for lis in combinations(l, i):
		v = multi(lis)
		w = x // v
		if max(minim) > max(v, w):
			minim = (v, w)
print(*minim)


import math
import bisect
from collections import defaultdict
from collections import OrderedDict
from itertools import combinations
n = int(input())

def factors(x):
	res = []
	i = 1
	while i * i <= x:
		if x % i == 0:
			res.append(i)
			if x // i != i:
				res.append(x // i)
		i += 1
	return res
fac = factors(n)
ans = 10000000000000.0
for i in range(len(fac)):
	if n // math.gcd(fac[i], n // fac[i]) == n:
		z = max(fac[i], n // fac[i])
		if z <= ans:
			a = fac[i]
			b = n // fac[i]
			ans = z
print(a, b)


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


def div(x):
	a = dict()
	i = 2
	x_a = x
	while i * i <= x_a:
		if x % i == 0:
			if i in a:
				a[i] = a[i] * i
			else:
				a[i] = i
			x //= i
		else:
			i += 1
	if x != 1:
		if x in a:
			a[x] = a[x] * x
		else:
			a[x] = x
	return a

def check(i, a, x):
	b = bin(i)[2:]
	b = '0' * (len(a) - len(b)) + b
	ans = 1
	for i in range(len(a)):
		if b[i] == '1':
			ans *= a[i]
	return max(ans, x // ans)
x = int(input())
a = div(x)
ans = 10 ** 13
b = []
for i in a:
	b.append(a[i])
for i in range(2 ** len(a)):
	ans = min(ans, check(i, b, x))
print(x // ans, ans)


import sys
import math

def get(l, check, a, b, i, n):
	if i == n:
		check.append([a, b])
	else:
		get(l, check, a * l[i], b, i + 1, n)
		get(l, check, a, b * l[i], i + 1, n)

def get_primes(n):
	l = []
	a = 1
	while n % 2 == 0:
		n = n // 2
		a = a * 2
	if a != 1:
		l.append(a)
	for i in range(3, int(math.sqrt(n)) + 2):
		a = 1
		while n % i == 0:
			n = n // i
			a = a * i
		if a != 1:
			l.append(a)
	if n > 2:
		l.append(n)
	return l
n = int(sys.stdin.readline())
l = get_primes(n)
l.sort()
(a, b) = (1, 1)
i = len(l) - 1
while i >= 0:
	if a > b:
		b = b * l[i]
		i -= 1
	else:
		a = a * l[i]
		i -= 1
check = []
get(l, check, 1, 1, 0, len(l))
(a, b) = check[0]
for i in range(1, len(check)):
	if abs(check[i][1] - check[i][0]) < abs(a - b):
		(a, b) = check[i]
print(a, b)


import math
x = int(input())
a = 10 ** 6
aa = []
bb = []
maxofab = []
while a >= 1:
	if x % a == 0:
		b = x // a
		if math.gcd(a, b) == 1:
			lcm = x
			aa.append(a)
			bb.append(b)
			maxofab.append(max(a, b))
	a -= 1
m = min(maxofab)
ind = maxofab.index(m)
print(aa[ind], bb[ind])


import math
from collections import Counter

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

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

def printDivisors(n):
	i = 1
	l = []
	while i <= math.ceil(math.sqrt(n)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
		i = i + 1
	return l
n = int(input())
m = 1000000000001
r = printDivisors(n)
for i in r:
	if m > max(i, n // i) and lcm(i, n // i) == n:
		m = max(i, n // i)
		a = i
		b = n // i
e = min(a, b)
f = max(a, b)
print(e, f)


import math

def lcm(x, y):
	return x * y / gcd(x, y)

def gcd(x, y):
	if x == 0:
		return y
	return gcd(y % x, x)
X = int(input())
pairs = []
for i in range(1, int(math.sqrt(X)) + 1):
	if X % i == 0:
		a = i
		b = int(X / i)
		pairs.append((a, b))
minimum = float('Inf')
for i in pairs:
	if lcm(i[0], i[1]) == X:
		maximum = max(i[0], i[1])
		if minimum > maximum:
			minimum = maximum
			t1 = min(i[0], i[1])
			t2 = maximum
print(t1, t2)


import sys
import math
import heapq
import collections

def inputnum():
	return int(input())

def inputnums():
	return map(int, input().split())

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

def inputstring():
	return [x for x in input()]

def inputstringnum():
	return [ord(x) - ord('a') for x in input()]

def inputmatrixchar(rows):
	arr2d = [[j for j in input().strip()] for i in range(rows)]
	return arr2d

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d

def computeGCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
x = inputnum()
i = 1
a = 0
while i * i <= x:
	if x % i == 0 and computeGCD(x // i, i) == 1:
		a = i
	i += 1
print(a, x // a)


import math

def inp(dtype=str, strip=True):
	s = input()
	res = [dtype(p) for p in s.split()]
	res = res[0] if len(res) == 1 and strip else res
	return res

def problem1():
	n = inp(int)
	s = inp()
	print(n + 1)

def problem2():
	t = inp(int)
	for _ in range(t):
		n = inp(int)
		a = inp(int, strip=False)
		s1 = sum(a)

		def search(b):
			(mx, cur) = (-10 ** 10, 0)
			for el in b:
				cur += el
				if cur > mx:
					mx = cur
				if cur < 0:
					cur = 0
			return mx
		s2 = max(search(a[:-1]), search(a[1:]))
		if s1 > s2:
			print('YES')
		else:
			print('NO')

def problem3():
	x_raw = inp(int)
	x = x_raw
	(p, k) = ([], [])
	for j in range(2, int(math.sqrt(x)) + 2):
		power = 0
		while x % j == 0:
			x = x // j
			power += 1
		if power > 0:
			p.append(j)
			k.append(power)
	if x > 1:
		p.append(x)
		k.append(1)

	def find(p, k, pos, tp):
		if pos == len(p):
			(x1, x2) = (1, 1)
			for i in range(len(p)):
				num = p[i] ** k[i]
				if tp[i]:
					x1 *= num
				else:
					x2 *= num
			return max(x1, x2)
		tp[pos] = 0
		res1 = find(p, k, pos + 1, tp)
		tp[pos] = 1
		res2 = find(p, k, pos + 1, tp)
		return min(res1, res2)
	tp = [0 for i in range(len(p))]
	res = find(p, k, 0, tp)
	print(res, x_raw // res)

def problem4():
	n = inp(int)
	a = inp(int, strip=False)
	a = [bin(el)[2:] for el in a]
	a = [[int(s) for s in el] for el in a]
	m = max([len(el) for el in a])
	a = [[0 for _ in range(m - len(el))] + el for el in a]
	res = [0 for _ in range(m)]

	def solve(p, r, pos):
		if pos == m:
			return 0
		n1 = sum([el[pos] for el in a[p:r + 1]])
		if n1 == 0:
			res[pos] = 0
			return solve(p, r, pos + 1)
		elif n1 == r - p + 1:
			res[pos] = 1
			return solve(p, r, pos + 1)
		else:
			q = r - n1
			k0 = solve(p, q, pos + 1)
			k1 = solve(q + 1, r, pos + 1)
			if k0 < k1:
				res[pos] = 1
				return 2 ** (m - pos - 1) + k0
			else:
				res[pos] = 0
				return 2 ** (m - pos - 1) + k1
	res = solve(0, len(a) - 1, 0)
	print(res)
problem3()


def gcd(a, b):
	while b != 0:
		(a, b) = (b, a % b)
	return a
x = int(input())
a = []
for i in range(1, int(x ** 0.5 + 1)):
	if x % i == 0:
		a.append(i)
a.sort(reverse=True)
for i in range(len(a)):
	if gcd(a[i], x // a[i]) == 1:
		print(a[i], x // a[i])
		exit()


n = int(input())
import math
ma = float('inf')
aa = bb = 0
for i in range(1, int(math.sqrt(n)) + 1):
	if n % i == 0 and n / math.gcd(i, n // i) == n:
		a = i
		b = n // i
		if max(a, b) < ma:
			(aa, bb) = (a, b)
			ma = max(a, b)
print(aa, bb)


import math
(n,) = map(int, input().split())
s = []
for i in range(2, math.ceil(math.sqrt(n))):
	if n % i == 0 and i * (n // i) // math.gcd(i, n // i) == n:
		s.append([i, n // i])
if len(s) > 0:
	k = 1000000000000
	s.sort()
	ind = 0
	for i in range(len(s)):
		if k > max(s[i][0], s[i][1]):
			k = max(s[i][0], s[i][1])
			ind = i
	print(s[ind][0], s[ind][1])
else:
	print(1, n)


import math
x = int(input())
d = int(x ** 0.5) + 1
while d > 0:
	if x % d == 0:
		if math.gcd(x // d, d) == 1:
			print(x // d, d)
			break
	d -= 1


from math import gcd, floor
e = int(input())
r = 0
i = 1
while i ** 2 <= e:
	if not e % i:
		f = floor(e / i)
		l = i / gcd(i, f) * f
		if l == e:
			r = i
	i += 1
print(r, ' ', floor(e / r))


x = int(input())
ans1 = 1
ans2 = x
ans3 = x
lis = []
cnt = 0
for i in range(2, int(x ** 0.5) + 2):
	while x % i == 0:
		x //= i
		cnt += 1
	if cnt > 0:
		lis.append([i, cnt])
		cnt = 0
if x != 1:
	lis.append([x, 1])

def two(i):
	q = '0' * (len(lis) - len(bin(i)[2:])) + bin(i)[2:]
	return q
for i in range(2 ** len(lis)):
	a = b = 1
	for j in range(len(lis)):
		if two(i)[j] == '1':
			a *= lis[j][0] ** lis[j][1]
		else:
			b *= lis[j][0] ** lis[j][1]
	if max(a, b) < ans3:
		ans1 = a
		ans2 = b
		ans3 = max(a, b)
print(ans1, ans2)


import math
x = int(input())
if x == 1:
	print(1, '', 1)
else:
	i = int(math.sqrt(x))
	if i * i == x:
		i -= 1
	flag = 0
	while flag == 0:
		if i > int(x / i):
			larger = i
			smaller = int(x / i)
		else:
			larger = int(x / i)
			smaller = i
		if smaller == 1:
			print(i, '', int(x / i))
			flag = 1
			break
		elif x % i == 0 and math.gcd(larger, smaller) == 1:
			print(i, '', int(x / i))
			flag = 1
			break
		i -= 1


import fractions
x = int(input())
a1 = 1000000000001
a2 = 1000000000001
maxi = a1
for i in range(1, 1000001):
	if x % i == 0:
		j = x // i
		if fractions.gcd(i, j) == 1 and max(i, j) < maxi:
			maxi = max(i, j)
			a1 = i
			a2 = j
print(a1, a2)


from math import floor, sqrt
try:
	long
except NameError:
	long = int

def fac(n):
	step = lambda x: 1 + (x << 2) - (x >> 1 << 1)
	maxq = long(floor(sqrt(n)))
	d = 1
	q = 2 if n % 2 == 0 else 3
	while q <= maxq and n % q != 0:
		q = step(d)
		d += 1
	return [q] + fac(n // q) if q <= maxq else [n]
import collections
import bisect
n = int(input())
if n == 1:
	print(1, 1)
else:
	a = fac(n)
	b = collections.Counter(a)
	c = []
	for i in b.keys():
		c.append(i ** b[i])
	d = [1]
	e = []
	for i in c:
		for j in d:
			e.append(j)
			e.append(i * j)
		d = e
		e = []
	d.sort()
	k = bisect.bisect_left(d, int(n ** 0.5) + 1)
	print(n // d[k], d[k])


def primes(n):
	dick = {}
	while n % 2 == 0:
		dick[2] = dick.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 1, 2):
		while n % i == 0:
			dick[i] = dick.get(i, 0) + 1
			n = n // i
	if n > 2:
		dick[n] = dick.get(n, 0) + 1
	return dick

def combs(this, index, curr):
	global ans
	if index == len(this):
		ans.append(curr)
		return
	combs(this, index + 1, curr * this[index])
	combs(this, index + 1, curr)
n = int(input())
dick = primes(n)
array = []
for i in dick:
	array.append(i ** dick[i])
index = 0
curr = 1
ans = []
combs(array, index, curr)
answer = 10000000000000.0
for i in ans:
	answer = min(answer, max(i, n // i))
print(min(answer, n // answer), max(answer, n // answer))


import math
n = int(input())
if n == 1:
	print('1 1')
elif n == 2:
	print('1 2')
elif n == 3:
	print('1 3')
elif n == 4:
	print('1 4')
elif n == 5:
	print('1 5')
else:
	m = n + 1
	t1 = 0
	t2 = 0
	for j in range(1, math.ceil(math.sqrt(n)) + 1):
		if n % j == 0:
			n1 = n // j
			if max(j, n1) < m:
				if math.gcd(j, n1) == 1:
					m = max(n, n1)
					t1 = j
					t2 = n1
	print(t1, t2, end=' ')


import math

def lcm(a, b):
	return a * b // math.gcd(a, b)
n = int(input())
num = int(math.sqrt(n))
fac = n
for i in range(1, num + 1):
	if n % i == 0 and lcm(n // i, i) == n:
		fac = i
print(fac, n // fac)


from math import sqrt, gcd

class LCM:
	lcm = 0

	def ab(self):
		n = int(sqrt(self.lcm)) + 1
		for a in range(n, 0, -1):
			if not self.lcm % a:
				b = self.lcm // a
				if gcd(a, b) == 1:
					print(a, b)
					return 0

def main():
	solve = LCM()
	solve.lcm = int(input())
	solve.ab()
main()


import math
ans = []

def printDivisors(n):
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				ans.append(i)
			else:
				ans.append(i)
				ans.append(n // i)
		i = i + 1
q = int(input())
printDivisors(q)
ans.sort()
a = 2e+18
b = 2e+18
for t in ans:
	if math.gcd(t, q // t) == 1:
		if max(t, q // t) < max(a, b):
			a = t
			b = q // t
print(a, b)


def nod(a, b):
	if a % b == 0:
		return b
	return nod(b, a % b)
x = int(input())
d = 1
mx = 100000000000000000000000000
while d * d <= x:
	if x % d == 0:
		s = x // d
		if nod(s, d) != 1:
			d += 1
			continue
		mx = min(mx, max(s, d))
	d += 1
print(x // mx, mx)


from math import *

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

def main():
	n = int(input())
	i = 2
	an = 1
	while i * i < n:
		if n % i == 0 and lcm(i, n // i) == n:
			an = i
		i += 1
	print(n // an, an)
main()


from math import sqrt

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
x = int(input())
ma = 1
for i in range(2, int(sqrt(x)) + 1):
	if x % i == 0 and i * (x // i) // gcd(i, x // i) == x:
		ma = i
print(ma, x // ma)


import math
x = int(input())
p = []
for i in range(1, int(x ** 0.5) + 1):
	if x % i == 0:
		if i * x // i / math.gcd(i, x // i) == x:
			p = [i, x // i]
print(' '.join(map(str, p)))


def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
n = int(input())
t = 0
for i in range(1, int(n ** 0.5) + 1):
	if n % i == 0:
		a = i
		b = int(n / i)
		GCD = gcd(a, b)
		if GCD == 1:
			t = i
print(t, int(n / t))


import math

def compute_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def compute_lcm(x, y):
	lcm = x * y // compute_gcd(x, y)
	return lcm
el = int(input())
square_root = math.ceil(math.sqrt(el))
a = 1
b = el
for i in range(1, square_root + 1):
	if el % i == 0:
		if compute_lcm(i, int(el / i)) == el:
			a = i
			b = int(el / i)
print(a, b)


from math import *
from itertools import combinations

def factor(x):
	f = [1]
	sq = sqrt(x)
	i = 2
	while i <= sq and x > 1:
		res = 1
		while x % i == 0:
			res *= i
			x //= i
		if res > 1:
			f.append(res)
		i += 1
	if x > 1:
		f.append(x)
	return f

def mul(a, i, j):
	res = 1
	for t in range(i, j + 1):
		res *= a[t]
	return res

def mu(a):
	res = 1
	for i in a:
		res *= i
	return res
X = int(input())
fa = factor(X)
le = len(fa)
fa.sort()
if le > 1:
	mV = X
	ans = [1, X]
	for i in range(1, le):
		comb = combinations(fa, i)
		for c in comb:
			a = mu(c)
			b = X // a
			if max(a, b) < mV:
				ans = [a, b]
				mV = max(a, b)
		i += 1
	print(' '.join(map(str, ans)))
else:
	print(1, X)


n = int(input())
arr = [1]
i = 1

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
(ans_a, ans_b) = (1, 1)
while i * i < n:
	if n % i == 0:
		a = i
		b = n // i
		if gcd(a, b) == 1:
			(ans_a, ans_b) = (a, b)
	i += 1
print(ans_a, ans_b)


from math import sqrt, gcd
x = int(input().strip())
p = int(sqrt(x)) + 1
while p > 1:
	if x % p == 0 and gcd(p, x // p) == 1:
		break
	p -= 1
print(p, x // p)


import math
n = int(input())
ans = float('inf')
if n == 1:
	print(1, 1)
else:
	for i in range(1, int(math.sqrt(n)) + 1):
		if n % i == 0:
			p = max(i, n // i)
			g = n / math.gcd(i, n // i)
			if i != n // i and g == n:
				ans = min(ans, p)
	print(n // ans, ans)


import math
x = int(input())
res = []

def lcm(i, j):
	x = i * j / math.gcd(i, j)
	return x
sq = int(x ** (1 / 2))
res = x
for i in range(2, sq + 1):
	if x % i == 0:
		if lcm(i, x // i) == x:
			res = min(res, max(i, x // i))
print(x // res, res)


from sys import *
import math

def fadi_lcm():
	x = int(input())
	y = int(math.sqrt(x))
	if y * y == x and y > 1:
		y = y - 1
	i = 0
	while i < y:
		if x % (y - i) == 0 and math.gcd(y - i, int(x / (y - i))) == 1:
			print(y - i, int(x / (y - i)))
			break
		else:
			i = i + 1
fadi_lcm()


import math
i1 = int(input())
a = 1
b = i1
for i in range(2, int(i1 ** (1 / 2)) + 1):
	if i1 % i == 0 and math.gcd(i, i1 // i) == 1:
		a = i
		b = i1 // i
print(a, b)


from math import inf

def factors(n):
	from functools import reduce
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
n = int(input())
facs = factors(n)
ans = [inf, inf]
for f in facs:
	(a, b) = (f, n // f)
	if a * b // gcd(a, b) == n:
		if max(a, b) < max(ans):
			ans = [a, b]
print(*sorted(ans))


x = int(input())
from math import gcd
arr = []
s = set()
ans = [1, x]
y = x
lo_so_far = x
for i in range(2, int(x ** 0.5) + 2):
	if x % i == 0:
		c = i
		z = x // i
		if x == c * z // gcd(c, z):
			lo = max(c, z)
			if lo < lo_so_far:
				lo_so_far = lo
				ans = (c, z)
print(ans[0], ans[1])


from math import sqrt
N = int(input())
a = int(sqrt(N))
b = 0

def GCD(a, b):
	if b == 0:
		return a
	else:
		return GCD(b, a % b)
while True:
	b = N // a
	if (N % a == 0 and a * a != N or a == 1) and GCD(a, b) == 1:
		break
	else:
		a -= 1
print(a, b)


def fadi_lcm():
	x = int(input())
	if x == 1:
		values = (1, 1)
	else:
		values = (10 ** 12, 10 ** 12)
		for i in range(1, int(x ** 0.5) + 1):
			if x % i == 0:
				if lcm(i, x // i) == x:
					p_max = max(i, x // i)
					if p_max < max(values) and i != x // i:
						values = (i, x // i)
	print(*values)

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

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


def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	return x // gcd(x, y) * y
x = int(input())
ans = 1
i = 1
while i * i <= x:
	if x % i == 0 and lcm(i, x // i) == x:
		ans = i
	i += 1
print(' '.join([str(ans), str(x // ans)]))


import math
x = int(input())
y = math.sqrt(x)
a = [1]
for i in range(2, int(y) + 1):
	if x % i == 0:
		a.append(i)
a.reverse()
for i in range(len(a)):
	if math.gcd(a[i], x // a[i]) == 1:
		print(a[i], x // a[i])
		break


import math
n = int(input())
m = int(math.sqrt(n))
for i in range(m, 0, -1):
	if n % i == 0:
		j = n // i
		k = i
		t = max(j, k) % min(j, k)
		while t != 0:
			k = min(j, k)
			j = t
			t = max(j, k) % min(j, k)
		if j == 1:
			break
print('%d %d' % (i, n // i))


import math

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def main():
	n = int(input())
	ans = 10000000000000
	nq = int(math.sqrt(n))
	nq = nq + 1
	for i in range(2, nq + 1):
		if n % i == 0:
			a = i
			b = n / i
			temp = gcd(a, b)
			if temp == 1:
				m = max(a, b)
				ans = min(ans, m)
	if ans == 10000000000000:
		print(str(n) + ' 1')
	else:
		print(str(int(ans)) + ' ' + str(int(n / ans)))
main()


x = int(input())
import math
ans1 = 1
ans2 = x
for i in range(int(math.sqrt(x) + 1), 0, -1):
	if x % i == 0 and math.gcd(i, x // i) == 1:
		ans1 = i
		ans2 = x // i
		break
print(min(ans2, ans1), max(ans1, ans2))


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 list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
from math import gcd
INF = 10 ** 18
MOD = 10 ** 9 + 7

def lcm(a, b):
	return a * b // gcd(a, b)
n = int(ri())
fdif = -1
dif = INF
p = 1
while p * p <= n:
	if n % p == 0:
		fir = p
		las = n // p
		if lcm(fir, las) == n:
			if las < dif:
				fdif = fir
				dif = las
	p += 1
print(fdif, dif)


import math

class Read:

	@staticmethod
	def string():
		return input()

	@staticmethod
	def int():
		return int(input())

	@staticmethod
	def list(sep=' '):
		return input().split(sep)

	@staticmethod
	def list_int(sep=' '):
		return list(map(int, input().split(sep)))

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

def solve():
	x = Read.int()
	if x < 6:
		print('1 ' + str(x))
	else:
		i = math.floor(math.sqrt(x))
		if i * i == x:
			i -= 1
		while True:
			t = x // i
			if x % i == 0 and lcm(i, t) == x:
				print('{} {}'.format(i, x // i))
				return
			i -= 1
query_count = 1
while query_count:
	query_count -= 1
	solve()


n = int(input())
i = 1
d = []
while i * i <= n:
	if n % i == 0:
		d.append(i)
	i += 1
d.reverse()

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

def lcm(a, b):
	return a * b // gcd(a, b)
for u in d:
	if lcm(u, n // u) == n:
		print(u, n // u)
		exit(0)


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

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

def div(n):
	q = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				q.append(i)
			else:
				q.append(i)
				q.append(n // i)
		i = i + 1
	return q
import math
x = int(input())
l = div(x)
l.sort()
d = {}
ans = 10 ** 13
for i in range(len(l)):
	u = x // l[i]
	if l[i] in d:
		break
	else:
		d[l[i]] = 1
	if lcm(l[i], u) == x:
		temp = max(l[i], u)
		ans = min(ans, temp)
print(ans, x // ans)


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

def lcm(a, b):
	return a * b / gdc(a, b)
a = int(input())
maxima = 0
for i in range(1, int(a ** 2 ** (-1)) + 1):
	if a % i == 0 and lcm(i, a // i) == a:
		maxima = max(maxima, i)
print(maxima, a // maxima)


import math
num = int(input())
x1 = int(math.sqrt(num))
if num == 1:
	print('1 1')
else:
	for i in range(x1, 0, -1):
		if num % i == 0:
			if num // i == i:
				continue
			if i * (num // i) // math.gcd(i, num // i) != num:
				continue
			print(num // i, i)
			break


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
import sys
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
n = int(input())
mini = inf
a = -1
b = -1
for i in range(1, int(sqrt(n)) + 1):
	if n % i == 0:
		g = i * (n // i) // gcd(n // i, i)
		if g == n:
			mini = min(mini, max(i, n // i))
			if mini == max(i, n // i):
				a = i
				b = n // i
print(a, b)


import sys
import math as mt
input = sys.stdin.buffer.readline
t = 1
for ___ in range(t):
	x = int(input())
	x1 = x
	i = 2
	d = []
	d.append(1)
	while i * i <= x:
		if x % i == 0:
			d.append(i)
			if i != x // i:
				d.append(x // i)
		i += 1
	(a, b) = (10 ** 12 + 1, 10 ** 12 + 1)
	for i in d:
		if mt.gcd(i, x // i) == 1:
			if max(i, x // i) < max(a, b):
				a = i
				b = x // i
	print(a, b)


import math as m
n = int(input())
k = int(n ** 0.5)
a = 0
b = 0
c = 100000000000000
for i in range(1, k + 1):
	if n % i == 0:
		if m.gcd(i, n // i) == 1:
			if max(i, n // i) < c:
				c = max(i, n // i)
				a = i
				b = n // i
print(a, b)


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

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

def fadi(x):
	ans = []
	d = 2
	while d * d <= x:
		if x % d == 0:
			if lcm(d, x // d) == x:
				ans.append((d, x // d))
		d += 1
	return ans
x = int(input())
y = fadi(x)
if y == []:
	print(1, x)
else:
	final = y[0]
	for obj in y:
		if max(obj) <= max(final):
			final = obj
	print(*final)


def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
import math
n = int(input())
ans = 10000000000000
k = [1, n]
for i in range(2, math.ceil(math.sqrt(n))):
	if n % i == 0:
		h = n // i
		if ans > h and gcd(h, i) == 1:
			ans = n // i
			k = [i, ans]
print(*k)


from math import sqrt
import sys
sys.setrecursionlimit(1000000)
X = int(input())
X_backup = X
limit = int(sqrt(X)) + 1
is_prime = [True for _ in range(limit)]
prime = []
factor = []
for x in range(2, limit):
	if is_prime[x]:
		prime.append(x)
		if X % x == 0:
			factor.append(1)
			while X % x == 0:
				X //= x
				factor[-1] *= x
	for p in prime:
		if p * x >= limit:
			break
		is_prime[p * x] = False
		if x % p == 0:
			break
if X != 1:
	print('%d %d\n' % (X_backup // X, X))
	sys.exit(0)
ans = X_backup
for plan in range(1 << len(factor)):
	a = 1
	for (idx, val) in enumerate(factor):
		if plan & 1 << idx > 0:
			a *= val
	a = max(a, X_backup // a)
	ans = min(ans, a)
print('%d %d\n' % (X_backup // ans, ans))


import math

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
x = int(input())
a = int(math.sqrt(x))
ans = []
a1 = []
b1 = []
for i in range(1, a + 1):
	if x % i == 0:
		a = i
		b = x // i
		if gcd(b, a) == 1:
			ans.append(max(a, b))
			a1.append(a)
			b1.append(b)
print(a1[ans.index(min(ans))], end=' ')
print(b1[ans.index(min(ans))], end=' ')
print()


import sys
input = sys.stdin.readline
x = int(input())
y = x
ANS = x + 1
AX = [0, 0]
import math
L = int(math.sqrt(x))
FACT = dict()
for i in range(2, L + 2):
	while x % i == 0:
		FACT[i] = FACT.get(i, 0) + 1
		x = x // i
if x != 1:
	FACT[x] = FACT.get(x, 0) + 1
x = y
LEN = len(FACT)
LIST = list(FACT.keys())
for i in range(1 << LEN):
	sc = 1
	for j in range(LEN):
		if i & 1 << j != 0:
			sc *= LIST[j] ** FACT[LIST[j]]
	if ANS > max(sc, x // sc):
		ANS = max(sc, x // sc)
		AX = [sc, x // sc]
print(*AX)


from sys import stdin, stdout
from math import gcd, ceil, sqrt
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
n = ii1()
res = n
for i in range(1, int(sqrt(n)) + 1):
	if n % i == 0:
		a = i
		b = n // i
		if a * b // gcd(a, b) == n:
			res = min(res, max(n % i, n // i))
print(res, n // res)


import sys
LI = lambda : list(map(int, sys.stdin.readline().split()))
MI = lambda : map(int, sys.stdin.readline().split())
SI = lambda : sys.stdin.readline().strip('\n')
II = lambda : int(sys.stdin.readline())
from math import sqrt

def gcd(a, b):
	return a if b == 0 else gcd(b, a % b)
x = II()
ans = (1, x)
for i in range(2, int(sqrt(x)) + 1):
	if x % i == 0:
		(a, b) = (i, x // i)
		if a * b // gcd(a, b) == x:
			ans = (a, b) if max(a, b) < max(ans) else ans
print(*ans)


from fractions import gcd

def lcm(a, b):
	return a * b // gcd(a, b)
x = int(input())
for i in range(1, int(x ** 0.5) + 1):
	if x % i == 0 and lcm(i, x // i) == x:
		ans = i
print(ans, x // ans)


import math

def fun(n):
	l = [1]
	x = 1
	while n % 2 == 0:
		x *= 2
		n = n / 2
	if x > 1:
		l.append(x)
	sq = math.sqrt(n)
	i = 3
	while i < sq + 1 + 1:
		x = 1
		if n % i == 0:
			j = n // i
			while n % i == 0:
				x *= i
				n = n / i
			if x > 1:
				l.append(x)
		i += 2
	if n > 1:
		l.append(n)
	return l
n = int(input())
ff = fun(n)
fa = 1e+20
fb = 1e+20
for x in range(1 << len(ff)):
	a = 1
	b = 1
	for i in range(len(ff)):
		if x & 1 << i != 0:
			a *= ff[i]
		else:
			b *= ff[i]
	if max(fa, fb) > max(a, b):
		(fa, fb) = (a, b)
print(int(fa), int(fb))


import math
nn = int(input())
k = int(nn ** (1 / 2))
for i in reversed(range(k + 2)):
	if nn % i == 0 and math.gcd(i, nn // i) == 1:
		print(i, nn // i)
		break


import math

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

def factorize(x):
	i = int(math.sqrt(x))
	while i > 0:
		if x % i == 0 and gcd(i, x // i) == 1:
			return (i, x // i)
		i -= 1
X = int(input())
(a, b) = factorize(X)
print(a, b)


mod = 10 ** 9 + 7
import math
from collections import Counter
from itertools import combinations

def ain():
	return map(int, input().split())

def fain():
	return map(float, input().split())

def primeFactors(n):
	if n == 1:
		return [1]
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(int(i))
			n = n / i
	if n > 2:
		l.append(int(n))
	return l
x = int(input())
a = 1
b = x
for i in range(1, int(math.sqrt(x)) + 1):
	if x % i == 0 and math.gcd(i, x // i) == 1:
		a = i
		b = x // i
print(a, b)


import math
x = int(input())
a = int(math.sqrt(x))
while True:
	if x % a == 0 and math.gcd(a, int(x / a)) == 1:
		print(a, int(x / a))
		break
	else:
		a -= 1


n = int(input())
prime_factors = {}
while n % 2 == 0:
	if 2 not in prime_factors:
		prime_factors[2] = 0
	prime_factors[2] += 1
	n /= 2
p = 3
while n > 1:
	while n % p == 0:
		if p not in prime_factors:
			prime_factors[p] = 0
		prime_factors[p] += 1
		n /= p
	if p * p > n:
		if int(n) not in prime_factors:
			prime_factors[int(n)] = 0
		prime_factors[int(n)] += 1
		break
	p += 2
a = 1
b = 1
nums = sorted([key ** occ for (key, occ) in prime_factors.items() if key * occ != 1])

def rec(a, b, nums):
	if len(nums) == 0:
		return (a, b)
	curr = nums[-1]
	nums.remove(curr)
	best_a = rec(a, b * curr, nums)
	best_b = rec(a * curr, b, nums)
	nums.append(curr)
	if max(best_a) < max(best_b):
		a = best_a[0]
		b = best_a[1]
	else:
		a = best_b[0]
		b = best_b[1]
	return (a, b)
(a, b) = rec(1, 1, nums)
print('{} {}'.format(a, b))


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

def lcm(a, b):
	return a * b / gcd(a, b)
n = int(input())
ans = n
for i in range(1, int(n ** 0.5) + 1):
	if n % i == 0 and lcm(i, int(n / i)) == n:
		temp = max(i, int(n / i))
		if temp < ans:
			ans = temp
print(ans, int(n / ans))


from math import gcd

def prime(n):
	a = []
	for i in range(1, int(n ** (1 / 2)) + 1):
		if i == 1:
			if n % i == 0:
				if i * int(n / i) / gcd(i, int(n / i)) == n:
					a.append([1, n / i])
		elif i * int(n / i) / gcd(i, int(n / i)) == n:
			a.append([i, n / i])
	return a
n = int(input())
a = prime(n)
if len(a) == 1:
	print(a[0][0], int(a[0][1]))
else:
	print(a[len(a) - 1][0], int(a[len(a) - 1][1]))


import collections

def decompose(n):
	ans = []
	i = 2
	while i * i <= n:
		cur = 0
		while n % i == 0:
			n //= i
			cur += 1
		if cur > 0:
			ans.append(i ** cur)
		i += 1
	if n != 1:
		ans.append(n)
	return ans

def solve():
	n = int(input())
	if n == 1:
		print('1 1')
		return
	l = decompose(n)
	if len(l) == 1:
		print('1', n)
	else:
		cur = [1, n]
		ans = n
		combs = [[]]
		for num in l:
			for comb in combs[:]:
				tmp = comb + [num]
				s = 1
				for c in tmp:
					s *= c
				if max(s, n // s) < ans:
					ans = max(s, n // s)
					cur = [s, n // s]
				combs.append(tmp)
		print(cur[0], cur[1])
for _ in range(1):
	solve()