import random import sys def make_testcase(): C = [] for i in range(2048): C.append([int(i) for i in input().split()]) # sub = [] # for j in range(3): # sub.append(random.randrange(256)) # sub.append(random.randint(0, 1)) # C.append(sub[:]) return C C = make_testcase() k = 0 nowans = k nowscore = 0 table = [C[0]] # print(table) ends = 3 while 1: if ends == 0: break ends -= 1 for row in table: if k >> row[0] & 1 == row[1]: continue if k >> row[2] & 1 == row[3]: continue if k >> row[4] & 1 == row[5]: continue tar = random.choice(row[::2]) k ^= 1 << tar break else: nowscore += 1 nowans = k # print(f"score={nowscore} sol={bin(k)[2:]}", file=sys.stderr) table.append(C[nowscore]) ends = 6 * (nowscore + 1) print(bin(k)[2:])