# p, q = map(int,input().split())
# n = int(input())
# l = list(map(int, input().split()))
for i in range(10):
	num=int(input())
	diff=int(input())
	print(int((num-diff)/2  +diff))
	print(int((num-diff)/2))

# print(100**10000)