print(0,0,flush=True) a=int(input()) if a==0:exit() print(0,10**6,flush=True) b=int(input()) if b==0:exit() x=(a+b-10**6)//2 print(x,a-x,flush=True)