x, y = map(int, input().split()) match (x, y): case (0, 0): v = (0, 0, 0, 0) case (0, 1): v = (0, 1, 1, 1) case (1, 0): v = (1, 0, 0, 0) case (1, 1): v = (1, 1, 1, 1) print(4) print(*v, flush=True) t = int(input()) print(t, flush=True)