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())
flag = 0
for i in range(n-1,1,-1):
    for j in range(i,1,-1):
        if lcm(i,j) == n:
            flag = 1
            print(i,j)
            break
    if flag == 1:
        break
else :
    print("1",n)
