while True: try: n = int(input()) for j in range(n//2-3): a = n//2-1-j b = n//2+1+j a_status, b_status = True, True for i in range(2, a): if a % i == 0: a_status = False break for i in range(2, b): if b % i == 0: b_status = False break if a_status and b_status: print(a) print(b) break except: break