a=int(input()) if a%2==0: print("2 "+str(a//2)) else: print("3 "+str(a//3))