while True:
try:
a, b = map(int,input().split())
if a-b > 50:
print(100+b-a)
elif b-a > 50:
print(a+100-b)
elif a>b:
print(a-b)
elif a<b:
print(b-a)
elif a == b and a>=0 and b>=0:
print(b-a)
else:
break
except:
break