a,b=map(int,input().split()) c=[a,b] c.append((a+4)%12) c.append((b+4)%12) for i in c: if i not in [a,b]: print(i) exit()