T=int(input())
for i in range(T):
s = input().split()
head = int(s[0])
foot = int(s[1])
rabbit=foot/2-head
chicken=2*head-foot/2
if rabbit>0 and chicken>0 and rabbit.is_integer():
print(int(chicken),int(rabbit))
else:
print('-1')