l=list(map(int,input().split())) l.sort() m=[[0,4,8],[1,5,9],[2,6,10],[3,7,11]] for x in m: if l[0] in x: s=x break for w in s: if w not in l: print(w)