# Efficient table-lookup computation

The challenge: compute the day of the week from a MM-DD representation of a day in this year (2021).

However, you have to write your program in the following subset of Python: (I chose Python because it's popular and easy to understand even to the people who doesn't know the language. Obviously you can use another program in another language to generate the program, and you're encouraged to post the source code of that program)

# This is the input. For example this represents the date 2021-01-28.
m1 = "0"
m2 = "1"
d1 = "2"
d2 = "8"

T = {
# T is a dict
# * each key must be a string of digits [0-9]
# * each value must be a single digit.
"1234": "1",
"5678": "2",
}

# The main program code.
# Each line must have the format:
# <variable_name> = T[<string formed by concatenating string literals or other variables>]
# Example:
variable_1 = T["12" + m1 + "3" + "4"]
output = T[variable_1]

# This must be exactly one print statement like this at the end of the program
print(output)


Background: This is basically the only way Preproc (the C/C++ preprocessor) can parse tokens. See how Boost's BOOST_PP_INC_I macro is implemented.

• You can (and should!) submit multiple programs in one answer if the method that you use to generate these programs are similar.
• You can reassign variables, but doing that will not make your score better (than labeling each usage of the variables a_1, a_2, a_3, ....
• To be clear (this is implied by the rules), you're not allowed to do x = "0" or x = y + z; only x = T[...] is allowed.
• The output should be 0 if the day is Monday, 1 if the day is Tuesday, ..., 6 if the day is Sunday.
• The program must not raise an error given valid input data.

### Winning criteria

Let A about the number of entries in the dict T, and B be the number of assignment instructions (excluding the input assignment instructions to m1, m2, d1, d2 but including the final assignment to output).

You should minimize both A and B.

Note that you can make the length of the keys of the dict T arbitrarily long and it doesn't make the score worse; however it doesn't make the score better either.

Because there isn't a consensus on whether it's allowed to have 2 separate winning criteria, the method to calculate the score is described in this meta answer ("Solution 2"), with the board size 10000 10000. -- For example, if you have a program with A=100 and B=100, enter into the input of the score calculation program

10000 10000
100 100


and the calculated result is 1970199.

## Score: (5, 1), (4, 2), (3, 3) -> 999, Combined score: 999, Combined score improvement: 99

• Score: The (A, B) parameters of your generated program(s), and (optionally) the computed score of all your generated programs.
• Combined score: the computed score of all the generated programs of the whole community (all answers posted so far) (you can easily calculate the "combined score" by taking the most recent/best combined score answer, then modify the score-list to add your program's scores. Also you should add a link to the score calculation program with your generated programs' scores as input)
• Combined score improvement: the difference between the most-recent computed score and the current combined score.

This is not a requirement, but just in case someone want to write a visualization/leaderboard script. (I intend to have it like this)

### Program to verify submissions

Note that this program does not verify that the provided program is inside the subset, only if the output is valid.

• Sandbox link: codegolf.meta.stackexchange.com/a/20687/69850 Feb 13, 2021 at 11:26
• As you can see there's a trivial (365, 1) solution, but what should I do with it? Feb 13, 2021 at 11:27
• I think you can post it as community wiki (or let someone else post it). Feb 13, 2021 at 13:05
• A=20?? I can't see how to encode the months in less than 12, and you still need to do something about the days, which is at least another 10... and then you need to combine the months and days... suffice it to say that my best A so far is 52, but given my B is now 43, that's not very helpful.
– Neil
Feb 14, 2021 at 10:44
• (I created a separate chat room for the challenge: Efficient table-lookup computation -- discussion room | chat.stackexchange.com) Feb 15, 2021 at 2:29

# Score: 679685 (A=64, B=6)

T = {
# three digits: first day of the month, 0-based (12 entries)
"001": "4", "002": "0", "003": "0", "004": "3", "005": "5", "006": "1", "007": "3", "008": "6", "009": "2", "010": "4", "011": "0", "012": "2",
# two digits ab: lookup table for (a + b) % 7 (52 entries)
"00": "0", "01": "1", "02": "2", "03": "3", "04": "4", "05": "5", "06": "6",
"10": "1", "11": "2", "12": "3", "13": "4", "14": "5", "15": "6", "16": "0",
"20": "2", "21": "3", "22": "4", "23": "5", "24": "6", "25": "0", "26": "1",
"30": "3", "31": "4", "32": "5", "33": "6", "34": "0", "35": "1", "36": "2",
"40": "4", "41": "5", "42": "6", "43": "0", "44": "1", "45": "2", "46": "3",
"50": "5", "51": "6", "52": "0", "53": "1", "54": "2", "55": "3", "56": "4",
"60": "6", "61": "0", "62": "1", "63": "2", "64": "3", "65": "4", "66": "5", "67": "6", "68": "0", "69": "1",
}

# (d2 + 6) % 7 = (d2 - 1) % 7
d2_0d1 = T["6" + d2]

# (d2 - 1 + 1*d1) % 7
d2_1d1 = T[d1 + d2_0d1]

# (d2 - 1 + 2*d1) % 7
d2_2d1 = T[d1 + d2_1d1]

# (d2 - 1 + 3*d1) % 7 = (d2 - 1 + 10*d1) % 7 = (d1d2 - 1) % 7
day_of_month = T[d1 + d2_2d1]

month_start = T["0" + m1 + m2]

output = T[month_start + day_of_month]


Try it online! and try the Generator / Testing program!

# Combined score: 440654 (63, 4), (50, 37), (46, 43), (42, 52)

## First program: A=64 63, B=4

T = {
# 0mm: lookup table for a such that a1 % 7 is the first day of the month
"001": "1", "002": "2", "003": "2", "004": "3", "005": "6", "006": "0", "007": "3", "008": "4", "009": "5", "010": "1", "011": "2", "012": "5",
# ab0: lookup table for ab % 7, "010" already happens to be the correct answer "1"
"000": "0", "020": "2", "030": "3", "040": "4", "050": "5", "060": "6", "070": "0", "080": "1", "090": "2",
"100": "3", "110": "4", "120": "5", "130": "6", "140": "0", "150": "1", "160": "2",
"200": "6", "210": "0", "220": "1", "230": "2", "240": "3", "250": "4", "260": "5",
"300": "2", "310": "3", "320": "4", "330": "5", "340": "6", "350": "0", "360": "1",
"400": "5", "410": "6", "420": "0", "430": "1", "440": "2", "450": "3", "460": "4",
"500": "1", "510": "2", "520": "3", "530": "4", "540": "5", "550": "6", "560": "0",
"600": "4", "610": "5", "620": "6", "630": "0", "640": "1", "650": "2", "660": "3",
}

m = T["0" + m1 + m2]
d3 = T["0" + d2 + "0"]
d = T[d1 + d3 + "0"]
output = T[m + d + "0"]


Try it online! Verification: Try it online! Edit: Reduced A by 1 thanks to a hint from @user202729.

## Second program: A=5652 50, B=37

T = {
# 0th day of the month (12 entries)
"01": "3", "02": "6", "03": "6", "04": "2", "05": "4", "06": "0", "07": "2", "08": "5", "09": "1", "10": "3", "11": "6", "12": "1",
# abcde: (a%7%2^b^c)+d+e%7>>1 (30 entries) e.g. a0001: a%7%2 abc01: a^b^c 00cde: c+d+e>>1 0000e: e%7>>1
"01001": "1", "01101": "0", "10001": "1", "10101": "0", "11001": "0", "11101": "1",
"20001": "0", "30001": "1", "40001": "0", "50001": "1", "60001": "0", "70001": "0", "80001": "1", "90001": "0",
"00000": "0", "00001": "0", "00010": "0", "00011": "1", "00100": "0", "00101": "1", "00110": "1", "00111": "1",
"00002": "1", "00003": "1", "00004": "2", "00005": "2", "00006": "3", "00007": "0", "00008": "0", "00009": "1",
# Convert from binary (modulo 7) (8 entries)
"000": "0", "001": "1", "010": "2", "011": "3", "100": "4", "101": "5", "110": "6", "111": "0",
}

# Get the day of the month and convert it to binary.
m = T[m1 + m2]
mh = T["0000" + m]
m0 = T[m + "0001"]
m1 = T[mh + "0001"]
m2 = T["0000" + mh]

# Convert the ones day digit (modulo 7) to binary.
d2h = T["0000" + d2]
d20 = T[d2 + "0001"]
d21 = T[d2h + "0001"]
d22 = T["0000" + d2h]

# Convert the tens day digit to binary.
d10 = T[d1 + "0001"]
d11 = T["0000" + d1]

# Multiply by three (modulo 7)
o = T["000" + d10 + d11]
o1 = T[d10 + d11 + "001"]
o0 = T[o + d10 + "001"]
o1 = T[o + o1 + "001"]
o2 = T[o + d11 + "001"]

c0 = T["000" + o0 + d20]
o0 = T[o0 + d20 + "001"]
c1 = T["00" + c0 + o1 + d21]
o1 = T[c0 + o1 + d21 + "01"]
o3 = T["00" + c1 + o2 + d22]
o2 = T[c1 + o2 + d22 + "01"]

c0 = T["000" + o0 + m0]
o0 = T[o0 + m0 + "001"]
c1 = T["00" + c0 + o1 + m1]
o1 = T[c0 + o1 + m1 + "01"]
c2 = T["00" + c1 + o2 + m2]
o2 = T[c1 + o2 + m2 + "01"]
o4 = T["000" + o3 + c2]
o3 = T[o3 + c2 + "001"]

# Reduce modulo 7.
c0 = T["000" + o0 + o3]
c1 = T["00" + c0 + o1 + o4]
o1 = T[c0 + o1 + o4 + "01"]
c2 = T["000" + c1 + o2]
o2 = T[c1 + o2 + "001"]
o0 = T[o0 + o3 + c2 + "01"]

# Convert from binary.
output = T[o2 + o1 + o0]


Verification: Try it online! Edit: Reduced A by 4 6 thanks to a hint from @user202729.

Note that for the next two variants I used letters to code the lookup type for my sanity but obviously distinct digits work just as well.

## Third program: A=5248 46, B=43

Simply performs the XORs two bits at a time instead of three. Verification: Try it online!

## Fourth program: A=4844 42, B=52

Also performs the additions two bits at a time instead of three. Verification: Try it online!

## "Fifth" program: A=20, B=360

I noticed that @thedefault.'s answer, while having an impressively low A, had a very high B. I looked to see what I could do to remedy that. My first step was to invert the sense of the first half of the lookup table, so that not could be calculated directly rather than by adding 9 and taking the sign. The next step was to swap the two halves of the table, so that and only took two operations, and the decimal output function could also be simplified. However this meant that or was too inefficient, particularly when used to add modulo 7, so I rewrote that to reduce the inefficiency. This is the generator program that I ended up with:

import functools
print("""
T = {
"00": "1", "01":"2", "02":"3", "03":"4", "04":"5", "05":"6", "06":"7", "07":"8", "08":"9", "09":"0"
,
"10": "1", "11":"0", "12":"0", "13":"0", "14":"0", "15":"0", "16":"0", "17":"0", "18":"0", "19":"0"
}
""".strip())

varn = 0
def getvar():
global varn
ret = 'v' + str(varn)
varn += 1
return ret
def enot(bi):
ni = getvar()
print('%s = T["1"+%s]' % (ni, bi))
return ni
def enand(b1, b2): #result may be greater than 1, use enot(eand()) to avoid this
ni = getvar()
print('%s = T[%s+%s]' % (ni, b1, b2))
return ni
def eand(b1, b2):
return enot(enand(b1, b2))
def eor(b1, b2):
return enot(eand(enot(b1), enot(b2)))
def eeqt(vi):
#return array of 10 bits for all 10 possible values of vi.
res = []
vi2 = getvar()
for i in range(10):
ni = getvar()
print('%s = T["1"+%s]' % (ni, vi if i == 0 else vi2))
print('%s = T["0"+%s]' % (vi2, vi if i == 0 else vi2))
res.append(ni)
#e.g. res[0] = !(x == 0)
return res[:1] + res[:0:-1]
def edmon(m1, m2):
#decode m2 using eeqt. create 2 more variables for november and december
m2p = eeqt(m2)
v11 = eand(m2p[1], m1)
m2p[1] = eand(m2p[1], enot(m1))
v12 = eand(m2p[2], m1)
m2p[2] = eand(m2p[2], enot(m1))
return m2p[1:] + m2p[:1] + [v11, v12]
def elmon(dmon):
#given output of edmon, find first day modulo 7.
#table = [4, 0, 0, 3, 5, 1, 3, 6, 2, 4, 0, 2]
d0 = enot(eand(eand(enot(dmon[1]), enot(dmon[2])), enot(dmon[10])))
d1 = dmon[5]
d2 = eor(dmon[8], dmon[11])
d3 = eor(dmon[3], dmon[6])
d4 = eor(dmon[0], dmon[9])
d5 = dmon[4]
d6 = dmon[7]
return [d0,d1,d2,d3,d4,d5,d6]
vals = [['"1"'] for _ in range(7)]
for a in range(7):
for b in range(7):
if v2[b] != '"0"':
vals[(a+b)%7].append(enand(v1[a], v2[b]))
return [enot(functools.reduce(eand, a)) for a in vals]
def emod7(d2):
et = eeqt(d2)
et[0] = eor(et[0], et[7])
et[1] = eor(et[1], et[8])
et[2] = eor(et[2], et[9])
return et[:7]
def e3mod7(d1):
et = eeqt(d1) # can't optimize because entries are obtained like 0, 9, 8, ... and 1 must be reached
#d1 < 4. multiply by 3
#0*3 = 0, 1*3 = 3, 2*3 = 6, 3*3 = 2
return [et[0], '"0"', et[3], et[1], '"0"', '"0"', et[2]]
def eout(m7):
val = '"1"'
ni = getvar()
for x in m7:
print('%s = T[%s+%s]' % (ni, x, val))
val = ni
return ni
def solve(m1, m2, d1, d2):
mmod7 = elmon(edmon(m1, m2))
res = res[1:] + res[:1]
return eout(res[::-1])

print('output =', solve('m1', 'm2', 'd1', 'd2'))

• I think overlapping one entry between the two tables to reduce A by 1 is possible. Feb 14, 2021 at 2:52
• @user202729 Ah yes, I see what you mean now, thanks.
– Neil
Feb 14, 2021 at 22:57
• You managed to get B=360 for the optimal A solution... // Perhaps I'll write something to combine tables automatically to reduce A for the other solutions, because if there's one overlapping output entry in two separate tables then it's always possible to combine them. Feb 18, 2021 at 2:58
• @user202729 ...because in the worst case you can define m to be 00000000000, while b is replaced by a suffix of 00000000006, with appropriate transformations for my other tables?
– Neil
Feb 18, 2021 at 10:37
• @user202729 Although I see I can overlap x00 with o, saving two entries.
– Neil
Feb 18, 2021 at 10:38

# Score: 26310277, A=20, B=2618, combined score 332345

The A is fairly likely to be optimal. (of course, the B is terrible)

T = {
"00": "0", "01":"1", "02":"1", "03":"1", "04":"1", "05":"1", "06":"1", "07":"1", "08":"1", "09":"1",
"10": "1", "11":"2", "12":"3", "13":"4", "14":"5", "15":"6", "16":"7", "17":"8", "18":"9", "19":"0"
}
v1 = T["0"+m2]
v0 = T["1"+m2]
v2 = T["0"+v0]
v0 = T["1"+v0]
v3 = T["0"+v0]
v0 = T["1"+v0]
v4 = T["0"+v0]
v0 = T["1"+v0]
v5 = T["0"+v0]
v0 = T["1"+v0]
v6 = T["0"+v0]
v0 = T["1"+v0]
v7 = T["0"+v0]
v0 = T["1"+v0]
v8 = T["0"+v0]
v0 = T["1"+v0]
v9 = T["0"+v0]
v0 = T["1"+v0]
v10 = T["0"+v0]
v0 = T["1"+v0]
v11 = T["1"+m1]
v11 = T["1"+v11]
v11 = T["1"+v11]
v11 = T["1"+v11]
v11 = T["1"+v11]
v11 = T["1"+v11]
v11 = T["1"+v11]
v11 = T["1"+v11]
v11 = T["1"+v11]
v12 = T["0"+v11]
v13 = T[v10+v12]
v13 = T["0"+v13]
v14 = T[v10+m1]
v14 = T["0"+v14]
v15 = T["1"+m1]
v15 = T["1"+v15]
v15 = T["1"+v15]
v15 = T["1"+v15]
v15 = T["1"+v15]
v15 = T["1"+v15]
v15 = T["1"+v15]
v15 = T["1"+v15]
v15 = T["1"+v15]
v16 = T["0"+v15]
v17 = T[v9+v16]
v17 = T["0"+v17]
v18 = T[v9+m1]
v18 = T["0"+v18]
v19 = T[v18+v8]
v20 = T["1"+v19]
v20 = T["1"+v20]
v20 = T["1"+v20]
v20 = T["1"+v20]
v20 = T["1"+v20]
v20 = T["1"+v20]
v20 = T["1"+v20]
v20 = T["1"+v20]
v20 = T["0"+v20]
v21 = T["1"+v20]
v21 = T["1"+v21]
v21 = T["1"+v21]
v21 = T["1"+v21]
v21 = T["1"+v21]
v21 = T["1"+v21]
v21 = T["1"+v21]
v21 = T["1"+v21]
v21 = T["1"+v21]
v22 = T["0"+v21]
v23 = T[v22+v13]
v24 = T["1"+v23]
v24 = T["1"+v24]
v24 = T["1"+v24]
v24 = T["1"+v24]
v24 = T["1"+v24]
v24 = T["1"+v24]
v24 = T["1"+v24]
v24 = T["1"+v24]
v24 = T["0"+v24]
v25 = T["1"+v24]
v25 = T["1"+v25]
v25 = T["1"+v25]
v25 = T["1"+v25]
v25 = T["1"+v25]
v25 = T["1"+v25]
v25 = T["1"+v25]
v25 = T["1"+v25]
v25 = T["1"+v25]
v26 = T["0"+v25]
v27 = T[v2+v17]
v28 = T["1"+v27]
v28 = T["1"+v28]
v28 = T["1"+v28]
v28 = T["1"+v28]
v28 = T["1"+v28]
v28 = T["1"+v28]
v28 = T["1"+v28]
v28 = T["1"+v28]
v28 = T["0"+v28]
v29 = T["1"+v28]
v29 = T["1"+v29]
v29 = T["1"+v29]
v29 = T["1"+v29]
v29 = T["1"+v29]
v29 = T["1"+v29]
v29 = T["1"+v29]
v29 = T["1"+v29]
v29 = T["1"+v29]
v30 = T["0"+v29]
v31 = T[v7+v4]
v32 = T["1"+v31]
v32 = T["1"+v32]
v32 = T["1"+v32]
v32 = T["1"+v32]
v32 = T["1"+v32]
v32 = T["1"+v32]
v32 = T["1"+v32]
v32 = T["1"+v32]
v32 = T["0"+v32]
v33 = T["1"+v32]
v33 = T["1"+v33]
v33 = T["1"+v33]
v33 = T["1"+v33]
v33 = T["1"+v33]
v33 = T["1"+v33]
v33 = T["1"+v33]
v33 = T["1"+v33]
v33 = T["1"+v33]
v34 = T["0"+v33]
v35 = T[v14+v1]
v36 = T["1"+v35]
v36 = T["1"+v36]
v36 = T["1"+v36]
v36 = T["1"+v36]
v36 = T["1"+v36]
v36 = T["1"+v36]
v36 = T["1"+v36]
v36 = T["1"+v36]
v36 = T["0"+v36]
v37 = T["1"+v36]
v37 = T["1"+v37]
v37 = T["1"+v37]
v37 = T["1"+v37]
v37 = T["1"+v37]
v37 = T["1"+v37]
v37 = T["1"+v37]
v37 = T["1"+v37]
v37 = T["1"+v37]
v38 = T["0"+v37]
v40 = T["0"+d2]
v39 = T["1"+d2]
v41 = T["0"+v39]
v39 = T["1"+v39]
v42 = T["0"+v39]
v39 = T["1"+v39]
v43 = T["0"+v39]
v39 = T["1"+v39]
v44 = T["0"+v39]
v39 = T["1"+v39]
v45 = T["0"+v39]
v39 = T["1"+v39]
v46 = T["0"+v39]
v39 = T["1"+v39]
v47 = T["0"+v39]
v39 = T["1"+v39]
v48 = T["0"+v39]
v39 = T["1"+v39]
v49 = T["0"+v39]
v39 = T["1"+v39]
v50 = T["1"+v40]
v50 = T["1"+v50]
v50 = T["1"+v50]
v50 = T["1"+v50]
v50 = T["1"+v50]
v50 = T["1"+v50]
v50 = T["1"+v50]
v50 = T["1"+v50]
v50 = T["1"+v50]
v51 = T["0"+v50]
v52 = T["1"+v49]
v52 = T["1"+v52]
v52 = T["1"+v52]
v52 = T["1"+v52]
v52 = T["1"+v52]
v52 = T["1"+v52]
v52 = T["1"+v52]
v52 = T["1"+v52]
v52 = T["1"+v52]
v53 = T["0"+v52]
v54 = T["1"+v48]
v54 = T["1"+v54]
v54 = T["1"+v54]
v54 = T["1"+v54]
v54 = T["1"+v54]
v54 = T["1"+v54]
v54 = T["1"+v54]
v54 = T["1"+v54]
v54 = T["1"+v54]
v55 = T["0"+v54]
v56 = T["1"+v47]
v56 = T["1"+v56]
v56 = T["1"+v56]
v56 = T["1"+v56]
v56 = T["1"+v56]
v56 = T["1"+v56]
v56 = T["1"+v56]
v56 = T["1"+v56]
v56 = T["1"+v56]
v57 = T["0"+v56]
v58 = T["1"+v46]
v58 = T["1"+v58]
v58 = T["1"+v58]
v58 = T["1"+v58]
v58 = T["1"+v58]
v58 = T["1"+v58]
v58 = T["1"+v58]
v58 = T["1"+v58]
v58 = T["1"+v58]
v59 = T["0"+v58]
v60 = T["1"+v45]
v60 = T["1"+v60]
v60 = T["1"+v60]
v60 = T["1"+v60]
v60 = T["1"+v60]
v60 = T["1"+v60]
v60 = T["1"+v60]
v60 = T["1"+v60]
v60 = T["1"+v60]
v61 = T["0"+v60]
v62 = T["1"+v44]
v62 = T["1"+v62]
v62 = T["1"+v62]
v62 = T["1"+v62]
v62 = T["1"+v62]
v62 = T["1"+v62]
v62 = T["1"+v62]
v62 = T["1"+v62]
v62 = T["1"+v62]
v63 = T["0"+v62]
v64 = T["1"+v43]
v64 = T["1"+v64]
v64 = T["1"+v64]
v64 = T["1"+v64]
v64 = T["1"+v64]
v64 = T["1"+v64]
v64 = T["1"+v64]
v64 = T["1"+v64]
v64 = T["1"+v64]
v65 = T["0"+v64]
v66 = T["1"+v42]
v66 = T["1"+v66]
v66 = T["1"+v66]
v66 = T["1"+v66]
v66 = T["1"+v66]
v66 = T["1"+v66]
v66 = T["1"+v66]
v66 = T["1"+v66]
v66 = T["1"+v66]
v67 = T["0"+v66]
v68 = T["1"+v41]
v68 = T["1"+v68]
v68 = T["1"+v68]
v68 = T["1"+v68]
v68 = T["1"+v68]
v68 = T["1"+v68]
v68 = T["1"+v68]
v68 = T["1"+v68]
v68 = T["1"+v68]
v69 = T["0"+v68]
v70 = T[v51+v65]
v70 = T["0"+v70]
v71 = T[v53+v67]
v71 = T["0"+v71]
v72 = T[v55+v69]
v72 = T["0"+v72]
v74 = T["0"+d1]
v73 = T["1"+d1]
v75 = T["0"+v73]
v73 = T["1"+v73]
v76 = T["0"+v73]
v73 = T["1"+v73]
v77 = T["0"+v73]
v73 = T["1"+v73]
v78 = T["0"+v73]
v73 = T["1"+v73]
v79 = T["0"+v73]
v73 = T["1"+v73]
v80 = T["0"+v73]
v73 = T["1"+v73]
v81 = T["0"+v73]
v73 = T["1"+v73]
v82 = T["0"+v73]
v73 = T["1"+v73]
v83 = T["0"+v73]
v73 = T["1"+v73]
v84 = T["1"+v74]
v84 = T["1"+v84]
v84 = T["1"+v84]
v84 = T["1"+v84]
v84 = T["1"+v84]
v84 = T["1"+v84]
v84 = T["1"+v84]
v84 = T["1"+v84]
v84 = T["1"+v84]
v85 = T["0"+v84]
v86 = T["1"+v81]
v86 = T["1"+v86]
v86 = T["1"+v86]
v86 = T["1"+v86]
v86 = T["1"+v86]
v86 = T["1"+v86]
v86 = T["1"+v86]
v86 = T["1"+v86]
v86 = T["1"+v86]
v87 = T["0"+v86]
v88 = T["1"+v83]
v88 = T["1"+v88]
v88 = T["1"+v88]
v88 = T["1"+v88]
v88 = T["1"+v88]
v88 = T["1"+v88]
v88 = T["1"+v88]
v88 = T["1"+v88]
v88 = T["1"+v88]
v89 = T["0"+v88]
v90 = T["1"+v82]
v90 = T["1"+v90]
v90 = T["1"+v90]
v90 = T["1"+v90]
v90 = T["1"+v90]
v90 = T["1"+v90]
v90 = T["1"+v90]
v90 = T["1"+v90]
v90 = T["1"+v90]
v91 = T["0"+v90]
v92 = T[v70+v85]
v93 = T["1"+v92]
v93 = T["1"+v93]
v93 = T["1"+v93]
v93 = T["1"+v93]
v93 = T["1"+v93]
v93 = T["1"+v93]
v93 = T["1"+v93]
v93 = T["1"+v93]
v93 = T["0"+v93]
v94 = T["1"+v93]
v94 = T["1"+v94]
v94 = T["1"+v94]
v94 = T["1"+v94]
v94 = T["1"+v94]
v94 = T["1"+v94]
v94 = T["1"+v94]
v94 = T["1"+v94]
v94 = T["1"+v94]
v95 = T["0"+v94]
v96 = T[v70+"0"]
v97 = T["1"+v96]
v97 = T["1"+v97]
v97 = T["1"+v97]
v97 = T["1"+v97]
v97 = T["1"+v97]
v97 = T["1"+v97]
v97 = T["1"+v97]
v97 = T["1"+v97]
v97 = T["0"+v97]
v98 = T["1"+v97]
v98 = T["1"+v98]
v98 = T["1"+v98]
v98 = T["1"+v98]
v98 = T["1"+v98]
v98 = T["1"+v98]
v98 = T["1"+v98]
v98 = T["1"+v98]
v98 = T["1"+v98]
v99 = T["0"+v98]
v100 = T[v70+v87]
v101 = T["1"+v100]
v101 = T["1"+v101]
v101 = T["1"+v101]
v101 = T["1"+v101]
v101 = T["1"+v101]
v101 = T["1"+v101]
v101 = T["1"+v101]
v101 = T["1"+v101]
v101 = T["0"+v101]
v102 = T["1"+v101]
v102 = T["1"+v102]
v102 = T["1"+v102]
v102 = T["1"+v102]
v102 = T["1"+v102]
v102 = T["1"+v102]
v102 = T["1"+v102]
v102 = T["1"+v102]
v102 = T["1"+v102]
v103 = T["0"+v102]
v104 = T[v70+v89]
v105 = T["1"+v104]
v105 = T["1"+v105]
v105 = T["1"+v105]
v105 = T["1"+v105]
v105 = T["1"+v105]
v105 = T["1"+v105]
v105 = T["1"+v105]
v105 = T["1"+v105]
v105 = T["0"+v105]
v106 = T["1"+v105]
v106 = T["1"+v106]
v106 = T["1"+v106]
v106 = T["1"+v106]
v106 = T["1"+v106]
v106 = T["1"+v106]
v106 = T["1"+v106]
v106 = T["1"+v106]
v106 = T["1"+v106]
v107 = T["0"+v106]
v108 = T[v70+"0"]
v109 = T["1"+v108]
v109 = T["1"+v109]
v109 = T["1"+v109]
v109 = T["1"+v109]
v109 = T["1"+v109]
v109 = T["1"+v109]
v109 = T["1"+v109]
v109 = T["1"+v109]
v109 = T["0"+v109]
v110 = T["1"+v109]
v110 = T["1"+v110]
v110 = T["1"+v110]
v110 = T["1"+v110]
v110 = T["1"+v110]
v110 = T["1"+v110]
v110 = T["1"+v110]
v110 = T["1"+v110]
v110 = T["1"+v110]
v111 = T["0"+v110]
v112 = T[v70+"0"]
v113 = T["1"+v112]
v113 = T["1"+v113]
v113 = T["1"+v113]
v113 = T["1"+v113]
v113 = T["1"+v113]
v113 = T["1"+v113]
v113 = T["1"+v113]
v113 = T["1"+v113]
v113 = T["0"+v113]
v114 = T["1"+v113]
v114 = T["1"+v114]
v114 = T["1"+v114]
v114 = T["1"+v114]
v114 = T["1"+v114]
v114 = T["1"+v114]
v114 = T["1"+v114]
v114 = T["1"+v114]
v114 = T["1"+v114]
v115 = T["0"+v114]
v116 = T[v70+v91]
v117 = T["1"+v116]
v117 = T["1"+v117]
v117 = T["1"+v117]
v117 = T["1"+v117]
v117 = T["1"+v117]
v117 = T["1"+v117]
v117 = T["1"+v117]
v117 = T["1"+v117]
v117 = T["0"+v117]
v118 = T["1"+v117]
v118 = T["1"+v118]
v118 = T["1"+v118]
v118 = T["1"+v118]
v118 = T["1"+v118]
v118 = T["1"+v118]
v118 = T["1"+v118]
v118 = T["1"+v118]
v118 = T["1"+v118]
v119 = T["0"+v118]
v120 = T[v71+v85]
v121 = T["1"+v120]
v121 = T["1"+v121]
v121 = T["1"+v121]
v121 = T["1"+v121]
v121 = T["1"+v121]
v121 = T["1"+v121]
v121 = T["1"+v121]
v121 = T["1"+v121]
v121 = T["0"+v121]
v122 = T["1"+v121]
v122 = T["1"+v122]
v122 = T["1"+v122]
v122 = T["1"+v122]
v122 = T["1"+v122]
v122 = T["1"+v122]
v122 = T["1"+v122]
v122 = T["1"+v122]
v122 = T["1"+v122]
v123 = T["0"+v122]
v124 = T[v71+"0"]
v125 = T["1"+v124]
v125 = T["1"+v125]
v125 = T["1"+v125]
v125 = T["1"+v125]
v125 = T["1"+v125]
v125 = T["1"+v125]
v125 = T["1"+v125]
v125 = T["1"+v125]
v125 = T["0"+v125]
v126 = T["1"+v125]
v126 = T["1"+v126]
v126 = T["1"+v126]
v126 = T["1"+v126]
v126 = T["1"+v126]
v126 = T["1"+v126]
v126 = T["1"+v126]
v126 = T["1"+v126]
v126 = T["1"+v126]
v127 = T["0"+v126]
v128 = T[v71+v87]
v129 = T["1"+v128]
v129 = T["1"+v129]
v129 = T["1"+v129]
v129 = T["1"+v129]
v129 = T["1"+v129]
v129 = T["1"+v129]
v129 = T["1"+v129]
v129 = T["1"+v129]
v129 = T["0"+v129]
v130 = T["1"+v129]
v130 = T["1"+v130]
v130 = T["1"+v130]
v130 = T["1"+v130]
v130 = T["1"+v130]
v130 = T["1"+v130]
v130 = T["1"+v130]
v130 = T["1"+v130]
v130 = T["1"+v130]
v131 = T["0"+v130]
v132 = T[v71+v89]
v133 = T["1"+v132]
v133 = T["1"+v133]
v133 = T["1"+v133]
v133 = T["1"+v133]
v133 = T["1"+v133]
v133 = T["1"+v133]
v133 = T["1"+v133]
v133 = T["1"+v133]
v133 = T["0"+v133]
v134 = T["1"+v133]
v134 = T["1"+v134]
v134 = T["1"+v134]
v134 = T["1"+v134]
v134 = T["1"+v134]
v134 = T["1"+v134]
v134 = T["1"+v134]
v134 = T["1"+v134]
v134 = T["1"+v134]
v135 = T["0"+v134]
v136 = T[v71+"0"]
v137 = T["1"+v136]
v137 = T["1"+v137]
v137 = T["1"+v137]
v137 = T["1"+v137]
v137 = T["1"+v137]
v137 = T["1"+v137]
v137 = T["1"+v137]
v137 = T["1"+v137]
v137 = T["0"+v137]
v138 = T["1"+v137]
v138 = T["1"+v138]
v138 = T["1"+v138]
v138 = T["1"+v138]
v138 = T["1"+v138]
v138 = T["1"+v138]
v138 = T["1"+v138]
v138 = T["1"+v138]
v138 = T["1"+v138]
v139 = T["0"+v138]
v140 = T[v71+"0"]
v141 = T["1"+v140]
v141 = T["1"+v141]
v141 = T["1"+v141]
v141 = T["1"+v141]
v141 = T["1"+v141]
v141 = T["1"+v141]
v141 = T["1"+v141]
v141 = T["1"+v141]
v141 = T["0"+v141]
v142 = T["1"+v141]
v142 = T["1"+v142]
v142 = T["1"+v142]
v142 = T["1"+v142]
v142 = T["1"+v142]
v142 = T["1"+v142]
v142 = T["1"+v142]
v142 = T["1"+v142]
v142 = T["1"+v142]
v143 = T["0"+v142]
v144 = T[v71+v91]
v145 = T["1"+v144]
v145 = T["1"+v145]
v145 = T["1"+v145]
v145 = T["1"+v145]
v145 = T["1"+v145]
v145 = T["1"+v145]
v145 = T["1"+v145]
v145 = T["1"+v145]
v145 = T["0"+v145]
v146 = T["1"+v145]
v146 = T["1"+v146]
v146 = T["1"+v146]
v146 = T["1"+v146]
v146 = T["1"+v146]
v146 = T["1"+v146]
v146 = T["1"+v146]
v146 = T["1"+v146]
v146 = T["1"+v146]
v147 = T["0"+v146]
v148 = T[v72+v85]
v149 = T["1"+v148]
v149 = T["1"+v149]
v149 = T["1"+v149]
v149 = T["1"+v149]
v149 = T["1"+v149]
v149 = T["1"+v149]
v149 = T["1"+v149]
v149 = T["1"+v149]
v149 = T["0"+v149]
v150 = T["1"+v149]
v150 = T["1"+v150]
v150 = T["1"+v150]
v150 = T["1"+v150]
v150 = T["1"+v150]
v150 = T["1"+v150]
v150 = T["1"+v150]
v150 = T["1"+v150]
v150 = T["1"+v150]
v151 = T["0"+v150]
v152 = T[v72+"0"]
v153 = T["1"+v152]
v153 = T["1"+v153]
v153 = T["1"+v153]
v153 = T["1"+v153]
v153 = T["1"+v153]
v153 = T["1"+v153]
v153 = T["1"+v153]
v153 = T["1"+v153]
v153 = T["0"+v153]
v154 = T["1"+v153]
v154 = T["1"+v154]
v154 = T["1"+v154]
v154 = T["1"+v154]
v154 = T["1"+v154]
v154 = T["1"+v154]
v154 = T["1"+v154]
v154 = T["1"+v154]
v154 = T["1"+v154]
v155 = T["0"+v154]
v156 = T[v72+v87]
v157 = T["1"+v156]
v157 = T["1"+v157]
v157 = T["1"+v157]
v157 = T["1"+v157]
v157 = T["1"+v157]
v157 = T["1"+v157]
v157 = T["1"+v157]
v157 = T["1"+v157]
v157 = T["0"+v157]
v158 = T["1"+v157]
v158 = T["1"+v158]
v158 = T["1"+v158]
v158 = T["1"+v158]
v158 = T["1"+v158]
v158 = T["1"+v158]
v158 = T["1"+v158]
v158 = T["1"+v158]
v158 = T["1"+v158]
v159 = T["0"+v158]
v160 = T[v72+v89]
v161 = T["1"+v160]
v161 = T["1"+v161]
v161 = T["1"+v161]
v161 = T["1"+v161]
v161 = T["1"+v161]
v161 = T["1"+v161]
v161 = T["1"+v161]
v161 = T["1"+v161]
v161 = T["0"+v161]
v162 = T["1"+v161]
v162 = T["1"+v162]
v162 = T["1"+v162]
v162 = T["1"+v162]
v162 = T["1"+v162]
v162 = T["1"+v162]
v162 = T["1"+v162]
v162 = T["1"+v162]
v162 = T["1"+v162]
v163 = T["0"+v162]
v164 = T[v72+"0"]
v165 = T["1"+v164]
v165 = T["1"+v165]
v165 = T["1"+v165]
v165 = T["1"+v165]
v165 = T["1"+v165]
v165 = T["1"+v165]
v165 = T["1"+v165]
v165 = T["1"+v165]
v165 = T["0"+v165]
v166 = T["1"+v165]
v166 = T["1"+v166]
v166 = T["1"+v166]
v166 = T["1"+v166]
v166 = T["1"+v166]
v166 = T["1"+v166]
v166 = T["1"+v166]
v166 = T["1"+v166]
v166 = T["1"+v166]
v167 = T["0"+v166]
v168 = T[v72+"0"]
v169 = T["1"+v168]
v169 = T["1"+v169]
v169 = T["1"+v169]
v169 = T["1"+v169]
v169 = T["1"+v169]
v169 = T["1"+v169]
v169 = T["1"+v169]
v169 = T["1"+v169]
v169 = T["0"+v169]
v170 = T["1"+v169]
v170 = T["1"+v170]
v170 = T["1"+v170]
v170 = T["1"+v170]
v170 = T["1"+v170]
v170 = T["1"+v170]
v170 = T["1"+v170]
v170 = T["1"+v170]
v170 = T["1"+v170]
v171 = T["0"+v170]
v172 = T[v72+v91]
v173 = T["1"+v172]
v173 = T["1"+v173]
v173 = T["1"+v173]
v173 = T["1"+v173]
v173 = T["1"+v173]
v173 = T["1"+v173]
v173 = T["1"+v173]
v173 = T["1"+v173]
v173 = T["0"+v173]
v174 = T["1"+v173]
v174 = T["1"+v174]
v174 = T["1"+v174]
v174 = T["1"+v174]
v174 = T["1"+v174]
v174 = T["1"+v174]
v174 = T["1"+v174]
v174 = T["1"+v174]
v174 = T["1"+v174]
v175 = T["0"+v174]
v176 = T[v57+v85]
v177 = T["1"+v176]
v177 = T["1"+v177]
v177 = T["1"+v177]
v177 = T["1"+v177]
v177 = T["1"+v177]
v177 = T["1"+v177]
v177 = T["1"+v177]
v177 = T["1"+v177]
v177 = T["0"+v177]
v178 = T["1"+v177]
v178 = T["1"+v178]
v178 = T["1"+v178]
v178 = T["1"+v178]
v178 = T["1"+v178]
v178 = T["1"+v178]
v178 = T["1"+v178]
v178 = T["1"+v178]
v178 = T["1"+v178]
v179 = T["0"+v178]
v180 = T[v57+"0"]
v181 = T["1"+v180]
v181 = T["1"+v181]
v181 = T["1"+v181]
v181 = T["1"+v181]
v181 = T["1"+v181]
v181 = T["1"+v181]
v181 = T["1"+v181]
v181 = T["1"+v181]
v181 = T["0"+v181]
v182 = T["1"+v181]
v182 = T["1"+v182]
v182 = T["1"+v182]
v182 = T["1"+v182]
v182 = T["1"+v182]
v182 = T["1"+v182]
v182 = T["1"+v182]
v182 = T["1"+v182]
v182 = T["1"+v182]
v183 = T["0"+v182]
v184 = T[v57+v87]
v185 = T["1"+v184]
v185 = T["1"+v185]
v185 = T["1"+v185]
v185 = T["1"+v185]
v185 = T["1"+v185]
v185 = T["1"+v185]
v185 = T["1"+v185]
v185 = T["1"+v185]
v185 = T["0"+v185]
v186 = T["1"+v185]
v186 = T["1"+v186]
v186 = T["1"+v186]
v186 = T["1"+v186]
v186 = T["1"+v186]
v186 = T["1"+v186]
v186 = T["1"+v186]
v186 = T["1"+v186]
v186 = T["1"+v186]
v187 = T["0"+v186]
v188 = T[v57+v89]
v189 = T["1"+v188]
v189 = T["1"+v189]
v189 = T["1"+v189]
v189 = T["1"+v189]
v189 = T["1"+v189]
v189 = T["1"+v189]
v189 = T["1"+v189]
v189 = T["1"+v189]
v189 = T["0"+v189]
v190 = T["1"+v189]
v190 = T["1"+v190]
v190 = T["1"+v190]
v190 = T["1"+v190]
v190 = T["1"+v190]
v190 = T["1"+v190]
v190 = T["1"+v190]
v190 = T["1"+v190]
v190 = T["1"+v190]
v191 = T["0"+v190]
v192 = T[v57+"0"]
v193 = T["1"+v192]
v193 = T["1"+v193]
v193 = T["1"+v193]
v193 = T["1"+v193]
v193 = T["1"+v193]
v193 = T["1"+v193]
v193 = T["1"+v193]
v193 = T["1"+v193]
v193 = T["0"+v193]
v194 = T["1"+v193]
v194 = T["1"+v194]
v194 = T["1"+v194]
v194 = T["1"+v194]
v194 = T["1"+v194]
v194 = T["1"+v194]
v194 = T["1"+v194]
v194 = T["1"+v194]
v194 = T["1"+v194]
v195 = T["0"+v194]
v196 = T[v57+"0"]
v197 = T["1"+v196]
v197 = T["1"+v197]
v197 = T["1"+v197]
v197 = T["1"+v197]
v197 = T["1"+v197]
v197 = T["1"+v197]
v197 = T["1"+v197]
v197 = T["1"+v197]
v197 = T["0"+v197]
v198 = T["1"+v197]
v198 = T["1"+v198]
v198 = T["1"+v198]
v198 = T["1"+v198]
v198 = T["1"+v198]
v198 = T["1"+v198]
v198 = T["1"+v198]
v198 = T["1"+v198]
v198 = T["1"+v198]
v199 = T["0"+v198]
v200 = T[v57+v91]
v201 = T["1"+v200]
v201 = T["1"+v201]
v201 = T["1"+v201]
v201 = T["1"+v201]
v201 = T["1"+v201]
v201 = T["1"+v201]
v201 = T["1"+v201]
v201 = T["1"+v201]
v201 = T["0"+v201]
v202 = T["1"+v201]
v202 = T["1"+v202]
v202 = T["1"+v202]
v202 = T["1"+v202]
v202 = T["1"+v202]
v202 = T["1"+v202]
v202 = T["1"+v202]
v202 = T["1"+v202]
v202 = T["1"+v202]
v203 = T["0"+v202]
v204 = T[v59+v85]
v205 = T["1"+v204]
v205 = T["1"+v205]
v205 = T["1"+v205]
v205 = T["1"+v205]
v205 = T["1"+v205]
v205 = T["1"+v205]
v205 = T["1"+v205]
v205 = T["1"+v205]
v205 = T["0"+v205]
v206 = T["1"+v205]
v206 = T["1"+v206]
v206 = T["1"+v206]
v206 = T["1"+v206]
v206 = T["1"+v206]
v206 = T["1"+v206]
v206 = T["1"+v206]
v206 = T["1"+v206]
v206 = T["1"+v206]
v207 = T["0"+v206]
v208 = T[v59+"0"]
v209 = T["1"+v208]
v209 = T["1"+v209]
v209 = T["1"+v209]
v209 = T["1"+v209]
v209 = T["1"+v209]
v209 = T["1"+v209]
v209 = T["1"+v209]
v209 = T["1"+v209]
v209 = T["0"+v209]
v210 = T["1"+v209]
v210 = T["1"+v210]
v210 = T["1"+v210]
v210 = T["1"+v210]
v210 = T["1"+v210]
v210 = T["1"+v210]
v210 = T["1"+v210]
v210 = T["1"+v210]
v210 = T["1"+v210]
v211 = T["0"+v210]
v212 = T[v59+v87]
v213 = T["1"+v212]
v213 = T["1"+v213]
v213 = T["1"+v213]
v213 = T["1"+v213]
v213 = T["1"+v213]
v213 = T["1"+v213]
v213 = T["1"+v213]
v213 = T["1"+v213]
v213 = T["0"+v213]
v214 = T["1"+v213]
v214 = T["1"+v214]
v214 = T["1"+v214]
v214 = T["1"+v214]
v214 = T["1"+v214]
v214 = T["1"+v214]
v214 = T["1"+v214]
v214 = T["1"+v214]
v214 = T["1"+v214]
v215 = T["0"+v214]
v216 = T[v59+v89]
v217 = T["1"+v216]
v217 = T["1"+v217]
v217 = T["1"+v217]
v217 = T["1"+v217]
v217 = T["1"+v217]
v217 = T["1"+v217]
v217 = T["1"+v217]
v217 = T["1"+v217]
v217 = T["0"+v217]
v218 = T["1"+v217]
v218 = T["1"+v218]
v218 = T["1"+v218]
v218 = T["1"+v218]
v218 = T["1"+v218]
v218 = T["1"+v218]
v218 = T["1"+v218]
v218 = T["1"+v218]
v218 = T["1"+v218]
v219 = T["0"+v218]
v220 = T[v59+"0"]
v221 = T["1"+v220]
v221 = T["1"+v221]
v221 = T["1"+v221]
v221 = T["1"+v221]
v221 = T["1"+v221]
v221 = T["1"+v221]
v221 = T["1"+v221]
v221 = T["1"+v221]
v221 = T["0"+v221]
v222 = T["1"+v221]
v222 = T["1"+v222]
v222 = T["1"+v222]
v222 = T["1"+v222]
v222 = T["1"+v222]
v222 = T["1"+v222]
v222 = T["1"+v222]
v222 = T["1"+v222]
v222 = T["1"+v222]
v223 = T["0"+v222]
v224 = T[v59+"0"]
v225 = T["1"+v224]
v225 = T["1"+v225]
v225 = T["1"+v225]
v225 = T["1"+v225]
v225 = T["1"+v225]
v225 = T["1"+v225]
v225 = T["1"+v225]
v225 = T["1"+v225]
v225 = T["0"+v225]
v226 = T["1"+v225]
v226 = T["1"+v226]
v226 = T["1"+v226]
v226 = T["1"+v226]
v226 = T["1"+v226]
v226 = T["1"+v226]
v226 = T["1"+v226]
v226 = T["1"+v226]
v226 = T["1"+v226]
v227 = T["0"+v226]
v228 = T[v59+v91]
v229 = T["1"+v228]
v229 = T["1"+v229]
v229 = T["1"+v229]
v229 = T["1"+v229]
v229 = T["1"+v229]
v229 = T["1"+v229]
v229 = T["1"+v229]
v229 = T["1"+v229]
v229 = T["0"+v229]
v230 = T["1"+v229]
v230 = T["1"+v230]
v230 = T["1"+v230]
v230 = T["1"+v230]
v230 = T["1"+v230]
v230 = T["1"+v230]
v230 = T["1"+v230]
v230 = T["1"+v230]
v230 = T["1"+v230]
v231 = T["0"+v230]
v232 = T[v61+v85]
v233 = T["1"+v232]
v233 = T["1"+v233]
v233 = T["1"+v233]
v233 = T["1"+v233]
v233 = T["1"+v233]
v233 = T["1"+v233]
v233 = T["1"+v233]
v233 = T["1"+v233]
v233 = T["0"+v233]
v234 = T["1"+v233]
v234 = T["1"+v234]
v234 = T["1"+v234]
v234 = T["1"+v234]
v234 = T["1"+v234]
v234 = T["1"+v234]
v234 = T["1"+v234]
v234 = T["1"+v234]
v234 = T["1"+v234]
v235 = T["0"+v234]
v236 = T[v61+"0"]
v237 = T["1"+v236]
v237 = T["1"+v237]
v237 = T["1"+v237]
v237 = T["1"+v237]
v237 = T["1"+v237]
v237 = T["1"+v237]
v237 = T["1"+v237]
v237 = T["1"+v237]
v237 = T["0"+v237]
v238 = T["1"+v237]
v238 = T["1"+v238]
v238 = T["1"+v238]
v238 = T["1"+v238]
v238 = T["1"+v238]
v238 = T["1"+v238]
v238 = T["1"+v238]
v238 = T["1"+v238]
v238 = T["1"+v238]
v239 = T["0"+v238]
v240 = T[v61+v87]
v241 = T["1"+v240]
v241 = T["1"+v241]
v241 = T["1"+v241]
v241 = T["1"+v241]
v241 = T["1"+v241]
v241 = T["1"+v241]
v241 = T["1"+v241]
v241 = T["1"+v241]
v241 = T["0"+v241]
v242 = T["1"+v241]
v242 = T["1"+v242]
v242 = T["1"+v242]
v242 = T["1"+v242]
v242 = T["1"+v242]
v242 = T["1"+v242]
v242 = T["1"+v242]
v242 = T["1"+v242]
v242 = T["1"+v242]
v243 = T["0"+v242]
v244 = T[v61+v89]
v245 = T["1"+v244]
v245 = T["1"+v245]
v245 = T["1"+v245]
v245 = T["1"+v245]
v245 = T["1"+v245]
v245 = T["1"+v245]
v245 = T["1"+v245]
v245 = T["1"+v245]
v245 = T["0"+v245]
v246 = T["1"+v245]
v246 = T["1"+v246]
v246 = T["1"+v246]
v246 = T["1"+v246]
v246 = T["1"+v246]
v246 = T["1"+v246]
v246 = T["1"+v246]
v246 = T["1"+v246]
v246 = T["1"+v246]
v247 = T["0"+v246]
v248 = T[v61+"0"]
v249 = T["1"+v248]
v249 = T["1"+v249]
v249 = T["1"+v249]
v249 = T["1"+v249]
v249 = T["1"+v249]
v249 = T["1"+v249]
v249 = T["1"+v249]
v249 = T["1"+v249]
v249 = T["0"+v249]
v250 = T["1"+v249]
v250 = T["1"+v250]
v250 = T["1"+v250]
v250 = T["1"+v250]
v250 = T["1"+v250]
v250 = T["1"+v250]
v250 = T["1"+v250]
v250 = T["1"+v250]
v250 = T["1"+v250]
v251 = T["0"+v250]
v252 = T[v61+"0"]
v253 = T["1"+v252]
v253 = T["1"+v253]
v253 = T["1"+v253]
v253 = T["1"+v253]
v253 = T["1"+v253]
v253 = T["1"+v253]
v253 = T["1"+v253]
v253 = T["1"+v253]
v253 = T["0"+v253]
v254 = T["1"+v253]
v254 = T["1"+v254]
v254 = T["1"+v254]
v254 = T["1"+v254]
v254 = T["1"+v254]
v254 = T["1"+v254]
v254 = T["1"+v254]
v254 = T["1"+v254]
v254 = T["1"+v254]
v255 = T["0"+v254]
v256 = T[v61+v91]
v257 = T["1"+v256]
v257 = T["1"+v257]
v257 = T["1"+v257]
v257 = T["1"+v257]
v257 = T["1"+v257]
v257 = T["1"+v257]
v257 = T["1"+v257]
v257 = T["1"+v257]
v257 = T["0"+v257]
v258 = T["1"+v257]
v258 = T["1"+v258]
v258 = T["1"+v258]
v258 = T["1"+v258]
v258 = T["1"+v258]
v258 = T["1"+v258]
v258 = T["1"+v258]
v258 = T["1"+v258]
v258 = T["1"+v258]
v259 = T["0"+v258]
v260 = T[v63+v85]
v261 = T["1"+v260]
v261 = T["1"+v261]
v261 = T["1"+v261]
v261 = T["1"+v261]
v261 = T["1"+v261]
v261 = T["1"+v261]
v261 = T["1"+v261]
v261 = T["1"+v261]
v261 = T["0"+v261]
v262 = T["1"+v261]
v262 = T["1"+v262]
v262 = T["1"+v262]
v262 = T["1"+v262]
v262 = T["1"+v262]
v262 = T["1"+v262]
v262 = T["1"+v262]
v262 = T["1"+v262]
v262 = T["1"+v262]
v263 = T["0"+v262]
v264 = T[v63+"0"]
v265 = T["1"+v264]
v265 = T["1"+v265]
v265 = T["1"+v265]
v265 = T["1"+v265]
v265 = T["1"+v265]
v265 = T["1"+v265]
v265 = T["1"+v265]
v265 = T["1"+v265]
v265 = T["0"+v265]
v266 = T["1"+v265]
v266 = T["1"+v266]
v266 = T["1"+v266]
v266 = T["1"+v266]
v266 = T["1"+v266]
v266 = T["1"+v266]
v266 = T["1"+v266]
v266 = T["1"+v266]
v266 = T["1"+v266]
v267 = T["0"+v266]
v268 = T[v63+v87]
v269 = T["1"+v268]
v269 = T["1"+v269]
v269 = T["1"+v269]
v269 = T["1"+v269]
v269 = T["1"+v269]
v269 = T["1"+v269]
v269 = T["1"+v269]
v269 = T["1"+v269]
v269 = T["0"+v269]
v270 = T["1"+v269]
v270 = T["1"+v270]
v270 = T["1"+v270]
v270 = T["1"+v270]
v270 = T["1"+v270]
v270 = T["1"+v270]
v270 = T["1"+v270]
v270 = T["1"+v270]
v270 = T["1"+v270]
v271 = T["0"+v270]
v272 = T[v63+v89]
v273 = T["1"+v272]
v273 = T["1"+v273]
v273 = T["1"+v273]
v273 = T["1"+v273]
v273 = T["1"+v273]
v273 = T["1"+v273]
v273 = T["1"+v273]
v273 = T["1"+v273]
v273 = T["0"+v273]
v274 = T["1"+v273]
v274 = T["1"+v274]
v274 = T["1"+v274]
v274 = T["1"+v274]
v274 = T["1"+v274]
v274 = T["1"+v274]
v274 = T["1"+v274]
v274 = T["1"+v274]
v274 = T["1"+v274]
v275 = T["0"+v274]
v276 = T[v63+"0"]
v277 = T["1"+v276]
v277 = T["1"+v277]
v277 = T["1"+v277]
v277 = T["1"+v277]
v277 = T["1"+v277]
v277 = T["1"+v277]
v277 = T["1"+v277]
v277 = T["1"+v277]
v277 = T["0"+v277]
v278 = T["1"+v277]
v278 = T["1"+v278]
v278 = T["1"+v278]
v278 = T["1"+v278]
v278 = T["1"+v278]
v278 = T["1"+v278]
v278 = T["1"+v278]
v278 = T["1"+v278]
v278 = T["1"+v278]
v279 = T["0"+v278]
v280 = T[v63+"0"]
v281 = T["1"+v280]
v281 = T["1"+v281]
v281 = T["1"+v281]
v281 = T["1"+v281]
v281 = T["1"+v281]
v281 = T["1"+v281]
v281 = T["1"+v281]
v281 = T["1"+v281]
v281 = T["0"+v281]
v282 = T["1"+v281]
v282 = T["1"+v282]
v282 = T["1"+v282]
v282 = T["1"+v282]
v282 = T["1"+v282]
v282 = T["1"+v282]
v282 = T["1"+v282]
v282 = T["1"+v282]
v282 = T["1"+v282]
v283 = T["0"+v282]
v284 = T[v63+v91]
v285 = T["1"+v284]
v285 = T["1"+v285]
v285 = T["1"+v285]
v285 = T["1"+v285]
v285 = T["1"+v285]
v285 = T["1"+v285]
v285 = T["1"+v285]
v285 = T["1"+v285]
v285 = T["0"+v285]
v286 = T["1"+v285]
v286 = T["1"+v286]
v286 = T["1"+v286]
v286 = T["1"+v286]
v286 = T["1"+v286]
v286 = T["1"+v286]
v286 = T["1"+v286]
v286 = T["1"+v286]
v286 = T["1"+v286]
v287 = T["0"+v286]
v288 = T[v95+v147]
v288 = T["0"+v288]
v289 = T[v288+v171]
v289 = T["0"+v289]
v290 = T[v289+v195]
v290 = T["0"+v290]
v291 = T[v290+v219]
v291 = T["0"+v291]
v292 = T[v291+v243]
v292 = T["0"+v292]
v293 = T[v292+v267]
v293 = T["0"+v293]
v294 = T[v99+v123]
v294 = T["0"+v294]
v295 = T[v294+v175]
v295 = T["0"+v295]
v296 = T[v295+v199]
v296 = T["0"+v296]
v297 = T[v296+v223]
v297 = T["0"+v297]
v298 = T[v297+v247]
v298 = T["0"+v298]
v299 = T[v298+v271]
v299 = T["0"+v299]
v300 = T[v103+v127]
v300 = T["0"+v300]
v301 = T[v300+v151]
v301 = T["0"+v301]
v302 = T[v301+v203]
v302 = T["0"+v302]
v303 = T[v302+v227]
v303 = T["0"+v303]
v304 = T[v303+v251]
v304 = T["0"+v304]
v305 = T[v304+v275]
v305 = T["0"+v305]
v306 = T[v107+v131]
v306 = T["0"+v306]
v307 = T[v306+v155]
v307 = T["0"+v307]
v308 = T[v307+v179]
v308 = T["0"+v308]
v309 = T[v308+v231]
v309 = T["0"+v309]
v310 = T[v309+v255]
v310 = T["0"+v310]
v311 = T[v310+v279]
v311 = T["0"+v311]
v312 = T[v111+v135]
v312 = T["0"+v312]
v313 = T[v312+v159]
v313 = T["0"+v313]
v314 = T[v313+v183]
v314 = T["0"+v314]
v315 = T[v314+v207]
v315 = T["0"+v315]
v316 = T[v315+v259]
v316 = T["0"+v316]
v317 = T[v316+v283]
v317 = T["0"+v317]
v318 = T[v115+v139]
v318 = T["0"+v318]
v319 = T[v318+v163]
v319 = T["0"+v319]
v320 = T[v319+v187]
v320 = T["0"+v320]
v321 = T[v320+v211]
v321 = T["0"+v321]
v322 = T[v321+v235]
v322 = T["0"+v322]
v323 = T[v322+v287]
v323 = T["0"+v323]
v324 = T[v119+v143]
v324 = T["0"+v324]
v325 = T[v324+v167]
v325 = T["0"+v325]
v326 = T[v325+v191]
v326 = T["0"+v326]
v327 = T[v326+v215]
v327 = T["0"+v327]
v328 = T[v327+v239]
v328 = T["0"+v328]
v329 = T[v328+v263]
v329 = T["0"+v329]
v330 = T["1"+v26]
v330 = T["1"+v330]
v330 = T["1"+v330]
v330 = T["1"+v330]
v330 = T["1"+v330]
v330 = T["1"+v330]
v330 = T["1"+v330]
v330 = T["1"+v330]
v330 = T["1"+v330]
v331 = T["0"+v330]
v332 = T["1"+v5]
v332 = T["1"+v332]
v332 = T["1"+v332]
v332 = T["1"+v332]
v332 = T["1"+v332]
v332 = T["1"+v332]
v332 = T["1"+v332]
v332 = T["1"+v332]
v332 = T["1"+v332]
v333 = T["0"+v332]
v334 = T["1"+v30]
v334 = T["1"+v334]
v334 = T["1"+v334]
v334 = T["1"+v334]
v334 = T["1"+v334]
v334 = T["1"+v334]
v334 = T["1"+v334]
v334 = T["1"+v334]
v334 = T["1"+v334]
v335 = T["0"+v334]
v336 = T["1"+v34]
v336 = T["1"+v336]
v336 = T["1"+v336]
v336 = T["1"+v336]
v336 = T["1"+v336]
v336 = T["1"+v336]
v336 = T["1"+v336]
v336 = T["1"+v336]
v336 = T["1"+v336]
v337 = T["0"+v336]
v338 = T["1"+v38]
v338 = T["1"+v338]
v338 = T["1"+v338]
v338 = T["1"+v338]
v338 = T["1"+v338]
v338 = T["1"+v338]
v338 = T["1"+v338]
v338 = T["1"+v338]
v338 = T["1"+v338]
v339 = T["0"+v338]
v340 = T["1"+v6]
v340 = T["1"+v340]
v340 = T["1"+v340]
v340 = T["1"+v340]
v340 = T["1"+v340]
v340 = T["1"+v340]
v340 = T["1"+v340]
v340 = T["1"+v340]
v340 = T["1"+v340]
v341 = T["0"+v340]
v342 = T["1"+v3]
v342 = T["1"+v342]
v342 = T["1"+v342]
v342 = T["1"+v342]
v342 = T["1"+v342]
v342 = T["1"+v342]
v342 = T["1"+v342]
v342 = T["1"+v342]
v342 = T["1"+v342]
v343 = T["0"+v342]
v344 = T[v331+v293]
v345 = T["1"+v344]
v345 = T["1"+v345]
v345 = T["1"+v345]
v345 = T["1"+v345]
v345 = T["1"+v345]
v345 = T["1"+v345]
v345 = T["1"+v345]
v345 = T["1"+v345]
v345 = T["0"+v345]
v346 = T["1"+v345]
v346 = T["1"+v346]
v346 = T["1"+v346]
v346 = T["1"+v346]
v346 = T["1"+v346]
v346 = T["1"+v346]
v346 = T["1"+v346]
v346 = T["1"+v346]
v346 = T["1"+v346]
v347 = T["0"+v346]
v348 = T[v331+v299]
v349 = T["1"+v348]
v349 = T["1"+v349]
v349 = T["1"+v349]
v349 = T["1"+v349]
v349 = T["1"+v349]
v349 = T["1"+v349]
v349 = T["1"+v349]
v349 = T["1"+v349]
v349 = T["0"+v349]
v350 = T["1"+v349]
v350 = T["1"+v350]
v350 = T["1"+v350]
v350 = T["1"+v350]
v350 = T["1"+v350]
v350 = T["1"+v350]
v350 = T["1"+v350]
v350 = T["1"+v350]
v350 = T["1"+v350]
v351 = T["0"+v350]
v352 = T[v331+v305]
v353 = T["1"+v352]
v353 = T["1"+v353]
v353 = T["1"+v353]
v353 = T["1"+v353]
v353 = T["1"+v353]
v353 = T["1"+v353]
v353 = T["1"+v353]
v353 = T["1"+v353]
v353 = T["0"+v353]
v354 = T["1"+v353]
v354 = T["1"+v354]
v354 = T["1"+v354]
v354 = T["1"+v354]
v354 = T["1"+v354]
v354 = T["1"+v354]
v354 = T["1"+v354]
v354 = T["1"+v354]
v354 = T["1"+v354]
v355 = T["0"+v354]
v356 = T[v331+v311]
v357 = T["1"+v356]
v357 = T["1"+v357]
v357 = T["1"+v357]
v357 = T["1"+v357]
v357 = T["1"+v357]
v357 = T["1"+v357]
v357 = T["1"+v357]
v357 = T["1"+v357]
v357 = T["0"+v357]
v358 = T["1"+v357]
v358 = T["1"+v358]
v358 = T["1"+v358]
v358 = T["1"+v358]
v358 = T["1"+v358]
v358 = T["1"+v358]
v358 = T["1"+v358]
v358 = T["1"+v358]
v358 = T["1"+v358]
v359 = T["0"+v358]
v360 = T[v331+v317]
v361 = T["1"+v360]
v361 = T["1"+v361]
v361 = T["1"+v361]
v361 = T["1"+v361]
v361 = T["1"+v361]
v361 = T["1"+v361]
v361 = T["1"+v361]
v361 = T["1"+v361]
v361 = T["0"+v361]
v362 = T["1"+v361]
v362 = T["1"+v362]
v362 = T["1"+v362]
v362 = T["1"+v362]
v362 = T["1"+v362]
v362 = T["1"+v362]
v362 = T["1"+v362]
v362 = T["1"+v362]
v362 = T["1"+v362]
v363 = T["0"+v362]
v364 = T[v331+v323]
v365 = T["1"+v364]
v365 = T["1"+v365]
v365 = T["1"+v365]
v365 = T["1"+v365]
v365 = T["1"+v365]
v365 = T["1"+v365]
v365 = T["1"+v365]
v365 = T["1"+v365]
v365 = T["0"+v365]
v366 = T["1"+v365]
v366 = T["1"+v366]
v366 = T["1"+v366]
v366 = T["1"+v366]
v366 = T["1"+v366]
v366 = T["1"+v366]
v366 = T["1"+v366]
v366 = T["1"+v366]
v366 = T["1"+v366]
v367 = T["0"+v366]
v368 = T[v331+v329]
v369 = T["1"+v368]
v369 = T["1"+v369]
v369 = T["1"+v369]
v369 = T["1"+v369]
v369 = T["1"+v369]
v369 = T["1"+v369]
v369 = T["1"+v369]
v369 = T["1"+v369]
v369 = T["0"+v369]
v370 = T["1"+v369]
v370 = T["1"+v370]
v370 = T["1"+v370]
v370 = T["1"+v370]
v370 = T["1"+v370]
v370 = T["1"+v370]
v370 = T["1"+v370]
v370 = T["1"+v370]
v370 = T["1"+v370]
v371 = T["0"+v370]
v372 = T[v333+v293]
v373 = T["1"+v372]
v373 = T["1"+v373]
v373 = T["1"+v373]
v373 = T["1"+v373]
v373 = T["1"+v373]
v373 = T["1"+v373]
v373 = T["1"+v373]
v373 = T["1"+v373]
v373 = T["0"+v373]
v374 = T["1"+v373]
v374 = T["1"+v374]
v374 = T["1"+v374]
v374 = T["1"+v374]
v374 = T["1"+v374]
v374 = T["1"+v374]
v374 = T["1"+v374]
v374 = T["1"+v374]
v374 = T["1"+v374]
v375 = T["0"+v374]
v376 = T[v333+v299]
v377 = T["1"+v376]
v377 = T["1"+v377]
v377 = T["1"+v377]
v377 = T["1"+v377]
v377 = T["1"+v377]
v377 = T["1"+v377]
v377 = T["1"+v377]
v377 = T["1"+v377]
v377 = T["0"+v377]
v378 = T["1"+v377]
v378 = T["1"+v378]
v378 = T["1"+v378]
v378 = T["1"+v378]
v378 = T["1"+v378]
v378 = T["1"+v378]
v378 = T["1"+v378]
v378 = T["1"+v378]
v378 = T["1"+v378]
v379 = T["0"+v378]
v380 = T[v333+v305]
v381 = T["1"+v380]
v381 = T["1"+v381]
v381 = T["1"+v381]
v381 = T["1"+v381]
v381 = T["1"+v381]
v381 = T["1"+v381]
v381 = T["1"+v381]
v381 = T["1"+v381]
v381 = T["0"+v381]
v382 = T["1"+v381]
v382 = T["1"+v382]
v382 = T["1"+v382]
v382 = T["1"+v382]
v382 = T["1"+v382]
v382 = T["1"+v382]
v382 = T["1"+v382]
v382 = T["1"+v382]
v382 = T["1"+v382]
v383 = T["0"+v382]
v384 = T[v333+v311]
v385 = T["1"+v384]
v385 = T["1"+v385]
v385 = T["1"+v385]
v385 = T["1"+v385]
v385 = T["1"+v385]
v385 = T["1"+v385]
v385 = T["1"+v385]
v385 = T["1"+v385]
v385 = T["0"+v385]
v386 = T["1"+v385]
v386 = T["1"+v386]
v386 = T["1"+v386]
v386 = T["1"+v386]
v386 = T["1"+v386]
v386 = T["1"+v386]
v386 = T["1"+v386]
v386 = T["1"+v386]
v386 = T["1"+v386]
v387 = T["0"+v386]
v388 = T[v333+v317]
v389 = T["1"+v388]
v389 = T["1"+v389]
v389 = T["1"+v389]
v389 = T["1"+v389]
v389 = T["1"+v389]
v389 = T["1"+v389]
v389 = T["1"+v389]
v389 = T["1"+v389]
v389 = T["0"+v389]
v390 = T["1"+v389]
v390 = T["1"+v390]
v390 = T["1"+v390]
v390 = T["1"+v390]
v390 = T["1"+v390]
v390 = T["1"+v390]
v390 = T["1"+v390]
v390 = T["1"+v390]
v390 = T["1"+v390]
v391 = T["0"+v390]
v392 = T[v333+v323]
v393 = T["1"+v392]
v393 = T["1"+v393]
v393 = T["1"+v393]
v393 = T["1"+v393]
v393 = T["1"+v393]
v393 = T["1"+v393]
v393 = T["1"+v393]
v393 = T["1"+v393]
v393 = T["0"+v393]
v394 = T["1"+v393]
v394 = T["1"+v394]
v394 = T["1"+v394]
v394 = T["1"+v394]
v394 = T["1"+v394]
v394 = T["1"+v394]
v394 = T["1"+v394]
v394 = T["1"+v394]
v394 = T["1"+v394]
v395 = T["0"+v394]
v396 = T[v333+v329]
v397 = T["1"+v396]
v397 = T["1"+v397]
v397 = T["1"+v397]
v397 = T["1"+v397]
v397 = T["1"+v397]
v397 = T["1"+v397]
v397 = T["1"+v397]
v397 = T["1"+v397]
v397 = T["0"+v397]
v398 = T["1"+v397]
v398 = T["1"+v398]
v398 = T["1"+v398]
v398 = T["1"+v398]
v398 = T["1"+v398]
v398 = T["1"+v398]
v398 = T["1"+v398]
v398 = T["1"+v398]
v398 = T["1"+v398]
v399 = T["0"+v398]
v400 = T[v335+v293]
v401 = T["1"+v400]
v401 = T["1"+v401]
v401 = T["1"+v401]
v401 = T["1"+v401]
v401 = T["1"+v401]
v401 = T["1"+v401]
v401 = T["1"+v401]
v401 = T["1"+v401]
v401 = T["0"+v401]
v402 = T["1"+v401]
v402 = T["1"+v402]
v402 = T["1"+v402]
v402 = T["1"+v402]
v402 = T["1"+v402]
v402 = T["1"+v402]
v402 = T["1"+v402]
v402 = T["1"+v402]
v402 = T["1"+v402]
v403 = T["0"+v402]
v404 = T[v335+v299]
v405 = T["1"+v404]
v405 = T["1"+v405]
v405 = T["1"+v405]
v405 = T["1"+v405]
v405 = T["1"+v405]
v405 = T["1"+v405]
v405 = T["1"+v405]
v405 = T["1"+v405]
v405 = T["0"+v405]
v406 = T["1"+v405]
v406 = T["1"+v406]
v406 = T["1"+v406]
v406 = T["1"+v406]
v406 = T["1"+v406]
v406 = T["1"+v406]
v406 = T["1"+v406]
v406 = T["1"+v406]
v406 = T["1"+v406]
v407 = T["0"+v406]
v408 = T[v335+v305]
v409 = T["1"+v408]
v409 = T["1"+v409]
v409 = T["1"+v409]
v409 = T["1"+v409]
v409 = T["1"+v409]
v409 = T["1"+v409]
v409 = T["1"+v409]
v409 = T["1"+v409]
v409 = T["0"+v409]
v410 = T["1"+v409]
v410 = T["1"+v410]
v410 = T["1"+v410]
v410 = T["1"+v410]
v410 = T["1"+v410]
v410 = T["1"+v410]
v410 = T["1"+v410]
v410 = T["1"+v410]
v410 = T["1"+v410]
v411 = T["0"+v410]
v412 = T[v335+v311]
v413 = T["1"+v412]
v413 = T["1"+v413]
v413 = T["1"+v413]
v413 = T["1"+v413]
v413 = T["1"+v413]
v413 = T["1"+v413]
v413 = T["1"+v413]
v413 = T["1"+v413]
v413 = T["0"+v413]
v414 = T["1"+v413]
v414 = T["1"+v414]
v414 = T["1"+v414]
v414 = T["1"+v414]
v414 = T["1"+v414]
v414 = T["1"+v414]
v414 = T["1"+v414]
v414 = T["1"+v414]
v414 = T["1"+v414]
v415 = T["0"+v414]
v416 = T[v335+v317]
v417 = T["1"+v416]
v417 = T["1"+v417]
v417 = T["1"+v417]
v417 = T["1"+v417]
v417 = T["1"+v417]
v417 = T["1"+v417]
v417 = T["1"+v417]
v417 = T["1"+v417]
v417 = T["0"+v417]
v418 = T["1"+v417]
v418 = T["1"+v418]
v418 = T["1"+v418]
v418 = T["1"+v418]
v418 = T["1"+v418]
v418 = T["1"+v418]
v418 = T["1"+v418]
v418 = T["1"+v418]
v418 = T["1"+v418]
v419 = T["0"+v418]
v420 = T[v335+v323]
v421 = T["1"+v420]
v421 = T["1"+v421]
v421 = T["1"+v421]
v421 = T["1"+v421]
v421 = T["1"+v421]
v421 = T["1"+v421]
v421 = T["1"+v421]
v421 = T["1"+v421]
v421 = T["0"+v421]
v422 = T["1"+v421]
v422 = T["1"+v422]
v422 = T["1"+v422]
v422 = T["1"+v422]
v422 = T["1"+v422]
v422 = T["1"+v422]
v422 = T["1"+v422]
v422 = T["1"+v422]
v422 = T["1"+v422]
v423 = T["0"+v422]
v424 = T[v335+v329]
v425 = T["1"+v424]
v425 = T["1"+v425]
v425 = T["1"+v425]
v425 = T["1"+v425]
v425 = T["1"+v425]
v425 = T["1"+v425]
v425 = T["1"+v425]
v425 = T["1"+v425]
v425 = T["0"+v425]
v426 = T["1"+v425]
v426 = T["1"+v426]
v426 = T["1"+v426]
v426 = T["1"+v426]
v426 = T["1"+v426]
v426 = T["1"+v426]
v426 = T["1"+v426]
v426 = T["1"+v426]
v426 = T["1"+v426]
v427 = T["0"+v426]
v428 = T[v337+v293]
v429 = T["1"+v428]
v429 = T["1"+v429]
v429 = T["1"+v429]
v429 = T["1"+v429]
v429 = T["1"+v429]
v429 = T["1"+v429]
v429 = T["1"+v429]
v429 = T["1"+v429]
v429 = T["0"+v429]
v430 = T["1"+v429]
v430 = T["1"+v430]
v430 = T["1"+v430]
v430 = T["1"+v430]
v430 = T["1"+v430]
v430 = T["1"+v430]
v430 = T["1"+v430]
v430 = T["1"+v430]
v430 = T["1"+v430]
v431 = T["0"+v430]
v432 = T[v337+v299]
v433 = T["1"+v432]
v433 = T["1"+v433]
v433 = T["1"+v433]
v433 = T["1"+v433]
v433 = T["1"+v433]
v433 = T["1"+v433]
v433 = T["1"+v433]
v433 = T["1"+v433]
v433 = T["0"+v433]
v434 = T["1"+v433]
v434 = T["1"+v434]
v434 = T["1"+v434]
v434 = T["1"+v434]
v434 = T["1"+v434]
v434 = T["1"+v434]
v434 = T["1"+v434]
v434 = T["1"+v434]
v434 = T["1"+v434]
v435 = T["0"+v434]
v436 = T[v337+v305]
v437 = T["1"+v436]
v437 = T["1"+v437]
v437 = T["1"+v437]
v437 = T["1"+v437]
v437 = T["1"+v437]
v437 = T["1"+v437]
v437 = T["1"+v437]
v437 = T["1"+v437]
v437 = T["0"+v437]
v438 = T["1"+v437]
v438 = T["1"+v438]
v438 = T["1"+v438]
v438 = T["1"+v438]
v438 = T["1"+v438]
v438 = T["1"+v438]
v438 = T["1"+v438]
v438 = T["1"+v438]
v438 = T["1"+v438]
v439 = T["0"+v438]
v440 = T[v337+v311]
v441 = T["1"+v440]
v441 = T["1"+v441]
v441 = T["1"+v441]
v441 = T["1"+v441]
v441 = T["1"+v441]
v441 = T["1"+v441]
v441 = T["1"+v441]
v441 = T["1"+v441]
v441 = T["0"+v441]
v442 = T["1"+v441]
v442 = T["1"+v442]
v442 = T["1"+v442]
v442 = T["1"+v442]
v442 = T["1"+v442]
v442 = T["1"+v442]
v442 = T["1"+v442]
v442 = T["1"+v442]
v442 = T["1"+v442]
v443 = T["0"+v442]
v444 = T[v337+v317]
v445 = T["1"+v444]
v445 = T["1"+v445]
v445 = T["1"+v445]
v445 = T["1"+v445]
v445 = T["1"+v445]
v445 = T["1"+v445]
v445 = T["1"+v445]
v445 = T["1"+v445]
v445 = T["0"+v445]
v446 = T["1"+v445]
v446 = T["1"+v446]
v446 = T["1"+v446]
v446 = T["1"+v446]
v446 = T["1"+v446]
v446 = T["1"+v446]
v446 = T["1"+v446]
v446 = T["1"+v446]
v446 = T["1"+v446]
v447 = T["0"+v446]
v448 = T[v337+v323]
v449 = T["1"+v448]
v449 = T["1"+v449]
v449 = T["1"+v449]
v449 = T["1"+v449]
v449 = T["1"+v449]
v449 = T["1"+v449]
v449 = T["1"+v449]
v449 = T["1"+v449]
v449 = T["0"+v449]
v450 = T["1"+v449]
v450 = T["1"+v450]
v450 = T["1"+v450]
v450 = T["1"+v450]
v450 = T["1"+v450]
v450 = T["1"+v450]
v450 = T["1"+v450]
v450 = T["1"+v450]
v450 = T["1"+v450]
v451 = T["0"+v450]
v452 = T[v337+v329]
v453 = T["1"+v452]
v453 = T["1"+v453]
v453 = T["1"+v453]
v453 = T["1"+v453]
v453 = T["1"+v453]
v453 = T["1"+v453]
v453 = T["1"+v453]
v453 = T["1"+v453]
v453 = T["0"+v453]
v454 = T["1"+v453]
v454 = T["1"+v454]
v454 = T["1"+v454]
v454 = T["1"+v454]
v454 = T["1"+v454]
v454 = T["1"+v454]
v454 = T["1"+v454]
v454 = T["1"+v454]
v454 = T["1"+v454]
v455 = T["0"+v454]
v456 = T[v339+v293]
v457 = T["1"+v456]
v457 = T["1"+v457]
v457 = T["1"+v457]
v457 = T["1"+v457]
v457 = T["1"+v457]
v457 = T["1"+v457]
v457 = T["1"+v457]
v457 = T["1"+v457]
v457 = T["0"+v457]
v458 = T["1"+v457]
v458 = T["1"+v458]
v458 = T["1"+v458]
v458 = T["1"+v458]
v458 = T["1"+v458]
v458 = T["1"+v458]
v458 = T["1"+v458]
v458 = T["1"+v458]
v458 = T["1"+v458]
v459 = T["0"+v458]
v460 = T[v339+v299]
v461 = T["1"+v460]
v461 = T["1"+v461]
v461 = T["1"+v461]
v461 = T["1"+v461]
v461 = T["1"+v461]
v461 = T["1"+v461]
v461 = T["1"+v461]
v461 = T["1"+v461]
v461 = T["0"+v461]
v462 = T["1"+v461]
v462 = T["1"+v462]
v462 = T["1"+v462]
v462 = T["1"+v462]
v462 = T["1"+v462]
v462 = T["1"+v462]
v462 = T["1"+v462]
v462 = T["1"+v462]
v462 = T["1"+v462]
v463 = T["0"+v462]
v464 = T[v339+v305]
v465 = T["1"+v464]
v465 = T["1"+v465]
v465 = T["1"+v465]
v465 = T["1"+v465]
v465 = T["1"+v465]
v465 = T["1"+v465]
v465 = T["1"+v465]
v465 = T["1"+v465]
v465 = T["0"+v465]
v466 = T["1"+v465]
v466 = T["1"+v466]
v466 = T["1"+v466]
v466 = T["1"+v466]
v466 = T["1"+v466]
v466 = T["1"+v466]
v466 = T["1"+v466]
v466 = T["1"+v466]
v466 = T["1"+v466]
v467 = T["0"+v466]
v468 = T[v339+v311]
v469 = T["1"+v468]
v469 = T["1"+v469]
v469 = T["1"+v469]
v469 = T["1"+v469]
v469 = T["1"+v469]
v469 = T["1"+v469]
v469 = T["1"+v469]
v469 = T["1"+v469]
v469 = T["0"+v469]
v470 = T["1"+v469]
v470 = T["1"+v470]
v470 = T["1"+v470]
v470 = T["1"+v470]
v470 = T["1"+v470]
v470 = T["1"+v470]
v470 = T["1"+v470]
v470 = T["1"+v470]
v470 = T["1"+v470]
v471 = T["0"+v470]
v472 = T[v339+v317]
v473 = T["1"+v472]
v473 = T["1"+v473]
v473 = T["1"+v473]
v473 = T["1"+v473]
v473 = T["1"+v473]
v473 = T["1"+v473]
v473 = T["1"+v473]
v473 = T["1"+v473]
v473 = T["0"+v473]
v474 = T["1"+v473]
v474 = T["1"+v474]
v474 = T["1"+v474]
v474 = T["1"+v474]
v474 = T["1"+v474]
v474 = T["1"+v474]
v474 = T["1"+v474]
v474 = T["1"+v474]
v474 = T["1"+v474]
v475 = T["0"+v474]
v476 = T[v339+v323]
v477 = T["1"+v476]
v477 = T["1"+v477]
v477 = T["1"+v477]
v477 = T["1"+v477]
v477 = T["1"+v477]
v477 = T["1"+v477]
v477 = T["1"+v477]
v477 = T["1"+v477]
v477 = T["0"+v477]
v478 = T["1"+v477]
v478 = T["1"+v478]
v478 = T["1"+v478]
v478 = T["1"+v478]
v478 = T["1"+v478]
v478 = T["1"+v478]
v478 = T["1"+v478]
v478 = T["1"+v478]
v478 = T["1"+v478]
v479 = T["0"+v478]
v480 = T[v339+v329]
v481 = T["1"+v480]
v481 = T["1"+v481]
v481 = T["1"+v481]
v481 = T["1"+v481]
v481 = T["1"+v481]
v481 = T["1"+v481]
v481 = T["1"+v481]
v481 = T["1"+v481]
v481 = T["0"+v481]
v482 = T["1"+v481]
v482 = T["1"+v482]
v482 = T["1"+v482]
v482 = T["1"+v482]
v482 = T["1"+v482]
v482 = T["1"+v482]
v482 = T["1"+v482]
v482 = T["1"+v482]
v482 = T["1"+v482]
v483 = T["0"+v482]
v484 = T[v341+v293]
v485 = T["1"+v484]
v485 = T["1"+v485]
v485 = T["1"+v485]
v485 = T["1"+v485]
v485 = T["1"+v485]
v485 = T["1"+v485]
v485 = T["1"+v485]
v485 = T["1"+v485]
v485 = T["0"+v485]
v486 = T["1"+v485]
v486 = T["1"+v486]
v486 = T["1"+v486]
v486 = T["1"+v486]
v486 = T["1"+v486]
v486 = T["1"+v486]
v486 = T["1"+v486]
v486 = T["1"+v486]
v486 = T["1"+v486]
v487 = T["0"+v486]
v488 = T[v341+v299]
v489 = T["1"+v488]
v489 = T["1"+v489]
v489 = T["1"+v489]
v489 = T["1"+v489]
v489 = T["1"+v489]
v489 = T["1"+v489]
v489 = T["1"+v489]
v489 = T["1"+v489]
v489 = T["0"+v489]
v490 = T["1"+v489]
v490 = T["1"+v490]
v490 = T["1"+v490]
v490 = T["1"+v490]
v490 = T["1"+v490]
v490 = T["1"+v490]
v490 = T["1"+v490]
v490 = T["1"+v490]
v490 = T["1"+v490]
v491 = T["0"+v490]
v492 = T[v341+v305]
v493 = T["1"+v492]
v493 = T["1"+v493]
v493 = T["1"+v493]
v493 = T["1"+v493]
v493 = T["1"+v493]
v493 = T["1"+v493]
v493 = T["1"+v493]
v493 = T["1"+v493]
v493 = T["0"+v493]
v494 = T["1"+v493]
v494 = T["1"+v494]
v494 = T["1"+v494]
v494 = T["1"+v494]
v494 = T["1"+v494]
v494 = T["1"+v494]
v494 = T["1"+v494]
v494 = T["1"+v494]
v494 = T["1"+v494]
v495 = T["0"+v494]
v496 = T[v341+v311]
v497 = T["1"+v496]
v497 = T["1"+v497]
v497 = T["1"+v497]
v497 = T["1"+v497]
v497 = T["1"+v497]
v497 = T["1"+v497]
v497 = T["1"+v497]
v497 = T["1"+v497]
v497 = T["0"+v497]
v498 = T["1"+v497]
v498 = T["1"+v498]
v498 = T["1"+v498]
v498 = T["1"+v498]
v498 = T["1"+v498]
v498 = T["1"+v498]
v498 = T["1"+v498]
v498 = T["1"+v498]
v498 = T["1"+v498]
v499 = T["0"+v498]
v500 = T[v341+v317]
v501 = T["1"+v500]
v501 = T["1"+v501]
v501 = T["1"+v501]
v501 = T["1"+v501]
v501 = T["1"+v501]
v501 = T["1"+v501]
v501 = T["1"+v501]
v501 = T["1"+v501]
v501 = T["0"+v501]
v502 = T["1"+v501]
v502 = T["1"+v502]
v502 = T["1"+v502]
v502 = T["1"+v502]
v502 = T["1"+v502]
v502 = T["1"+v502]
v502 = T["1"+v502]
v502 = T["1"+v502]
v502 = T["1"+v502]
v503 = T["0"+v502]
v504 = T[v341+v323]
v505 = T["1"+v504]
v505 = T["1"+v505]
v505 = T["1"+v505]
v505 = T["1"+v505]
v505 = T["1"+v505]
v505 = T["1"+v505]
v505 = T["1"+v505]
v505 = T["1"+v505]
v505 = T["0"+v505]
v506 = T["1"+v505]
v506 = T["1"+v506]
v506 = T["1"+v506]
v506 = T["1"+v506]
v506 = T["1"+v506]
v506 = T["1"+v506]
v506 = T["1"+v506]
v506 = T["1"+v506]
v506 = T["1"+v506]
v507 = T["0"+v506]
v508 = T[v341+v329]
v509 = T["1"+v508]
v509 = T["1"+v509]
v509 = T["1"+v509]
v509 = T["1"+v509]
v509 = T["1"+v509]
v509 = T["1"+v509]
v509 = T["1"+v509]
v509 = T["1"+v509]
v509 = T["0"+v509]
v510 = T["1"+v509]
v510 = T["1"+v510]
v510 = T["1"+v510]
v510 = T["1"+v510]
v510 = T["1"+v510]
v510 = T["1"+v510]
v510 = T["1"+v510]
v510 = T["1"+v510]
v510 = T["1"+v510]
v511 = T["0"+v510]
v512 = T[v343+v293]
v513 = T["1"+v512]
v513 = T["1"+v513]
v513 = T["1"+v513]
v513 = T["1"+v513]
v513 = T["1"+v513]
v513 = T["1"+v513]
v513 = T["1"+v513]
v513 = T["1"+v513]
v513 = T["0"+v513]
v514 = T["1"+v513]
v514 = T["1"+v514]
v514 = T["1"+v514]
v514 = T["1"+v514]
v514 = T["1"+v514]
v514 = T["1"+v514]
v514 = T["1"+v514]
v514 = T["1"+v514]
v514 = T["1"+v514]
v515 = T["0"+v514]
v516 = T[v343+v299]
v517 = T["1"+v516]
v517 = T["1"+v517]
v517 = T["1"+v517]
v517 = T["1"+v517]
v517 = T["1"+v517]
v517 = T["1"+v517]
v517 = T["1"+v517]
v517 = T["1"+v517]
v517 = T["0"+v517]
v518 = T["1"+v517]
v518 = T["1"+v518]
v518 = T["1"+v518]
v518 = T["1"+v518]
v518 = T["1"+v518]
v518 = T["1"+v518]
v518 = T["1"+v518]
v518 = T["1"+v518]
v518 = T["1"+v518]
v519 = T["0"+v518]
v520 = T[v343+v305]
v521 = T["1"+v520]
v521 = T["1"+v521]
v521 = T["1"+v521]
v521 = T["1"+v521]
v521 = T["1"+v521]
v521 = T["1"+v521]
v521 = T["1"+v521]
v521 = T["1"+v521]
v521 = T["0"+v521]
v522 = T["1"+v521]
v522 = T["1"+v522]
v522 = T["1"+v522]
v522 = T["1"+v522]
v522 = T["1"+v522]
v522 = T["1"+v522]
v522 = T["1"+v522]
v522 = T["1"+v522]
v522 = T["1"+v522]
v523 = T["0"+v522]
v524 = T[v343+v311]
v525 = T["1"+v524]
v525 = T["1"+v525]
v525 = T["1"+v525]
v525 = T["1"+v525]
v525 = T["1"+v525]
v525 = T["1"+v525]
v525 = T["1"+v525]
v525 = T["1"+v525]
v525 = T["0"+v525]
v526 = T["1"+v525]
v526 = T["1"+v526]
v526 = T["1"+v526]
v526 = T["1"+v526]
v526 = T["1"+v526]
v526 = T["1"+v526]
v526 = T["1"+v526]
v526 = T["1"+v526]
v526 = T["1"+v526]
v527 = T["0"+v526]
v528 = T[v343+v317]
v529 = T["1"+v528]
v529 = T["1"+v529]
v529 = T["1"+v529]
v529 = T["1"+v529]
v529 = T["1"+v529]
v529 = T["1"+v529]
v529 = T["1"+v529]
v529 = T["1"+v529]
v529 = T["0"+v529]
v530 = T["1"+v529]
v530 = T["1"+v530]
v530 = T["1"+v530]
v530 = T["1"+v530]
v530 = T["1"+v530]
v530 = T["1"+v530]
v530 = T["1"+v530]
v530 = T["1"+v530]
v530 = T["1"+v530]
v531 = T["0"+v530]
v532 = T[v343+v323]
v533 = T["1"+v532]
v533 = T["1"+v533]
v533 = T["1"+v533]
v533 = T["1"+v533]
v533 = T["1"+v533]
v533 = T["1"+v533]
v533 = T["1"+v533]
v533 = T["1"+v533]
v533 = T["0"+v533]
v534 = T["1"+v533]
v534 = T["1"+v534]
v534 = T["1"+v534]
v534 = T["1"+v534]
v534 = T["1"+v534]
v534 = T["1"+v534]
v534 = T["1"+v534]
v534 = T["1"+v534]
v534 = T["1"+v534]
v535 = T["0"+v534]
v536 = T[v343+v329]
v537 = T["1"+v536]
v537 = T["1"+v537]
v537 = T["1"+v537]
v537 = T["1"+v537]
v537 = T["1"+v537]
v537 = T["1"+v537]
v537 = T["1"+v537]
v537 = T["1"+v537]
v537 = T["0"+v537]
v538 = T["1"+v537]
v538 = T["1"+v538]
v538 = T["1"+v538]
v538 = T["1"+v538]
v538 = T["1"+v538]
v538 = T["1"+v538]
v538 = T["1"+v538]
v538 = T["1"+v538]
v538 = T["1"+v538]
v539 = T["0"+v538]
v540 = T[v347+v399]
v540 = T["0"+v540]
v541 = T[v540+v423]
v541 = T["0"+v541]
v542 = T[v541+v447]
v542 = T["0"+v542]
v543 = T[v542+v471]
v543 = T["0"+v543]
v544 = T[v543+v495]
v544 = T["0"+v544]
v545 = T[v544+v519]
v545 = T["0"+v545]
v546 = T[v351+v375]
v546 = T["0"+v546]
v547 = T[v546+v427]
v547 = T["0"+v547]
v548 = T[v547+v451]
v548 = T["0"+v548]
v549 = T[v548+v475]
v549 = T["0"+v549]
v550 = T[v549+v499]
v550 = T["0"+v550]
v551 = T[v550+v523]
v551 = T["0"+v551]
v552 = T[v355+v379]
v552 = T["0"+v552]
v553 = T[v552+v403]
v553 = T["0"+v553]
v554 = T[v553+v455]
v554 = T["0"+v554]
v555 = T[v554+v479]
v555 = T["0"+v555]
v556 = T[v555+v503]
v556 = T["0"+v556]
v557 = T[v556+v527]
v557 = T["0"+v557]
v558 = T[v359+v383]
v558 = T["0"+v558]
v559 = T[v558+v407]
v559 = T["0"+v559]
v560 = T[v559+v431]
v560 = T["0"+v560]
v561 = T[v560+v483]
v561 = T["0"+v561]
v562 = T[v561+v507]
v562 = T["0"+v562]
v563 = T[v562+v531]
v563 = T["0"+v563]
v564 = T[v363+v387]
v564 = T["0"+v564]
v565 = T[v564+v411]
v565 = T["0"+v565]
v566 = T[v565+v435]
v566 = T["0"+v566]
v567 = T[v566+v459]
v567 = T["0"+v567]
v568 = T[v567+v511]
v568 = T["0"+v568]
v569 = T[v568+v535]
v569 = T["0"+v569]
v570 = T[v367+v391]
v570 = T["0"+v570]
v571 = T[v570+v415]
v571 = T["0"+v571]
v572 = T[v571+v439]
v572 = T["0"+v572]
v573 = T[v572+v463]
v573 = T["0"+v573]
v574 = T[v573+v487]
v574 = T["0"+v574]
v575 = T[v574+v539]
v575 = T["0"+v575]
v576 = T[v371+v395]
v576 = T["0"+v576]
v577 = T[v576+v419]
v577 = T["0"+v577]
v578 = T[v577+v443]
v578 = T["0"+v578]
v579 = T[v578+v467]
v579 = T["0"+v579]
v580 = T[v579+v491]
v580 = T["0"+v580]
v581 = T[v580+v515]
v581 = T["0"+v581]
v582 = T["1"+v545]
v582 = T["1"+v582]
v582 = T["1"+v582]
v582 = T["1"+v582]
v582 = T["1"+v582]
v582 = T["1"+v582]
v582 = T["1"+v582]
v582 = T["1"+v582]
v582 = T["1"+v582]
v583 = T["0"+v582]
v584 = T["1"+v581]
v584 = T["1"+v584]
v584 = T["1"+v584]
v584 = T["1"+v584]
v584 = T["1"+v584]
v584 = T["1"+v584]
v584 = T["1"+v584]
v584 = T["1"+v584]
v584 = T["1"+v584]
v585 = T["0"+v584]
v586 = T["1"+v575]
v586 = T["1"+v586]
v586 = T["1"+v586]
v586 = T["1"+v586]
v586 = T["1"+v586]
v586 = T["1"+v586]
v586 = T["1"+v586]
v586 = T["1"+v586]
v586 = T["1"+v586]
v587 = T["0"+v586]
v588 = T["1"+v569]
v588 = T["1"+v588]
v588 = T["1"+v588]
v588 = T["1"+v588]
v588 = T["1"+v588]
v588 = T["1"+v588]
v588 = T["1"+v588]
v588 = T["1"+v588]
v588 = T["1"+v588]
v589 = T["0"+v588]
v590 = T["1"+v563]
v590 = T["1"+v590]
v590 = T["1"+v590]
v590 = T["1"+v590]
v590 = T["1"+v590]
v590 = T["1"+v590]
v590 = T["1"+v590]
v590 = T["1"+v590]
v590 = T["1"+v590]
v591 = T["0"+v590]
v592 = T["1"+v557]
v592 = T["1"+v592]
v592 = T["1"+v592]
v592 = T["1"+v592]
v592 = T["1"+v592]
v592 = T["1"+v592]
v592 = T["1"+v592]
v592 = T["1"+v592]
v592 = T["1"+v592]
v593 = T["0"+v592]
v594 = T["1"+v551]
v594 = T["1"+v594]
v594 = T["1"+v594]
v594 = T["1"+v594]
v594 = T["1"+v594]
v594 = T["1"+v594]
v594 = T["1"+v594]
v594 = T["1"+v594]
v594 = T["1"+v594]
v595 = T["0"+v594]
v596 = T[v583+"1"]
v596 = T[v585+v596]
v596 = T[v587+v596]
v596 = T[v589+v596]
v596 = T[v591+v596]
v596 = T[v593+v596]
v596 = T[v595+v596]
v597 = T["1"+v596]
v597 = T["1"+v597]
v597 = T["1"+v597]
v597 = T["1"+v597]
v597 = T["1"+v597]
v597 = T["1"+v597]
v597 = T["1"+v597]
v597 = T["1"+v597]
v597 = T["1"+v597]
output = v597


Generator code:

import functools
print("""
T = {
"00": "0", "01":"1", "02":"1", "03":"1", "04":"1", "05":"1", "06":"1", "07":"1", "08":"1", "09":"1",
"10": "1", "11":"2", "12":"3", "13":"4", "14":"5", "15":"6", "16":"7", "17":"8", "18":"9", "19":"0"
}
""".strip())

varn = 0
def getvar():
global varn
ret = 'v' + str(varn)
varn += 1
return ret
if imm == 0: return vi
ni = getvar()
for i in range(imm):
print('%s = T["1"+%s]' % (ni, vi if i == 0 else ni))
return ni
def enot(bi):
ni = getvar()
print('%s = T["0"+%s]' % (ni, bi2))
return ni
def eor(b1, b2):
ni = getvar()
print('%s = T[%s+%s]' % (ni, b1, b2))
print('%s = T["0"+%s]' % (ni, ni))
return ni
def enor(b1, b2):
return enot(eor(b1, b2))
#def eand(b1, b2):
#   return enor(enot(b1), enot(b2))
def eand(b1, b2):
ni = getvar()
print('%s = T[%s+%s]' % (ni, b1, b2))
print('%s = T["0"+%s]' % (ni, ni))
return enot(ni)
def exor(b1, b2):
return enor(enor(enot(b1), enot(b2)), enor(b1, b2))
def eeqt(vi):
#return array of 10 bits for all 10 possible values of vi. inverted
res = []
vi2 = getvar()
for i in range(10):
ni = getvar()
print('%s = T["0"+%s]' % (ni, vi if i == 0 else vi2))
print('%s = T["1"+%s]' % (vi2, vi if i == 0 else vi2))
res.append(ni)
#e.g. res[0] = !(x == 0)
return res[0:1] + res[1:][::-1]
def edmon(m1, m2):
#decode m2 using eeqt. create 2 more variables for november and december
m2p = eeqt(m2)
v11 = eor(m2p[1], enot(m1))
m2p[1] = eor(m2p[1], m1)
v12 = eor(m2p[2], enot(m1))
m2p[2] = eor(m2p[2], m1)
ret = m2p + [v11, v12]
#return ret
return ret[1:10] + ret[0:1] + ret[10:]
def elmon(dmon):
#given output of edmon, find first day modulo 7. also output inverted!
#table = [4, 0, 0, 3, 5, 1, 3, 6, 2, 4, 0, 2]
d0 = eand(eand(dmon[1], dmon[2]), dmon[10])
d1 = dmon[5]
d2 = eand(dmon[8], dmon[11])
d3 = eand(dmon[3], dmon[6])
d4 = eand(dmon[0], dmon[9])
d5 = dmon[4]
d6 = dmon[7]
return [d0,d1,d2,d3,d4,d5,d6]
def enotarr(a):
return [enot(x) for x in a]
vals = [[] for _ in range(7)]
for a in range(7):
for b in range(7):
vals[(a+b)%7].append(eand(v1[a], v2[b]))
return [functools.reduce(eor, a) for a in vals]

def emod7(d2):
et = eeqt(d2)
et = enotarr(et)
et[0] = eor(et[0], et[7])
et[1] = eor(et[1], et[8])
et[2] = eor(et[2], et[9])
return et[0:7]
def e3mod7(d1):
et = eeqt(d1) # can't optimize because entries are obtained like 0, 9, 8, ... and 1 must be reached
#d1 < 4. multiply by 3
#0*3 = 0, 1*3 = 3, 2*3 = 6, 3*3 = 2
return [enot(et[0]), '"0"', enot(et[3]), enot(et[1]), '"0"', '"0"', enot(et[2])]

def eout(m7):
m7 = enotarr(m7)
val = '"1"'
ni = getvar()
for x in m7:
print('%s = T[%s+%s]' % (ni, x, val))
val = ni

def solve(m1, m2, d1, d2):
mmod7 = elmon(edmon(m1, m2))
res = res[1:] + res[:1]
return eout(res[::-1])

#print(eaddinv(['A'+str(i) for i in range(7)], ['B'+str(i) for i in range(7)]))

#print('print(' + ', '.join(elmon(edmon('M1', 'M2'))) + ')')
#print('print(' + ', '.join(edmon('M1', 'M2')) + ')')

#print('output =', '['+','.join(e3mod7('d1'))+']')
#print('output =', '['+','.join(emod7('d2'))+']')
#print('output =', '['+','.join(solve('m1','m2','d1','d2'))+']')
print('output =', solve('m1', 'm2', 'd1', 'd2'))


No TIO links because of the code size. The generator can be run as python3 x.py > solution.py.

# Explanation

In the table T, T[0x] is 0 when x is 0 and 1 otherwise, and T[1x] is (x+1) % 10. Then logic can be performed on values in (0, 1):

!bit = T['0' + (bit+9)]
b1 | b2 = T['0' + T[b1 + b2]]


OR and NOT are functionally complete (and can be used to evaluate any boolean function). To perform any boolean calculations on the input, it should be converted to bits. In my code, it's done like this:

!(x == 0) = T['0' + x]
!(x == 9) = T['0' + (x+1)%10]
!(x == 8) = T['0' + (x+2)%10]
...
!(x == 1) = T['0' + (x+9)%10]


(and a 10-bit representation is obtained from this). To convert a sequence of bits to a number, the following is used in my code:

x = 1
x = T[bit1 + x]
x = T[bit2 + x]
x = T[bit3 + x]
...
x = T[bitn + x]
x = x + 9


After this, x is the number of zeroes after the last 1 in the sequence of bits (modulo 10 and assuming the sequence of bits is short). In my code, integers modulo 7 are represented as sequences of 7 bits (when the bit at index i is set, the integer is equal to i). Some calculations are performed with inverted values. Addition is implemented by checking for all 49 possible cases and selecting the correct output.

• I left some comments in the chat room chat.stackexchange.com/transcript/message/57062225#57062225 Feb 15, 2021 at 13:41
• Combined, but with what?
– Neil
Feb 16, 2021 at 14:53
• @Neil With the (64, 4) answer. I see it's been updated now. Feb 16, 2021 at 15:23
• I think your T0 might be inefficient; inverting it should cut your B to about 800 or so. I'm still trying to work out how eout would work though, since I can't figure out what it's doing.
– Neil
Feb 16, 2021 at 15:24
• @Neil eout inverts bit sequences and converts them to numbers; for example, 0100000 becomes 1011111 and 1011111 becomes 5 (the number of ones after the last zero in 1011111). It works because T['0'+almost anything] is 1 (so the last zero resets the counter to 1, all following 1s increment it, and 9 is added in the end to output numbers in [0, 6] instead of [1, 7]). Feb 16, 2021 at 15:34