x,y=map(int,input().split()) print(3) print(x,y,y) k=int(input()) if k: print(x^1) else: print(x)