x, y = map(int, input().split()) if x > y: z = (x+4)%12 else: z = (y+4)%12 print(z)