x,y = map(int, input().split()) for i in range(1, 3): if (x + i*4) %12 == y: pass else: print((x + i*4) % 12)