a = [] m = 12 for i in range(m): a.append({(0+i)%m,(4+i)%m,(8+i)%m}) n = set(map(int,input().split())) for i in a: if len(i^n)==1: print(*i^n) break