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