while 1:x,y=map(int,raw_input().split());print(y-x+179)%360-179