<gh_stars>1-10
total = int(input())
diff = int(input())

print((total + diff) // 2)
print((total - diff) // 2)

total = int(input())
diff = int(input())

print((total + diff) // 2)
print((total - diff) // 2)