v = list()

i = 0
for i in range(10):
    
    a = int(input())
    b = int(input())
    if ((a+b) % 2 == 0):
        if (a % 2 == 0):
            v.append((a/2) + (b/2))
            v.append((a/2) - (b/2))
        else:
            v.append((a/2 + (b+1)/2))
            v.append((a/2) - (b/2))

for i in range(20):
    print(v[i])
