n=list(map(int,input().split())) print(*{4*i+n[0]%4 for i in range(3)}-set(n))