X,Y=map(int,input().split()) if X%4==0: S={0,4,8} elif X%4==1: S={1,5,9} elif X%4==2: S={2,6,10} else: S={3,7,11} T=S-{X,Y} print(*T)