x,y=map(int,input().split()) diff=max(x,y)-min(x,y) if 0<=max(x,y)+diff<12: print(max(x,y)+diff) else: print(min(x,y)-diff)