while True:
try:
a=list(map(int,input().split()))
if len(a)>1:
if int(str(a[0]+a[1])[::-1])==int(int(str(a[0])[::-1])+int(str(a[1])[::-1])):
print(a[0]+a[1])
else:
print("NO")
except:
break
try:
while 1:
for i in xrange(input()):
a, b = raw_input().split()
s1 = int(a[::-1]) + int(b[::-1])
s2 = int(str(int(a) + int(b))[::-1])
print 'NO' if s1 != s2 else int(a) + int(b)
except:
pass