import itertools lst = [0, 1] pattern = list(itertools.product([0,1], repeat=4)) # print(pattern) x, y = map(int, input().split()) xy = x*2 + y K = 4 vs = list(itertools.product([0,1], repeat=K)) # 処理列の候補 for v in vs: ok = True for p in pattern: ans01 = p[xy] now = v[0] for i in range(K-1): nxt = v[i+1] now = p[now*2 + nxt] if now != ans01: ok = False break if ok == True: print(K) ans = list(v) print(*ans) res = int(input()) print(res) exit()