MN3JXJ2OQHDWUWRCLXMLGDXNMAW5TC5IQ26XXBL7GSTSTCUPENDAC
Advent of Code 2020
Mostly to try new things. I solved problems up to day 6 exclusively in the
python REPL.
tr
rt
tr
rt
tr
fdrhu
gwuksvro
tesnouwyrdf
twofuspcmvenh
cnxpsmuqiaw
cxovminqpawus
qwaxjmupnsic
anpskchzojyeguwr
soqauprxzgmycvef
sorplgezycau
ngrecposyizwau
ayeptrilsnguzco
mvwcl
vlcwxm
uwcflhpkjor
blnvwtic
wcmzl
hyvowmqzixc
lacsrjdyxiz
fyczpbxlti
qxjhrgefbkm
eqrgbfhjxkcm
catsrkyjulmfzvixe
teyxvimulfkczqrjsa
xrtlyaqemsucjzkifv
drjlmncsiftxaeyzvpuk
ocgrnldhja
jicwgntvuhk
cxgajhln
hczyoipegqwsubvxma
zapvqdbyeiulmrsx
qmuxbtispezvayk
ibpqvsxaueymzr
jpzavtxymusibeq
iomtep
obmfpitqde
hrmoiept
iprtomeh
dvqtfm
vfqdmt
vfmqtd
svacthonwbmxiyukjr
rmtjsowahbxn
wopxrhjdantsblme
kunw
nlar
wson
eranj
zfpignmvxqc
mjulrb
mjrlbu
sjdlfgertkv
lwvfoaxjknuh
usapkhx
afpuhsx
uaphsx
haupexsf
qhmryxjuaps
mpjfb
mjbfp
zbdpmvijwyxkgroshe
yjblgvprhmoszfwdxe
dyrjngwpueozmshvbx
pevyiohbdgxrjsmzw
ybmexhpidzsgojvwr
obcqvydzetjsuhgif
yvdqgeithsfjzucob
jfqzsiovutgwychbed
qizcbjpshyretdgoflnvu
hbefytgcvdzuaisqjo
avfgq
gq
lqg
qwgr
fekswrjbzhyng
sfwnkybhzegjr
hkgywzefsnrbj
zfkivbjeyrwnhdgsx
ztusijyhclvowf
cwvjzuflhsyito
wfjuyholzcsivt
yfuhovjsitczwl
rvp
kmihlj
ocmqzuwjtan
vbrlcghznqxead
acngzq
shiypqlnckzdva
evypwdushz
imabuen
uqgjekm
d
p
p
vktlzey
jucbqh
cwzepoasyivtufdl
cturlyvoaipwznefhms
brut
mwurt
urt
urt
anpqzltgbw
yajxbermic
gwhtzlvquandbof
tcjafrlghixm
hltgkoxcrsqnia
echylaxrjfgti
etqhafdzg
rmzyaefcqhdo
ehgtdqfzal
eiplbwvqhgdrykmjzf
cnotkxsvzlu
juszboldxphtqywkv
lzspkjmgqhviter
hsqkpzitvlnaj
kx
jxrmousta
cx
qxfw
hxq
vezygtuhqmklcb
cmxrlzjsgphi
wdvigexqfotmnsbc
egwibdomtvcqnsxf
sxtipmcndowbvfeqg
tcdiefsqmgvxbown
ceqwvtifnbmgdsoxz
sgtcvxmiqynfzehr
yvhawlcmtun
bncirlgwyqudh
ybzlqwdangu
fuqjekwynmvtgxsd
wqydnpgbuo
ojkqnxidugfch
rwoqnhmbxjztapfdu
gzlejskuptnb
ekzlpujnbstg
lutzbpjkensg
nktlpugbjzes
omhqnxljiwkpvzudbtreay
yqiknzbxvormgpjualtfwde
jowmpeaqbxltzvdrynuki
atdpobxsvic
wzcvlbuotyxreqspa
aotbscvdxp
vipcabotsx
potaxbvcs
jgzstxmyknhvd
hbnjzgvmxkclsytdi
xljyqrtu
uqlyrxtj
rytlqjux
tyxrjqlu
lmdjczyw
fcdqgipmehturbnwvaoyx
qkaruovhfscxglbmweznyit
znqixgs
zmxqiwsng
zvuh
hzuv
vhuz
jy
jy
yjh
yj
yj
rtcxjbpgs
zpgrcxmajstbn
rhpasbtgcex
oyrfsqucgdwxpitl
dcsyezmrvquixwpogakfjntbhl
anovfcsitzebgxdkpjwqmlyhur
ywaflnbmov
blwoynmav
nmblwayvo
ymawvlnbgo
lyvobwanm
xuceq
qgxvkwm
yqgcviulxpjz
yuqptgcavzix
gyvxicuzpq
lpufgwaebhtckdriqy
locrabdyihufpwgqe
lcdqfeubwrgaihpyk
hoclfpgubwqdraiey
frayspqundziewcgxbmhl
a
a
aw
ceqnfpyhkwaomzdlrigjutsv
qdsjlwiobvyknxzuechpfgta
iyhflgtqakvwedpznjcuos
viwbayqdumknsjzo
dzmuinwqybskjotla
suzjnbkdoqawmiy
iuvdjaxn
vjdixnau
vnjaxdiu
tqg
tqg
qtg
vyncxbksgorfaijzdeqhtplw
dxjyesngbrotzlaqckwfph
tgsqcmzbirkoapy
oayqpgrcstm
asrocipymhgqt
vacyxomgrsqpt
odvreuapq
deqropau
oruqbdeap
uordpeqa
uarodepq
cewlri
il
bil
pfsmjcerdb
cgbmjerdsp
gdbpcemrjs
olnbwczufamjsrtipvkqyhxg
hqbirpwczgoualvmfktsjynx
wvkypxhoaujrlzbnsiqgctmf
xqiawmgh
agbxr
gsxab
juqhvc
vqjuhbc
uhjcvq
hjcuvq
cuvhqj
mkntuosgpawy
mjpgvtaysfrck
l
l
l
l
l
a
ze
w
zp
lp
p
p
g
ysbel
iqhxtnavjw
pczsm
dfkc
ucjs
eszuo
lseugi
xiubmhvoejrfyp
vrepyojmihx
xktarvmjgzfyhpioldecq
elhdmcripxqfvotygjk
mcyfrvgtlhxpjiqekdo
rlvodgxtchfipjykemq
dxcvlrhmpyqkitoeujgf
wslomfkcbvq
qcsowkvbt
ywcxhgjsnkoqpze
amwsucfoqk
oqiskmrwc
zepulif
lijefp
plibfyre
dnb
b
hvu
ujobdmqsna
ulwt
uflpec
zruk
g
g
g
g
g
kmugldxtea
jgkotaelmux
txkomeluag
cujxkyze
crmgxjkzy
bzutydn
nztybdu
ntzbydfu
dzbjyeap
rxgpyjqmbd
odhbpjy
rchkvqu
jurthlkcqs
p
p
p
ps
p
arlofnhbd
rhadnblf
jhnrxldaf
ztukfgr
gufkt
fdktsujgy
kjyhd
dcyj
jyde
dxvgzptbfhniquylok
hlnzpgfuvxktbydq
yugtqxdpbnklhvfz
aser
sra
ejkht
doevsaktyfulpjhxzrb
gwjteiqnkch
eqtwvaxkhjysf
sahmxqevjtc
gyeivjsdrzwubomkpaflt
wmlpbuaojiykvzrfdste
oueiabrdzyfsjmklvtpw
rfteozmijdypwabuvksl
nqiycrwsjgdohmkvuzl
ougqkdscrywnjihvl
owsvkugqldnjcyrxiah
dvhykqlnusowicjgr
kurqvjnbgzxocwhlfeditys
toxuhcldgybfesiqzjnwr
dhkloqwpmicyzva
kmwiaplhty
lmuieakwhfyp
saklihpwyfm
tuxlhze
flni
adjcpbymrsk
umzqhct
zuhmqt
mtgzohuvq
tzuxk
ktxuz
mputbxokz
vxztku
txzuk
ogs
us
oarnvdkyuz
fpeqwtibhjs
qcoyuawvktbldpzermfj
cjyvuzkpqrwbftemodla
tabdoukcrlyvmfpjzwqe
fytknqplmduzxhbrecajosvgiw
qfvyerdktapobmwjzulc
gfyznr
vnpoi
hdnwaqmejb
ctkfn
unik
zvactkmwqijosfngler
fgosnalrvwkjiumtcz
cflqhz
ughqcfl
mwflcqh
hzqlfc
hclfq
vhs
hvs
vhs
fisvlybdg
bciulx
vbkoruxqcgp
qpzrxubckg
rblgszhvua
vsqrbuozhjg
trzushvgb
qkauenxhwmtrob
nefzodwmysqplvbtxhk
bxhemunqkwot
eipjy
pei
mfweitdlp
ipe
mjuy
yumjc
mjyu
hcaivxjntwopfbud
dxcajbzvpinofuthw
xwubvdhtnfpjicoa
ipahvxtnobjdwucf
pdajicbovxhntwuf
uxtbzyqoijcgnkrps
scuojrikthyzbpnq
rdmnztsi
rumthsozjdin
mistcxnfzadry
qzrndtsim
ki
kix
ki
ki
luihqbcygnpvokrjwxa
qxnjklouahviycrbpgw
ryhqvbkjxanpwuolgci
ifmy
mixplfsyo
yifm
fiym
iojlkgqnfpc
ixuqcpfonmlyjk
ikcjoqnplf
kniwopcfaqhjl
pwqfcnioargvjlek
izpbgvruchjtsyxf
tiyxeshupcgjkmdnb
wufhb
hwubf
ahufbwk
uwbfh
hfbwu
wrbsjcniyaeqvdufzxoplg
edjzpltwqihmygxoca
yag
zyawxk
b
v
b
jmxvwdoc
cdmosxjrv
oycvnjxmbdkar
jkdmvcxobs
zmojfdc
ctxmj
vkpaliosgnqejm
pcqoinkeljmvasg
nvbzjlopmgqeasik
lezonbtdpxk
euiohtlpnqrxvb
olpgetfmnykxb
tnlopzabxyeg
tecjf
ewv
ehysltzaoxfwcikgupmbdj
oditawxjkeushbmyczflpg
ikycstwfjdbxpegzauolmh
ayxchoitgufzewskbmljpd
xdshbltjzeupfcymigaownk
tbkhy
wuejmqdz
um
uml
wmu
yum
um
goidsnkyrzpul
gexkdyhilna
kiydnzljg
vzespaw
svqak
vajs
sav
basjv
negfu
negfu
ungezqf
wufnge
wunegf
p
n
n
nxtzpvhjugs
knlztuhgpv
mehgcizytvw
l
l
l
tmwjsoiqfxbae
ivhdxeofspjumabcrtkwz
mbneowitsgfxjqa
hr
hr
jyrlf
ufcqr
frn
rzafy
rkfbpw
cdvnobw
kovwndy
vwnod
vadbonwl
mqbwikvtlnauysporx
jxyzmnabiecvtpuo
guxhvmnyocbpait
graltxsdfnbeuzc
vpqgosmjhb
mvok
movk
wevqpmrblnfdkcja
aprbvjwixcldeyf
ecwjdupovbahzltf
nwdjv
jwvnd
nwdjv
jdwvn
dvjnw
plzqokjdmehc
kzljpqohtecdm
peclzqjwohdmk
pmf
puwmf
jfmp
mpf
fpm
sgrf
sgfr
grsf
grsf
mk
fk
ldyqkn
fknqzvlsd
tlnkydq
yjtwhgckazeslb
imodapxfq
avouixnd
gzjumhcslyfkwnbqx
qrlniepavtbdo
thosbezjxwcumnyrkv
wrynhxmcuevqizspatbok
pjmwys
mysjpw
ysjwmp
wmjysp
ywmjsp
fm
mnup
rmzid
ir
w
dwl
bqsacgumfzpj
givl
u
pwu
wj
m
j
j
j
j
pj
mybwe
uwmeby
weymb
mwbey
zfsbjpg
fzjs
vfzscjk
sfzj
yv
vy
yv
yv
vy
roydftqkjman
hrzmgsqbfuvyx
lanexhgcf
ehmcxagnl
xaglnwceh
guk
j
j
i
yr
wfhx
xhwf
hctwbxf
hxwf
hwxf
uzlheoysartmnwpqi
zrjqlaiosptuyw
ipatowrsyuzlvq
pajsyiultrqocwz
qtyciuzlpsorwa
fqiehbrjgpzla
dtqzbhloanj
lmwbdjqnxzha
wnjqvzuhladybs
fekzbo
hfbzeok
upjz
ua
fcgzitupjlom
mlzfitjpoucg
ljzgfpcmitou
wjavhtfgulxbs
jlbhaugwesftxv
abulpizgs
axyszlo
hfrdkqjv
pxnqsbefvijroumzckwt
cxmtpbjfnesuqowrkvi
sfcpjunwoivekbrmqxt
evupsfnxrbmjciwqtko
xriqnwvgusceydhmjoalt
jdvrcnmpsqayugewhio
chyd
syphcr
yhoc
ych
ych
qye
wqoe
qzue
qkevy
qe
gehqsfybktionvlazuxjpd
ginvqthklyspxbfoajud
hpblkjfyguov
ywvhlpgbnc
xoeynm
dtojpzgwbyfne
hnqyoe
eymno
ovqyen
xnrlksc
nxlc
nvwjmxc
xuoyb
yoblx
gzdx
xzvd
dxtz
duzxj
mxpzaovctejy
xlitevzyk
txvgfezyrkh
zh
ghxk
dlaopuj
f
z
kptczhbqrn
cqhztbpnr
fqbtrucpzhn
brthnqpzc
u
eqrwi
cwoarjgxesbfpz
erxbtojas
dajsroexb
pgedrabjsox
mjkviqy
mkqjyi
qmykij
qmjhiky
mjkviyq
hqo
qhjr
xhjqtrw
lfaxc
lxzfc
czxfl
clxft
fcxl
umoecsdkqji
cskqpoudm
qubm
muq
dmiual
xvbgm
mvxq
mvlx
vmx
p
pvg
p
uvckgbzxdytoams
weqcnkfjmihprx
wgyiqkxfpzlatbousrvn
zfqlgwktyivruoxabnsp
fbtragkovyiwsxnlqzup
xonjzkrghmdyiu
xduizjmgronhyk
mhdgryiuzknjxo
dkrxougihnzmjy
anyjhkobzplrqfg
gfpknwqdhsxacjmoblz
pkflqubgzanjho
hyzgunfviqobpjakl
nzs
ipu
egfac
us
s
ixskmrynfbctozadew
lsvnjyumfhzkpbg
goqdapfivwkmexb
swiqafmdoxgbekvp
pmkbaiqcewfvxdgo
fvoepywahjqkdzgibmx
wigfkqvsebpoxadm
ornhgxjqkytvub
zmekbicruqgd
cwnd
dwnc
dcown
aerds
asr
vraps
arfgson
xscrau
owpihungbxfvql
pvontulxsbiwqjrgczkf
vdmhxbgunplewiqyfo
xq
ix
x
xi
exl
jckv
cknvwj
ckqvjd
qcjrvk
qcvjrk
oelmztvsjfkdaquwgb
swgqozmadfklbihxetuvj
wmlhcndgfj
dvgojfhlnscm
xbgkertlzmyhfncdp
lfgwmdhcn
ylxpvqawm
vxqwlpyma
waxmlypvq
vxqpyalwm
ylrpqkzda
lzfdkpqray
zagdyqprls
rztwihlaypbednoq
xtdvrwmqfylacokz
odrcyqkzmflwxvat
qomxsptajeyczkdlvrfh
wms
msw
smw
jviyckehx
jykczevi
ceybtkjiv
ejhvkiyc
vceykji
a
ap
ohgqctumnfy
qyofntmhjcxg
lkzmqdpcgtyof
toqjgacfmy
lfyzxtmdvehroupbsq
krmdvzqetfjiguobhxsc
koudbxpeaygwnsfqzl
jxqnowpuvkfayse
raysekchowuxntpqf
ekaycpfowstqunxv
zueald
mkcgpniq
ueoyfhtbawl
ynfdh
jdynh
xbdvm
ad
vaigbf
aibgvf
iaybvgf
rglhpjedmnkczwsaxvuyiftq
sgvncpmqrlzdykjoiewxtuhfa
thoirlzbakne
zfsj
ydzsw
z
wxzm
yxnumzostgjea
dfcykpltobeg
hltvqgopwrbakjmxy
otanfpdscqkmwg
fkwpgaztoumqn
zeflkcnvpojytshxgia
xycazlfokejnhspgmvtq
anytosfkzehvgpcjlx
evbcxadzysgophrfnulktj
kvdfiewxtyq
zjynrgp
aoyz
aoyhsm
uyobalc
rfk
fur
fnrx
mfr
srfjab
jrmoskacxpvibhftgnlywuz
tpyvrloamuchkiwfxbgnjz
jdtmvinzkoflgquha
ewkisqucopyx
bthnz
rkujdylnxw
wlciqdhptv
tqsugawvoc
vcwqt
twyqvc
wcuvqts
rxzgyqui
gzruiqyx
yrzqiugx
xgouzylqmir
uyiqxgrz
xmbngtwkzfv
djzsf
qvhtkcrswxnzimjdabl
cskjmxtqbiofnhl
jhyqxlukicmstbn
bgihlkmjsncxqt
dftriecaujqygkp
dpitkrqgaefcjuy
ctheqrfyigpjukda
pxcsqf
hxyfsqc
fcsvxq
xgfqsvc
fwrz
vkpeischdg
zojmnw
yuj
biydmusjhap
pxdvufaimohgrb
eyncz
meyzc
gecphy
nqjp
bxcgur
qxewsoa
qvwxgclo
iqpowtxmn
qwhbyirsmvkfjzpueact
camfypikohjurvqtswbe
hisewcbvjoqrmtkfpyua
zmnvldi
znlmdvi
mvliznd
mldvizn
nivdlmz
klejadniyugvs
raeuygvinldksj
dyjnsakeguivlh
ulsnyhgjiakedv
kalgednsuihvyj
qtgfmuipbkrsxn
wfucprkgxlmq
macgfhpurwqkex
h
rn
ybj
yjb
biyjs
yjb
gqsukyfdrzopbatmjvln
hrpltybxqugzkdvcesimfjawn
ewfsbyzoxd
ozxdbyefsw
zdbwyxsfoe
xeofzswydb
mt
f
jb
wqhg
jbnqmogsreyku
eonrkbsyugjqm
yqokjreuvbnpgms
ubgqomjeysrkn
iqbxvszjmgnalfpu
pixmsbnavzujflqg
kqismpjzaxvbgcunfl
xosqhlgpm
sqohbmwgy
qchjsikuo
lcojtkr
crkotj
iaufs
fvoau
pfgzydt
ztypgfd
fp
f
f
f
kspetr
pjrosvkx
wvcexodslhftbnakimgzjy
mztdslovfixkhjyneabcwg
gkiwcedhxtnomyfjlbzsva
qphgrcf
mhdz
ih
q
q
q
q
ztoneqhcgjrwdvf
tienuyqajhmwbog
bploycnt
lbnoyv
ylnoeb
drwzouehkbjlfyingqcas
wzvjcqgrmasyopbhtn
azn
na
na
na
bz
bz
bz
tzb
zb
vusoma
smaouv
sglxdivzmbohnacjup
pudzbmivaxnhclsjk
vkph
suw
gyrhscio
hiyrcsgo
trhysciog
yicshrog
zdkynwxqigusb
lkopzrbdwfncx
wnmhzxdtvbjka
sibezwyxdnk
pc
c
ocyebmjsnxrit
yijstbmgeoxr
moxbritsydej
jmosbexyirt
bysfraicxq
baxqfsywirc
raxcbiqsfy
bsyqcixrfa
iwdgnztphbkocqvsyel
zeosypvkwbdhnilcgqt
bzhkwnclpyvoqisgtde
pfgovzctdwqelhbnyksi
tywvlghspczidnboqke
rxwadjshp
fwcztneu
dgkbnmrlhcaivzojuyq
muicgxvkpwfzqjnrhlosyb
p
p
p
p
p
a
y
y
y
y
adw
a
a
wsvugr
chzpwxy
qipynwbj
ejwbanfxo
kdhenitqpzxjams
skxyimzhpqtnd
lytjmoaqixnkszphd
pzhdnbxtmqeski
fwpdhknrcxsztiqmv
jnkitbvq
vnkbjietq
iqjkntb
ktdznbqji
jqnibtk
qyxkdjzhi
khqjtbeyridz
smwnoyl
nqobwylsm
lmawoyns
ju
ilu
qhwnr
l
gftdncbp
btndfgcp
bpfngdct
npefbgdtc
mtqruap
uprmqat
yum
uym
uym
umy
ymu
aymdqeu
wesmqkdfuj
qvduamey
juoxaevysk
yoajxs
joaysznx
nrhdifpxvk
nvwzxrpi
panivqxrle
xcbqhjsafrn
zpgimltewvu
kzyidto
qpymaniv
knipyw
uhsgya
qsegy
wfbzsjckg
ilmqn
lmiq
qlmi
ilqm
b
cb
b
b
b
qiu
laru
l
j
j
l
x
kpujxtyerivfgomsdhnlwzc
ewacvmrdjtlnykhxuszifbo
hcotvyqlzkm
ytmfozklhqbn
wxkgcidnpybfutvmhz
pkuhzmxgnfycdtwobi
uwgnvmpfyzkcxthbid
qeplrhsifuv
uhflevspqri
lihufeqvprsa
ehfqiuprlvs
phivqlsufre
vitspgyendmzbuo
dvnsmguitpboyzea
tmaubsexvgolpydnzi
bmieuzvpdotrgsyn
hwxjumrlocdt
hurtjwdxplmoc
rojlutxwkdyhcm
locwmjxrhdut
dcrxjmohtwul
zrnh
fmnxgwbq
ivunasyd
dkhjn
uhya
yhuw
iuexp
gm
zkhyg
o
pglyfuieczhtw
hyicguvpemtlfd
tlrhepcfzyuwig
eqgkufbpc
kbuqci
qbukc
vpfkqoiemg
mkeoqipg
zogwipmkeq
iopkmgwqteu
nzorbiu
zuqbri
zgueirbj
lsujqrcktmnwxi
oqnfkzsctlbjv
elhxw
xwehl
wlxfh
zxwchl
qkzwgpmlv
mvqphjli
mpqrhliv
spvlmq
vjuarpbtxenhks
pdeixalsqunbhvj
asbuhvpjnxe
vbphxujensroac
ocsnjwthqidua
qozmhuandtcjiws
hzsdjuqnwtixacor
jqwxhsodcriazntu
uadcwhqtlnjbosi
exjimgzntqwvf
efdzgviwtn
znoefrvcwibp
tifykegzwvnj
ojfmzaxnctuhgi
oichzukfjmgtnx
ofxucjlnghmdite
y
dtj
fxy
nm
buehacmtso
stmobucae
ubmtavesco
btuypecahsmo
ubsamotec
bd
d
d
d
xwda
v
va
v
drebgljwqhypumaifx
juradeolqfbwmihnxp
zshwtgqvxk
hsqxgkjtw
gkhtqwxisra
ktbjgxwqsh
gklyvoszr
zgqrysov
vogzsry
lroyzvgpsk
jrzydovgnisac
ltdkaw
fpyqjsbwechir
wvmz
wtok
cbwqltxjfpigahuond
ckvjxsqe
mclzokrbiut
ktmoczbulr
zsavj
jasvz
zsajuv
azjvs
hnamj
hre
cjvqwkn
siytlfzguo
wm
ba
ba
dsohcqbz
hdqcsbz
budzh
dnwhf
s
vpt
v
v
v
v
v
zvfbpucdkmjqeio
adtpyxrmgskhwbf
zwdpfscunaqmligo
qawystolvmjhxgbr
flindhuycw
ycjkpshfwitndm
wm
wmg
wm
msw
mw
sgmzqpwlifcryjabxend
namrfposzgbqywcixelj
fxrblzajswpctihqygenm
zrmxisnfajygkwlcqebp
dgu
dug
imuqgd
dug
gtwxdb
tgxbwd
dxwtbg
jolnaczkdfbsmu
rlatnfdicmuhe
jzoqvxg
vzogjxq
jqzgxvo
qgvijozx
vgqoxzj
vruspmhlewokn
nojmeblhuprks
tfrh
ihr
r
rehmt
xpkuysr
lrgveotsf
ovfsret
vtesorfk
v
v
ov
vn
yxfzesqgr
yxqfsgr
ritshypvfq
k
k
k
xk
tfuivc
icufl
ubfic
iypucf
foknbeaujiphd
xgnpdkhaeoujf
hnwaeofpmyvjkudl
ynfoewkix
kywxndsf
wnyfqxcki
pzxvyabwurlkfn
hsxnkmyfgw
ycxspo
yxbpzsco
pcyxso
ri
ir
ir
ri
ri
ngeojlwvkcymsdu
dunjgkomvlwy
vkwdomlyjung
iswlyvtgndqkbcopjxmferuazh
ludyrjxgqswhkmofpneictzabv
h
h
h
n
h
nwmulejyqx
ydulhfmnxac
mgyxlcpnudo
iuxyrlnmtz
xnmidtysul
ipfdrqs
iprxdavg
cyinpkdwrmhjue
xipadbrzolg
ftropxid
vexqt
xqetv
emtqxbvk
hzkifwmxeonu
pcaygtldsqvb
dyv
veyd
vyd
vdy
txhdkerybmua
afhyuxdkbertm
cyuxrewtbmdkjh
fpvxgdki
pxfgdvki
kfvgixpd
dgvifxpk
vtybfxskgrdpin
sjtbzwmuxcnlp
jsxnbwzhcmptlu
wzusacxbjnmplt
qiwkszmjptxcnulb
t
d
t
osiz
dfr
vjnihrbmfkl
bmylxvnkir
snirvcbkml
onatgjeqdfu
tofjugqnaed
njfadqwugoet
ojaefunqtdg
jdngfteuqao
lfjsnmywoari
imjnyarlwof
aiolyfjwrmn
lstramdyop
sdrtlepnoyam
yplsdtroam
rysuomdpalt
dumlsyaotpr
gfxlnvejorkw
ruoljnfxke
sjyuobmlgzkit
lmkgyrtojduz
znpglmatuqekyjo
gulvozkmytj
zsytjlogumk
ktehudzxrmaj
vqjhmydruxk
ghnmxcjkld
pnhizmdws
ptceojmgb
hvfrokunzditcmexlwjgasq
ahtsizfglkdecqnymuwjx
cgmrlkpzu
nuwgm
amug
ghmu
ykih
ikyh
kiyh
iyhk
kyhi
mvcjruf
mfcjurv
frmvucj
rucvmfj
ujrfvcm
rzvug
ruzg
pgdqucvliaekwy
vyilsqcukagew
cylwivaugeskq
wiquaecyklgv
quocakwyegvzlri
j
j
j
yafuivm
fmzyivua
mvayjqfbieu
vymuafi
sbw
bws
s
sj
c
nlpkz
jhiyszxcpumkdregl
yceuljzxdbspmgnhtir
lvstgahuqycwempik
htcpdimwlev
eilhvtwpcm
ocsrqubwnlhemxpyfjkgd
mslzhunejpfdwryq
fkslizewn
lesifzknw
eknizfws
keznsroifpw
wztapg
zcaugetw
wazcugt
enkw
zyekmcj
rqsdx
xqrdbsf
xtdusyr
jdsxabrv
ildhoswzeb
oedzhlfb
zohldbme
ehldbofz
glzpahcrsxoiq
dqaxhzces
gzanixv
bzaumfxk
oznxat
t
t
t
dponyflcbgzu
oluycbzedngf
xrcilmyqzhf
ndfxpekhtlba
fowjxlqh
abuvz
uzab
uazgpmbd
abuz
zybua
xkigl
gkxli
lgixk
kilxg
ksyt
hv
gaiwkqjmf
bhivlayzgf
tpxnhbkrcziymuqjwsagfvol
gfxywqtikanvorulmshczjbp
dtplfzajrcug
dutapblcjfgrzi
uztnapflcjdvrg
frdguctzljpai
zfuersgq
grfuesqvk
sergaukqfy
qfsiutrwcgnejob
vb
vb
vb
muxydwqtzv
jnvxmfyetdsu
xvdmytiukgr
xh
jha
bnurvpy
vakpuwesyqnr
ksypwevi
kpvsyhwj
nehqwmxt
zswvrla
wbocdzfgs
toxqdwzhvrpbfl
egcnsmiky
rtzujanlky
kdsatijn
yxms
xsmy
osmyb
sym
rbt
tvbaru
bwrst
ritb
vziqwsjmehdyocntuxbl
glqjxndpmcyakheuvrw
bvldiakteryfznq
qebljwgvdoacszk
lzxvqeapbdkyn
lykqpt
mqkdlp
jixerawshokm
jiwramksehxo
ekxmirwaojhs
iearwhokmjxs
m
r
r
b
r
rvblioszxngkad
wbogjpsivkxfn
jpcwsnuxkriblehvfyd
jnyxehusfvqablrcowidkp
amws
ads
as
ahjfgpq
ambsfvh
sxihbfruacp
tajchyf
ahodnflkew
njayect
ywfreujv
cnfayqmdpie
tcqixpvzdaonrym
qnlofvpikj
wue
njylcxwbksdrqa
fwaqodzxg
xudoeqmhaw
xhiadwfq
hqu
qihu
huq
uqhcr
xhquw
dimvrngsoeazpkfwyctj
groanpvszyemkfwjtcid
jvwonsraytdgemifzcpk
tdsecwafikzongmvryjp
zelpgjotxyqscnidwvfuamrk
khopamsbet
mtoqjbwexfpk
eopdumbkty
pmkoetb
ogptnbkmed
segnxfbtzoq
noxbkzfsgt
dhfozyqasempnlciwbkrt
owezgcvudlnhmsqkxp
pswqnomzldgecxkh
ptogxfrdwz
glkzfxrow
awryscxofzvm
wohrtifbzuxnj
czemryisbjdptxq
tpcbisqyezjrmd
ybjpctrmzdsqie
zsqcmypibrjedt
ztwcbpsyijqrdme
atwukjeorighvfsn
fjohkugxzvnqwmtsabe
vuwenfoagktshj
lwdhiauepytcsgokfjnv
cylvzghwmjf
lwfvzgjyhcm
fzgyjlmcvwh
vwjygmzhclf
ab
mb
bh
fjgwbhceioxmsz
zejxhbmtocgfdw
eblapcygxwvzhofmj
gmxfhjzcewbo
fhpqtjzdeyluwnogm
duemozjhlpqnwfygt
zfmewnhqdpgjoytul
eofygnuphwjmlqztd
wva
oevfabqwd
kvawg
gxprowhvytbiamfcjesu
excvhbsujfatrpmwgi
xylsrgiecwzpaoj
vbscjyqre
pjcltyis
psiclt
cstiklp
hisapclt
lq
v
v
vq
p
m
m
m
m
m
fzhuvrqsonwdcmgibj
dqibvhgfrmnjcuwsz
gkfvsznchrybwilejqdu
rdibnqwfzghucjvs
juqckrl
ojlhsyfcn
jngdhxfesqzwcptlmvb
tlpyhvnoxsagwmqrdzcue
FFBBBBBLLR
BFBFBBBRLL
FBFFFFBLRL
BFFBFBBRLR
FFBBFFFRRL
FBFBFFBLLR
BFFBFBFLLR
BFFBBBBRRL
FBBBFBFLRL
BFFBFBBRLL
FFBBFBBRRR
BBFBBBBLRL
FFBFBBFLRL
BBFFFBBLLR
FFBBBFFRLL
FBFBFFBLRL
BFFFBFBLRL
FFBFBFFRRL
BBBFFFBRRR
BBFFBBFLLL
BFBBBFBLRR
FBFBFFBRRL
FFFBBFBLLR
FBBFBFFRLR
FBFFFFBRRL
BBFFFFFLLR
BFBFFBBLLR
FFBFBBBRRR
FFBBBBBRLR
BBFFBFFRLR
BBFBBBBRRL
FFBFFFFLLL
BBBFFBFRRL
FFBFFFFLRR
FBBBBBFLLR
BFBFBBBLRL
BFB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FBFBFFFLLL
FFBBFBBRLL
BBFBBBBLRR
FBBFFBBRRL
BFBBBFBLLR
FFFBBFFLLR
FBBBBBFRRL
BFBBFFFLLL
BBFBBBBLLL
BFBFBBBRLR
BFFBBBFLLL
BFBBFBFRRL
BBFBFFFRRL
FFBBBFBLLR
FBFBBFBLRL
BBBFFFBRRL
BBFBFFBLLL
BBFBFFFLRR
FFBFBFBLLR
BFBFFFFLRL
BFBBBBBRRL
BBFFFBBRRR
BBFFBBFLLR
FBFFBBBLLL
BFFFFFFLRL
FBFBFBBRLR
FBBBFFFLRR
BBBFFFFRLR
FFBBFFBRLR
BBFBFFFRLL
BBFBFBFLLR
BFFFFBFLLR
FBFBFFFRRL
BFFFFBBLLL
FFFBBFFLLL
BFFFFBFRRR
FBBBFBFRLR
FBBBFBBLLL
BFFFFBBLRL
FBFFBFBRRL
BBFBBBBLLR
BFBBBFBLRL
FBFBBFFLRL
BFBFBBBLLR
FFBBFBFLLR
FFBFFFBRLL
BFFBFFBLRR
BFFBFFFLLL
BFFBBFFLLR
BBFFBBBRLR
BFFBBFBLLL
FBFBBFBRRL
FBFFFBBRLR
BFFBBBFRRR
FFBFFBBLRL
FBFBBFBRRR
BBFFBBBRRL
FBFBBBFRRL
BBFBBFBRRR
BBBFFFFLLL
BFBFBBFLRR
FBFFBBBRRR
BFBBFBFRLR
BBFBBFFLRL
BBFFBBBRLL
def is_valid(pp):
try:
if len(pp["byr"]) != 4:
return False
if int(pp["byr"]) > 2002 or int(pp["byr"]) < 1920:
return False
if len(pp["iyr"]) != 4:
return False
if int(pp["iyr"]) > 2020 or int(pp["iyr"]) < 2010:
return False
if len(pp["eyr"]) != 4:
return False
if int(pp["eyr"]) > 2030 or int(pp["eyr"]) < 2020:
return False
if pp["hgt"][-2:] not in ("in", "cm"):
return False
if pp["hgt"][-2:] == "cm" and not (150 <= int(pp["hgt"][:-2]) <= 193):
return False
if pp["hgt"][-2:] == "in" and not (59 <= int(pp["hgt"][:-2]) <= 76):
return False
if (
pp["hcl"][0] != "#"
or len(pp["hcl"]) != 7
or not set(pp["hcl"][1:]).issubset(set("0123456789abcdef"))
):
return False
if pp["ecl"] not in ("amb", "blu", "brn", "gry", "grn", "hzl", "oth"):
return False
if len(pp["pid"]) != 9 or int(pp["pid"]) != int(pp["pid"]):
return False
except (KeyError, ValueError) as _:
return False
return True
hgt:176cm
iyr:2013
hcl:#fffffd ecl:amb
byr:2000
eyr:2034
cid:89 pid:934693255
hcl:#b5c3db ecl:grn hgt:155cm pid:#baec97 iyr:2017
byr:1939
eyr:2020
pid:526669252 eyr:1972
hgt:152cm ecl:dne byr:1960 hcl:z iyr:2023
eyr:2028 hcl:#c0946f hgt:73in byr:1926 ecl:#473aaf iyr:2016 pid:565318180
pid:472686027 ecl:oth iyr:2019
cid:277 byr:1940
eyr:2030 hgt:170cm
hcl:#62e117
ecl:oth
iyr:2017
pid:938461813 hcl:#733820 byr:1959 hgt:159cm eyr:2022
iyr:2011 eyr:2021 hcl:z
ecl:hzl byr:2002 pid:17324328 cid:140
hgt:186cm
byr:2022 pid:3164234967 iyr:1984
hgt:76cm hcl:6b3837
ecl:#fa362b
eyr:2037
hcl:z eyr:1945
pid:9247286687 hgt:75cm
iyr:1934 cid:326 ecl:zzz
byr:2005
byr:2005
ecl:lzr
eyr:2021 pid:152cm
cid:254 iyr:2020 hcl:z hgt:157cm
iyr:2020 eyr:2020 hcl:#18171d ecl:gry pid:914128753 hgt:168cm
byr:2002
hcl:#7d3b0c hgt:160cm eyr:2020 iyr:2015
pid:054067854 ecl:brn byr:2023
hcl:#cfa07d hgt:157cm
byr:1994 eyr:2027 pid:344443856
iyr:2016
pid:762423097
iyr:2014 hcl:#a97842 ecl:brn hgt:180cm byr:1927 eyr:2021
pid:6645616064 hcl:#ceb3a1 byr:2030
eyr:2032 hgt:158cm iyr:2012
ecl:#e9619e
eyr:2022
ecl:brn
byr:1986
hgt:161cm cid:99 pid:288726584 hcl:#6b5442 iyr:2019
cid:75
pid:117771843
hgt:184cm byr:1937 ecl:brn
hcl:#d88fd9
iyr:2015 eyr:2027
iyr:2016 hcl:#fffffd hgt:170cm eyr:2022 ecl:oth pid:629454113
byr:1952
hcl:#c0946f iyr:2018 hgt:189cm
byr:1971 ecl:oth eyr:2029
pid:800207810
eyr:2022 hcl:#7d3b0c pid:969986413
byr:1978 iyr:2020 hgt:186cm
ecl:gry
hgt:171cm byr:1949 hcl:#341e13
ecl:amb eyr:2030 pid:359107274 iyr:2013
pid:839751525 eyr:2024 byr:1921
iyr:2012 ecl:amb hcl:#b0ed6f hgt:154cm
pid:32592758
byr:2009
hgt:107 iyr:2019 hcl:#866857
eyr:2036 ecl:amb
eyr:2040 hcl:#733820 cid:199
byr:2027
pid:7791792988 ecl:blu iyr:2026
hgt:63cm
iyr:2011 cid:119 pid:344693475
ecl:grn hgt:160cm eyr:2029 hcl:#346973 byr:1996
hgt:161in byr:2025 cid:167 iyr:2024 eyr:2040 pid:034804648
hcl:#efcc98 ecl:oth
ecl:#ba14f0 iyr:1935
hgt:60cm
byr:2003 eyr:1987
hcl:8e509b pid:161cm
iyr:2018 pid:620508652 ecl:amb eyr:2023 hgt:183cm hcl:#a97842
byr:1967 cid:117
eyr:2022 ecl:amb
pid:476049089 iyr:2012
hgt:165cm
byr:1955 hcl:#602927
byr:2014 hcl:z iyr:2029 cid:279 pid:28914607 hgt:75cm ecl:xry
hgt:156cm eyr:2023 iyr:2011 ecl:oth hcl:#7d3b0c pid:561313217 byr:1952
iyr:2011 byr:1935
hcl:#cfa07d ecl:oth pid:830614209
eyr:2028 hgt:173cm
iyr:2012 cid:210 eyr:2022
pid:652810130 hcl:#18171d ecl:grn byr:1960 hgt:152cm
eyr:2026 pid:815848563 hgt:75in iyr:2019 ecl:gry byr:1947
hcl:#cfa07d
cid:181 iyr:2012
eyr:2024 byr:1934 hcl:#c0946f
hgt:165cm ecl:oth pid:232944581
cid:135 iyr:2020
byr:1971 hcl:#733820 pid:531877857 hgt:179cm eyr:2027 ecl:amb
byr:1987 hcl:936807 eyr:2032 ecl:#4bec4a pid:605628619 cid:180 hgt:150in
iyr:2015
hcl:b62ef0 ecl:#092141
pid:876635399 byr:1944 hgt:158cm iyr:2017 eyr:1924
iyr:2016 pid:7039815301 byr:2014 hgt:150 eyr:2032 ecl:blu hcl:z
byr:1979 eyr:2030 iyr:1978 hgt:63 pid:1554613758 hcl:z ecl:amb
hgt:70cm hcl:e45897 iyr:2020 eyr:1977 ecl:dne pid:2878189427 byr:1973
iyr:2003
hcl:#cfa07d
pid:260517078
byr:2030 hgt:175cm eyr:2020
ecl:brn
pid:460604681 eyr:2022
cid:138 iyr:2016 hgt:163cm
byr:1922
hcl:#ceb3a1 ecl:oth
hgt:167cm byr:2009 eyr:1975 cid:295 pid:174cm iyr:2029
hcl:z
hgt:67in ecl:grn
eyr:2023
cid:122 pid:281246917 byr:1990 iyr:2011 hcl:#866857
ecl:#ed7ddc byr:1922 cid:234 hcl:e61b1e iyr:1932 eyr:1996 pid:31344005 hgt:62cm
byr:1949
cid:275 iyr:2017 ecl:grn
hgt:164cm eyr:2027 hcl:#18171d
pid:751342937
ecl:blu hgt:162cm
pid:432600613 byr:1923 eyr:2029 iyr:2011 hcl:#623a2f cid:315
iyr:2020
hcl:#b2bb11 pid:055891584 ecl:grn
hgt:67in
eyr:2029 byr:1937
iyr:2012
hcl:#a97842 pid:325640714 ecl:blu hgt:185cm eyr:2024 byr:1971
hcl:#b6652a pid:485327267
ecl:brn hgt:155cm eyr:2028
iyr:2019
pid:902164867 hgt:77 cid:283 eyr:2027
iyr:2020 ecl:hzl byr:1935 hcl:#efcc98
ecl:grn
hcl:#ceb3a1 byr:1977 hgt:165cm
pid:850700221 eyr:2030
iyr:2012
byr:1989 ecl:brn eyr:2026 pid:919138357 iyr:2016
hcl:#623a2f cid:319 hgt:161cm
iyr:2017
byr:1973 pid:293382118 hcl:#341e13 cid:143 ecl:hzl
hgt:166cm eyr:2022
pid:517102798
hcl:f9d9dd
eyr:1933 iyr:2019 hgt:164cm
byr:2017 ecl:utc
eyr:2023 pid:757868802 hcl:#18171d cid:244
hgt:156cm
ecl:blu iyr:2015 byr:1926
eyr:2022
iyr:2020
hgt:158cm ecl:grn
byr:1988
pid:979194751 hcl:#888785
eyr:2039
pid:3867868142 byr:1936 ecl:dne iyr:2022 hcl:4b43b8
hgt:115 cid:241
iyr:2015 eyr:2026
hcl:#ceb3a1 pid:539099924
cid:234
ecl:brn
byr:1920 hgt:163cm
cid:259 iyr:2020
pid:949453818 eyr:2022 hgt:181cm
byr:1997 ecl:blu hcl:#18171d
byr:2016
iyr:2012
ecl:utc
hgt:68in eyr:1993
pid:1542134802 hcl:486699
cid:239
iyr:2018
hgt:154cm ecl:brn byr:1970
eyr:2021 pid:581775861 hcl:#888785
iyr:2012
eyr:2027 hgt:67cm hcl:#efcc98 ecl:zzz pid:312104916 byr:2020
hcl:#b6652a ecl:hzl eyr:2023 iyr:2012 pid:513268492
hgt:159cm
hgt:162in hcl:z
byr:2029
eyr:2023 ecl:#e2e7ab iyr:2016 pid:65979982
cid:84 hgt:71in ecl:blu pid:982719716
eyr:2020 iyr:2014
eyr:2028 hgt:181cm
ecl:hzl pid:255796693 hcl:#341e13 byr:1994 iyr:2011 cid:218
ecl:blu
byr:2029 iyr:2017 pid:468504566 eyr:2020 hcl:z hgt:163cm
hgt:158cm
eyr:2025 ecl:hzl cid:295 pid:601339484
hcl:#7d3b0c byr:1991 iyr:2013
eyr:2028
iyr:2018 pid:2236240873
hgt:172cm
ecl:#0e337e hcl:#b6652a cid:108 byr:1930
ecl:gry hcl:#888785
eyr:2020 pid:442479017 iyr:2016
iyr:2014 ecl:grn
cid:313 eyr:2023
hgt:183cm
byr:1976
pid:499580308 hcl:#53efe6
eyr:2034
cid:235 hcl:8f3cf5
byr:2027
hgt:161in pid:3259965094 ecl:xry iyr:2026
eyr:1978 byr:1925 iyr:2018 hgt:170cm ecl:#0c94e8
pid:562699017 hcl:#816949
eyr:2023 hcl:#866857 hgt:179cm
pid:785862442 iyr:2014 cid:165 ecl:amb byr:1939
hgt:187cm
pid:64469711 ecl:gry eyr:2023 cid:225 hcl:#341e13 iyr:2011 byr:1958
hgt:162cm byr:2028 ecl:#37e345
eyr:2037 hcl:19fb3d
iyr:2021
pid:#87921a
eyr:2027 hcl:#18171d
byr:2002 ecl:gry iyr:2014
pid:561506850 hgt:177cm
hgt:64cm pid:#a92686
eyr:2029 cid:122
byr:2026
iyr:2017 hcl:z ecl:grn
eyr:2028 byr:2007 hgt:155cm ecl:#86fa1b hcl:#733820 pid:562889497
iyr:2019
pid:880698787
byr:1992
hcl:#7d3b0c hgt:163cm ecl:hzl
iyr:2011 eyr:2021
eyr:2020 byr:1994 iyr:2011 hgt:186cm pid:841855425 hcl:#cfa07d ecl:gry
byr:1923 iyr:2015 ecl:amb pid:414655744
hcl:#b6652a
hgt:159cm
eyr:2026
hgt:171cm ecl:amb pid:363065723 iyr:2020
cid:66 hcl:#b6652a eyr:2021
byr:1960
eyr:2002
hcl:2627b2 ecl:#1bf21d pid:168cm byr:2024 iyr:2020
hgt:186in
iyr:2011 byr:1924 eyr:2024
hcl:#b6652a ecl:brn
pid:794477411 hgt:162in
hcl:z hgt:67cm
byr:2025
pid:582569979
iyr:2013
ecl:oth eyr:2025
cid:50 hcl:931e2c
hgt:172in eyr:1994 iyr:2023
ecl:#cd2204
byr:2015
pid:157cm
hgt:173cm eyr:2028
ecl:amb pid:569607283
byr:1942
iyr:2019
cid:228
hcl:#866857
cid:109
ecl:oth eyr:1933 byr:1982 pid:173cm hcl:#b6652a hgt:174cm
iyr:2023
cid:69 hcl:#9ad05b pid:341135641
byr:1968 ecl:brn
iyr:2012 hgt:156cm
eyr:2020
hgt:176cm
byr:1954 ecl:blu
eyr:2020
pid:478462637 iyr:2019
hcl:#888785
iyr:2026 hgt:193in
byr:2018 pid:162cm hcl:605e7f eyr:1948 ecl:utc
byr:1962
eyr:2022 pid:445346117 iyr:2019 hgt:158cm hcl:#623a2f ecl:hzl
cid:278 hgt:187cm eyr:2024 iyr:2016 byr:1964
ecl:grn pid:450739552 hcl:#733820
ecl:grn byr:2000 eyr:2023
pid:344489911 hcl:#7d3b0c iyr:2011 hgt:177cm
iyr:2015 hgt:180cm cid:190 hcl:#a97842 pid:359774842 eyr:2029 byr:2002 ecl:amb
eyr:2027 iyr:2015 ecl:hzl
pid:082733109
byr:1975 hgt:191cm cid:251 hcl:#888785
hcl:#c0946f iyr:2015
hgt:167cm byr:1990 ecl:amb pid:168cm eyr:2023
ecl:gry eyr:2028
byr:1934 iyr:2013 hcl:#6b5442
pid:424412120 hgt:173cm
pid:273352568
eyr:2024
iyr:2013 byr:1926 hcl:#602927
ecl:brn hgt:180cm
hcl:#7d3b0c hgt:70in ecl:amb iyr:2019
byr:1937
eyr:2030 pid:309011548
ecl:grn
hgt:64in pid:796889811 hcl:#18171d
byr:1929 eyr:2027
ecl:amb hcl:#888785
pid:412449028 cid:316 byr:1982
iyr:2019 eyr:2030 hgt:193cm
eyr:1927
hcl:z hgt:158cm byr:1930
ecl:lzr iyr:2018
cid:197
pid:0906120002
ecl:grn byr:1970 hgt:181cm
pid:376212702 eyr:2030 iyr:2017 cid:266 hcl:#f8b0f5
iyr:2018 hgt:73in pid:652356158 hcl:#c0946f
ecl:grn byr:1973
cid:170 hcl:#b6652a byr:2011
ecl:gry iyr:2025 pid:#b6e567 hgt:67cm eyr:2016
hgt:192cm ecl:amb eyr:2026 pid:201824712 hcl:#888785 byr:1966 iyr:2019
iyr:2013 byr:1995 eyr:2028 hcl:#b6652a ecl:brn cid:53 pid:705606447 hgt:176cm
hcl:#341e13 byr:1951
hgt:161cm pid:231973770 iyr:2015 ecl:hzl
eyr:2030
cid:210 ecl:brn iyr:2017 eyr:2030
hgt:176cm hcl:#efcc98
byr:1965
eyr:2020 hcl:#7d3b0c
pid:872088079 ecl:oth iyr:2017 byr:1920
hgt:180cm
hcl:#0b540c iyr:2019
byr:1938
hgt:153cm ecl:gry pid:236785988
eyr:2020
eyr:2020 hgt:184cm iyr:2019
pid:673186642 ecl:oth byr:1977 hcl:#866857
eyr:2025
ecl:gry hcl:#341e13 byr:1970 iyr:2010 pid:972122542 hgt:184cm
ecl:grn byr:1992 hgt:71in
iyr:2014 cid:254 hcl:#fffffd pid:749733013
eyr:2026
cid:98 ecl:amb eyr:2022
hgt:169cm pid:022677680
byr:1937 iyr:2014 hcl:#e62c71
hgt:192cm
iyr:2015
eyr:2028 ecl:oth pid:6000619833 hcl:#c0946f
byr:1930
byr:1938 hcl:#efcc98 hgt:178cm iyr:1953 eyr:2038
ecl:brn pid:#cdc55a
hgt:66in byr:1951 iyr:2016 hcl:#18171d
eyr:2027
ecl:lzr pid:834188980
iyr:2012 eyr:2025
hcl:#7d3b0c pid:330325803 cid:166 hgt:186cm byr:1938
ecl:amb
iyr:2015 hcl:#602927 cid:268 eyr:2021
ecl:amb hgt:186cm pid:318676962
hcl:#3d6f3c iyr:2014 pid:665730784 cid:191 hgt:150cm byr:1981 ecl:oth eyr:2024
ecl:grn hcl:#733820
eyr:2028 iyr:2010
hgt:162cm byr:1944 pid:872962499
eyr:2028 byr:1974
ecl:brn
iyr:2010 hcl:#18171d hgt:160cm
hcl:#602927
byr:1959 eyr:2027 iyr:2016 ecl:brn hgt:169cm pid:078503025
hcl:#623a2f pid:326300051 hgt:153cm
byr:1973 iyr:2012
ecl:gry eyr:2026
hgt:151cm
byr:1966 eyr:2029 pid:026952622 hcl:#18171d ecl:gry iyr:2010
hcl:#7d3b0c byr:1974 pid:444713591 iyr:2017 eyr:2030
hgt:165cm ecl:oth
iyr:2026 pid:184cm
ecl:gmt hcl:z hgt:71cm
eyr:2029
cid:310 hcl:#fffffd byr:1998
pid:450705840 iyr:2015
ecl:grn eyr:2021 hgt:165cm
byr:1939 hcl:#623a2f ecl:gry hgt:69in pid:539812641 eyr:2027 iyr:2013
pid:207645014
iyr:2015
cid:314 ecl:oth
byr:1942
eyr:2027 hgt:186cm hcl:#fffffd
ecl:#fb7e3d eyr:2031 iyr:1956
hgt:188 pid:160cm hcl:z byr:2027
byr:1972 iyr:2020 eyr:2026 hcl:#b6652a pid:289088329 hgt:65in ecl:gry
eyr:2027
hgt:59cm
byr:2022
pid:938063769 ecl:zzz iyr:2028 hcl:23c762
byr:2004 hgt:74 iyr:2017
eyr:2040 ecl:blu pid:4611117799 cid:73 hcl:z
ecl:brn byr:1962 cid:321
iyr:2019 eyr:2026
hgt:159cm
hcl:#667310 pid:439864945
iyr:2026 eyr:2039 pid:633263851 cid:321 ecl:lzr hgt:166cm
byr:2023 hcl:fc3c63
byr:1961 iyr:2010 ecl:blu
eyr:2023 pid:245858010
hgt:193cm pid:821303249 eyr:2020 hcl:#6b5442 cid:130 byr:1946
eyr:2026 ecl:brn
hcl:#733820 byr:1983 hgt:182cm pid:727380954 cid:188 iyr:2015
hgt:152cm cid:206 iyr:2012 byr:1947 hcl:#888785 ecl:gry
pid:720312394 eyr:2023
hgt:150cm ecl:gry pid:863712648
iyr:2019 cid:349 byr:1976 hcl:#602927 eyr:2022
hgt:164in pid:953500867
eyr:2021
iyr:2014
hcl:z cid:343 ecl:amb
byr:1981 pid:529710230 iyr:2013 eyr:2023
hcl:#c0946f ecl:amb
hgt:151cm
pid:706204190 hgt:154cm cid:317
hcl:#602927 byr:1949 ecl:blu iyr:2010 eyr:2028
iyr:2019 hcl:#0219e6
pid:850093151 ecl:gry
eyr:2030
byr:1938 hgt:177cm
ecl:brn hcl:#efcc98 eyr:2029 byr:1963
hgt:185cm pid:611279647 iyr:2011
ecl:blu eyr:2022 byr:1941 hgt:167cm
iyr:2012 hcl:#7d3b0c pid:415739564
cid:193
eyr:2027 ecl:blu byr:1968 pid:479994566
hcl:#733820 hgt:151cm
iyr:2011
pid:263729839 hgt:189cm eyr:2030 ecl:gry byr:2001 hcl:#602927
byr:1985
ecl:amb pid:672663977 cid:139
hgt:159cm hcl:#733820 iyr:2018 eyr:2020
byr:1998
hcl:#cfa07d eyr:2023 pid:255046063 iyr:2011 ecl:blu hgt:177cm
ecl:oth
byr:1980 pid:253747166 eyr:2029
hcl:#6b5442 hgt:186cm
eyr:2030 hcl:#866857
hgt:165cm
ecl:amb
iyr:2017 pid:241240220 cid:164 byr:2001
byr:1994 hcl:#b6652a iyr:2015
pid:753831241
hgt:175cm
eyr:2027 ecl:blu
hcl:#b6652a pid:471594512
byr:1961 ecl:hzl hgt:175cm
iyr:2020 eyr:2025
byr:1987 pid:112366159
eyr:2028 hcl:22b2d7
hgt:64in cid:222
ecl:#b40dca iyr:2019
iyr:2015 hcl:e1ed55 hgt:160in ecl:utc byr:2015 eyr:2036
byr:1935
hcl:#7d3b0c hgt:152cm ecl:gry
pid:160090332 iyr:2020 eyr:2020
pid:552779024 byr:1998 hgt:185cm ecl:gry eyr:2026 iyr:2013 hcl:#d46cd6
ecl:oth pid:311860969
cid:57
hgt:60in
eyr:2026
hcl:#ceb3a1
byr:1961 iyr:2011
eyr:2021 hgt:162cm cid:240
pid:259997995
hcl:#efcc98
ecl:gry byr:1962 iyr:2017
hcl:#866857
iyr:2016
eyr:2029
ecl:blu byr:1927 cid:249 pid:665324615 hgt:65in
byr:1931
cid:331
hgt:66in
ecl:grn iyr:2020 hcl:#efcc98 eyr:2025 pid:175780921
hgt:98
eyr:2040 ecl:blu byr:2029
iyr:1967 hcl:0d76e9
pid:#c9053a cid:296
pid:370918950
hcl:#602927
byr:1938
hgt:178cm iyr:2018 eyr:2030
ecl:oth
hgt:185cm
eyr:1984 ecl:oth pid:851080398
hcl:z byr:2027 iyr:2017
pid:095078224 byr:1957 hcl:#45bcf4 ecl:#f643f9 hgt:63cm eyr:2036 iyr:1978
hcl:z
eyr:2023 ecl:oth hgt:162cm
iyr:2016 byr:1938 pid:#fdcddf
hcl:#341e13 iyr:2013 hgt:189cm
pid:982271041 ecl:brn
byr:1930 eyr:2030
eyr:2026
iyr:2012 hcl:#cfa07d cid:59 pid:105862717 ecl:blu
hgt:159cm byr:1943
ecl:hzl
pid:604172804 iyr:2016 hgt:174cm cid:79 eyr:2025
hcl:#733820 byr:1994
iyr:2011 pid:452628771 ecl:gry hgt:182cm hcl:#623a2f
eyr:2023
byr:1986
hcl:#341e13 iyr:2010 byr:1946 eyr:2021
cid:350 pid:049684494 hgt:180cm
ecl:grn
iyr:2020
hgt:173cm pid:384503937
byr:1986
hcl:#341e13
cid:113
eyr:2025 ecl:amb
hgt:180cm byr:1949
hcl:#733820 iyr:2010 eyr:2030
cid:123 pid:065609606 ecl:oth
iyr:2010 eyr:2028
pid:231750173
hgt:63in ecl:brn
byr:1948 hcl:#18171d
iyr:2020 hcl:#623a2f
ecl:gry
byr:1922 pid:961213634 eyr:2022 hgt:177cm
hcl:#18171d eyr:2020 iyr:2014 byr:1983
pid:183568344 hgt:72in
ecl:gry
eyr:2023 pid:102781246 ecl:brn
hcl:#888785 byr:1929 hgt:167cm iyr:2010
pid:362873066 byr:1994 hcl:#de545f iyr:2018 hgt:177cm ecl:blu cid:86
eyr:2024
hcl:842f2d iyr:1983
byr:1954 eyr:2037
ecl:lzr pid:3915492573 hgt:166cm
ecl:grn
hcl:#fffffd iyr:2014
hgt:173cm
byr:1939
pid:930650489
eyr:2025
eyr:2028 ecl:brn hcl:#7d3b0c hgt:166cm byr:1938 pid:992958531 iyr:2011
pid:101149939 eyr:2024 iyr:2018 hgt:165cm
ecl:hzl
hcl:#ceb3a1 cid:176
cid:62
pid:651390352 hcl:#efcc98
iyr:2018
eyr:2027
ecl:brn
hgt:66in byr:1953
hcl:#623a2f byr:1978
iyr:2013
hgt:180cm eyr:2027 ecl:amb pid:836425641
pid:557464096 hgt:155cm ecl:blu cid:142 byr:1936 iyr:2010
hcl:#cfa07d eyr:2027
ecl:gry iyr:2024 hcl:#341e13 pid:442593279 cid:314 hgt:186cm byr:1960
eyr:2022
cid:123 iyr:2014
byr:2000
pid:878733390 eyr:2021 ecl:hzl hgt:162cm
byr:1959 cid:259
pid:722895016
ecl:brn iyr:2018 eyr:2027 hgt:185cm
pid:163697814 ecl:hzl
iyr:2013 byr:1932
hgt:68in cid:286 eyr:2025 hcl:#efcc98
byr:1927
hgt:72cm ecl:oth
eyr:2021 hcl:#99e959
pid:669724466 iyr:2010
byr:1943 iyr:2011 eyr:2024 pid:384419879 ecl:hzl hcl:#7d3b0c hgt:170cm
pid:137944386 ecl:gry
byr:1953 hcl:#733820 iyr:2013 eyr:2025 hgt:184cm
iyr:2017 eyr:2023 pid:288078785
hgt:179cm
byr:1993 hcl:#602927 ecl:hzl
ecl:brn
hgt:187cm eyr:2024 byr:1971 iyr:2020 hcl:#b6652a pid:622975646
cid:290
pid:371817422 ecl:blu byr:1964
iyr:2018
eyr:2021 cid:176
hgt:153cm hcl:#888785
byr:2002
cid:256 iyr:2014 eyr:2024 ecl:blu hcl:#18171d hgt:187cm
pid:050022911
hgt:178cm pid:211144001 eyr:2027 iyr:2013
byr:1947
hcl:#7d3b0c ecl:grn
eyr:2025 ecl:blu pid:046417901 byr:1950
iyr:2015 hgt:165cm
hcl:#7d3b0c cid:128
ecl:hzl eyr:2029
iyr:2015
hgt:171cm hcl:#341e13
pid:561680375 byr:1997
byr:1948 iyr:2023 pid:17288381 hcl:6a34a3 ecl:#671ece eyr:2001
cid:152
eyr:2036 hgt:141 iyr:1957 byr:1987 hcl:z
pid:86986187 ecl:utc
eyr:2024 hcl:#b6652a iyr:2017 ecl:blu byr:1988 cid:348 hgt:152cm pid:068684272
iyr:2011 pid:989825275
cid:78 hcl:#341e13 byr:1983 ecl:blu hgt:158cm eyr:2020
ecl:grn hgt:187cm eyr:2027 iyr:2015
hcl:#866857 pid:240650427
byr:1940
cid:91
hcl:#888785 cid:185 byr:1925
hgt:155cm iyr:2015 ecl:blu eyr:2027 pid:851697441
iyr:2016 ecl:oth pid:056439470 byr:1985 eyr:2026
hgt:154cm hcl:#282539
ecl:hzl hcl:#a97842
iyr:1944
pid:118846711 eyr:2026 byr:1922 hgt:185cm
iyr:2020 hcl:#733820
pid:854531642 hgt:165cm
ecl:hzl eyr:2022
iyr:2014
byr:1957 hcl:#7fa674 hgt:189cm
eyr:2023 pid:740871941 ecl:brn
ecl:amb cid:349 hgt:170cm
byr:1952 hcl:#ceb3a1 iyr:2020
eyr:2026
pid:730499325
eyr:2027 ecl:amb
byr:1975 pid:985687961
hcl:z hgt:157cm
iyr:2013
cid:133
ecl:blu
hgt:193cm iyr:2015 hcl:#10f2ba byr:1989 pid:939704495 eyr:2021
ecl:oth eyr:2025 hgt:69in iyr:2014 cid:258 pid:477970733 byr:1984 hcl:#b6652a
hcl:z byr:2013
ecl:zzz
pid:1904741884 hgt:180 cid:138 eyr:1985 iyr:1935
eyr:2025
iyr:2026 hgt:190in pid:#43ca33
ecl:#3e1ef1 hcl:#7d3b0c byr:2030
eyr:2029 hgt:191cm
byr:1986 hcl:#ceb3a1 cid:327 pid:795060714 iyr:2012 ecl:hzl
eyr:2025 iyr:2017 ecl:grn
hcl:z
pid:8886398 hgt:174cm byr:2016
hcl:#a97842
eyr:2021 ecl:grn iyr:2013 pid:565234133 byr:1998
hgt:161cm
eyr:2029 hgt:163cm byr:1933 cid:86 iyr:2011
ecl:grn
hcl:#fffffd
pid:818769307
hgt:190cm eyr:2030 hcl:#af5b5d iyr:2011 ecl:brn pid:359524299 byr:1969
ecl:amb iyr:2011 eyr:2022
cid:141
byr:1978 hgt:69in hcl:#fffffd pid:013006109
ecl:blu hgt:164cm iyr:2019 eyr:2027 pid:899103430 hcl:#cfa07d
byr:1976
eyr:1938
ecl:#a03c41 pid:708735698
iyr:2030
hgt:184cm hcl:#b6652a byr:2013
ecl:hzl byr:1997 hcl:#a97842 cid:60 pid:172cm
eyr:2023 hgt:161in iyr:1936
ecl:hzl
byr:1938 pid:094889181
hgt:162cm iyr:2020
eyr:2028
hcl:#623a2f
hgt:162cm cid:86
hcl:#623a2f pid:738174580 ecl:brn byr:1980 eyr:2028 iyr:2014
byr:2007 hgt:150in hcl:z
eyr:2032
ecl:#114f3b
iyr:2030 pid:5129772
ecl:hzl iyr:2017
hcl:#18171d
pid:696283412 byr:1976 hgt:168cm
eyr:2028
eyr:1922 ecl:#84b0d4 byr:2013 hcl:#ceb3a1 pid:150cm iyr:2030
hgt:71cm
hgt:164cm byr:1949 ecl:gry eyr:2026
hcl:#623a2f
ecl:oth
iyr:2013 hgt:166cm hcl:#50e385
pid:478852286
eyr:2030 byr:1930
cid:129
iyr:2020 byr:1978 pid:907580992 eyr:1955
hcl:#602927
ecl:grn hgt:165cm
ecl:blu iyr:2018 byr:1953
hgt:177cm pid:126681706 eyr:2025 hcl:#c0946f
byr:1984 pid:275799917
ecl:oth hcl:#623a2f cid:348 iyr:2020
hgt:189cm eyr:2024
iyr:2016
ecl:hzl byr:1954
hcl:#623a2f pid:810508839 eyr:2026
hgt:185cm
byr:1967
eyr:2021 hcl:#ceb3a1
pid:406634908 hgt:158cm iyr:2018 ecl:hzl
iyr:2019 eyr:2030 pid:995681076 hcl:#341e13
cid:101 hgt:162cm ecl:blu byr:1925
eyr:2026 pid:272513479 hcl:#b6652a byr:1973 iyr:2016 ecl:amb hgt:182cm
pid:298704871 eyr:2024 hcl:#efcc98 byr:1959
iyr:2014 hgt:191cm ecl:grn
hgt:193cm pid:750729809 ecl:oth
cid:324
iyr:2011 hcl:#efcc98 byr:1954 eyr:2020
byr:1966 iyr:2019 eyr:2025 ecl:#2df4b6
hgt:184cm pid:#fc17f4 cid:161 hcl:#602927
byr:1955 hcl:299464 ecl:amb
hgt:157cm iyr:2017 eyr:2021
pid:239450987
hgt:172cm
ecl:hzl
pid:839804598
hcl:#341e13 eyr:2030 byr:1964 iyr:2013
iyr:2018 hgt:152cm byr:1948 hcl:#623a2f pid:400121515
ecl:blu
eyr:2020
cid:296
ecl:grn
byr:1960 iyr:2028 pid:#1f4b95 eyr:2033 hcl:#602927
hgt:66cm
iyr:1933 ecl:#232e20 pid:#d03ca7
eyr:2030 hcl:598ed6 hgt:154in byr:2011
cid:247 ecl:grn iyr:2014
hgt:178cm
byr:1992 hcl:#602927 eyr:2021
pid:678964478
iyr:2010 pid:623705680
ecl:hzl hgt:181cm byr:1980 hcl:#341e13 eyr:2028
..#......###....#...##..#.#....
.#.#.....#.##.....###...##...##
..#.#..#...........#.#..#......
..#......#..........###........
...#..###..##.#..#.......##..##
......#.#.##...#...#....###....
..........##.....##..##......#.
......#...........#............
#....#..........#..............
.#........##.............###.##
....#.........#.......#.#....##
#.#..#..#..#.......#...#....##.
.#........#......#.##.......#..
..#.....#####.....#....#..#..##
.......#..##.......#......#.###
..#.#...#......#.##...#........
##...................#...##..#.
......#...#.##...##.#......#..#
.#.................#..##...#...
...#.....#.......##.....#.#....
.......#.#......#.....#..#..##.
..........#........#...........
..#.#..........................
.#.##..#.#...#...#.........#...
.....#....#.....#..#.....#.....
...#.#.#.....#.#..#.......#..#.
.....#...###...##...#......##..
#.###......#.#...#.#.#..###....
#.....#..##......#..........#.#
#...............#........#.#..#
.....#..#.........#......##.#..
.....#.##.##..#..##............
...#......##...............#.#.
.#..#.#............##.#........
#.....#..###.............##.#..
...##..#.#..#...........#..#...
#....#.........#.#.............
##.#.........#..###......#.#..#
...#...#......#.#.#.##..#.##...
.....##............#.##.##..#..
....#................#.##..#..#
...#..#.......#...#..#........#
....#...#...#................#.
....##...............#.#...#...
.#.....###...#.......#.##......
....######.#..............###.#
.#..#.........##...............
................##.#..#....###.
.......#............#.#..#..#..
......#.#...............##.#...
...#..####.#...#..#..#......#..
....#.#...#.....#.........#..##
.##..#...#......##....##.#.#...
.##.#.........##...#....#......
..#.#..#...#.#..#.......#...#.#
.........#..#.....##..#........
..#......#..##.....#..#...###..
..#...#....#.#..#..#.#.#..#.#..
...#..#####.....#......#.......
#.#............#......#..#...#.
.........#..........###.......#
......#....#..#.##.#......#..#.
...........##.#....#.#..#......
..#...................#..#.#...
#....##.............##....#...#
##..#....#.........#..........#
....#.#.#...#..#........#.##..#
...............#...#..##..#....
.##.......#.......#...........#
#.........................##...
#........#.#..#..##..####.#....
...................##.....###..
.#.......#..#......#......#...#
..#.........#...#..........#...
..........#......#....#........
.#......#..#...#..#...##....##.
...#.#..#..#......#.....##.####
.......#.#....#.......#........
#...#.#...##..##.#......#......
.#.........#...................
...#..........#.#......#.......
...#.....##....#..........#....
.#..........##..#..#..##....#.#
.##.#..........#...#.##.......#
#...###....#..#.#...#..#.......
..................##...........
..#...##.#...........#....#.##.
..#......#..##..#....##..#...#.
..#....#.....#.##..#.......#..#
#...#....#..#.#....#......##...
.......##..#..........#........
..#.............##.#.....#...#.
...............#....#...#...##.
##...........#.......#.##......
#..#...........#.........#.....
....###.............###.##..##.
.........#.#.....###.......#...
..#.##....#.#..........#....#..
#........#....##...#..#........
......#..........###..#.#......
.....#.#......##.....#..##...#.
.#.......#......#...#...#...#.#
.#..........##.......#.....##.#
###.#...#....#.....#...#......#
..#.#.#..#.##.#..#.............
.....#.........................
.#..###..#...#...#..#..#...#.#.
#................##...##.##....
......#...#...#..........#...#.
..........#.....##.............
..#.#......#........#.......#..
........##.............#.......
.......#......#.##.#..#........
#.#.#....#........#..........#.
##..##......#..#..#.....#.#..##
##..#..........#...............
#.....##...#.#......#.......#.#
#.....#...#....#..#.....##.....
##..........#.#.....#....#...##
..##.###..#.....#.......#...#..
.#.#.......#......###........#.
.#..............#.#..###.......
.#....#..##.........#..#.#.....
....#....#.#....#..#.......##.#
#.......#.......#.........#....
...#....#....#.....##..#..#.#.#
........#....#...........#.....
.#......##.#.#.##..............
#..#.#.....##........#........#
##...#.#.......##.......#...#..
#...#.....#.##...##.#.....#....
....#..##...#........#.#...#...
...#....#.#.#..###...##.#.....#
......#..#.....#..#........##..
.......#.....#.#.........#.#..#
..#.......#.#.#.#.#....#.##...#
.#...#........#..##..#......#..
.#..#............#...#..#.#....
...##......#......#............
..#...#.#.....#.....#..##.#....
.#......#.#......#..#.#........
..#..........##...#.#.....#..#.
#...#.....#..#...#.............
..##.................#....#....
.#....#.......#..##....#......#
.#....###............##....##.#
##..#........#..#...#.......#..
.....#.....#.#.#.##.........#..
.......#..#....#...#...#.......
...#...#...#.#.#..#.#.....#....
#.#........#..#.##..#..###.....
..................#..#.........
#.#.....#..##.........#.......#
###..#.......#..............#..
......#..#.....###..........#..
....#.#...#..#...........#.#...
...#.....#.......#.....#.#.....
#.....##..#......##...........#
#...###...........##..#...#.##.
......##.##.#...#..#....#......
...#.#......##.#......##....#.#
..............#.#.###.......#..
........#....#.......##..#..###
...#.....##.#....#......##..#.#
..##........#.....#.#..#...#...
.#..#.##.........#.....#...#..#
..#..#....#...........#........
.#...#....................#....
##.....##....#.............#.#.
....#.#..#.#..#.#.#..........##
.............##.#.....#..#..#..
.#....#.....##...#.###.........
..#........#........#.#..###...
.##....#...#...#.......#...#.#.
..#...#...#..##........#..#....
..##.#..#..#.....#......#.#..#.
.#........#..#....#..#.........
..#.#.....#.##..#........###.#.
.....#.##.....##.#.............
#.........#.......#...##...#...
..#.##.#..#..#............#....
.##....#..#............#.....#.
###........##.....##.#...#.....
#......##..##.#.#.#.#.#.#..##..
.....###.....#....#......#....#
........#.........##...#....#.#
.#.#.....#.#..#..##......#...#.
...#.##....#..#.###..#..##.....
....#..........##..#..#..#..#..
...#..#.##..#..#....#.........#
.....#..###.#.....#.....#..#...
......#...#....#.##...#.#......
.#.###..##.....##.##......##...
.....#.#...........#.#.........
#........#...#..#......##.#....
..#.......##....##....#.##.#..#
...###.#.........#......#.....#
..#.##..#....#.....##...#.##...
....##.##.............#...#....
##..#...#..#..#..#.............
.....#.....#.....#.............
...#.##.......#..#.#.....#....#
#.....##.........#......##.....
.....##..........#..#...#..#...
#...###....#.......#...##......
.#....#..#......#.....#...#.#..
#........#.#.#...#.....###.#.##
##...#...##..#..#....#.........
....#............#..#.....#....
#......#.........##....#.......
.#..#..#........#.............#
.##..........#......#.......#..
#............#..#....#.........
....#.#.....#.##...#.....#.#...
...#.#..#...##..#...#.#.#......
#....#..#.........##..#.#.#..##
.#...#..............#.......#..
#...#.....#.#........##......##
...#....##.####.#.........#.#.#
....###.#..#............#.#..#.
....#......#...#......##.#.#.#.
.....#..#.#.##.#...##..........
##..#...#.#...###.............#
....#...#..#.....#.#..#..#..#..
#..........####......#.....###.
.........#........#.##.#...#...
.........#..........#.#..###...
.....##........##.........#...#
..##....#...#.......##.........
.....#.#......##....#...#...#..
.##..#..##.....................
.......#...#..#..#...##....#...
.#...#.......###...#..#..#.....
.......#.....##.##.#.......#..#
.##......#...#....#..#......##.
.##....#..#....#...#...#.......
.........##..#..#.#.#.....##...
...#..............#..#.....####
.#.#.#..#.......#.......#......
..#.#......#..........#........
.#...#.#..#.......#..#..#..#...
.......##.#...#..#....#.....#..
.##...##....##...#........####.
....#.#..##....#...#....#.#....
.....#.....#..#..#.#.##..#.....
..#....#..............#....#...
..#.#.#.....##.#.....#..##.....
....#.....#....#...#...#..#.#..
#...#...........#..#..#........
...#.#..#.........##.#...#..##.
......#.#.........#.#...#......
......#..##.###......##.#....#.
.....#...#..#.......#..........
.#...#.......#.....###......#..
...........##.....#..#..#....#.
..#....#..#...#......#.......#.
..#...#...#.#..#....#...#......
.......#....###.####...###.#...
#.##.#.......#.......#....#.#.#
.##..........#.....#..###......
.....#...........#.##..#....#..
........##.....#.#........##...
#..#..#..................##....
#...###..........#.............
.......#.#.......#.#.......##..
.....#.#...#....#...####.....#.
..##.....##.......#....#.......
##..........#...#..##....##....
..........#..#......#........#.
##..#....#..#....#.....##....#.
##.##.....#...##.##.......#....
..#..#.###.#..##.#..#..#...#...
.#..#.....#........#...##.#....
..#..#.....#.#......##.#.#.....
.#..##...#.#....#...#...#.#.##.
.........#...#....###.#.....#..
...........###.#.#..#..#...#.#.
##...#......##...........#..#..
.........##..#...#.......#.....
#......#.#..........#..#.......
...#.................#....#....
#....#......................##.
##.......#..#......#.#...###.#.
..#....#..#.#......#...........
...#...........###.#.#.........
..#..##.....#.....##...##......
..#..#.#.#.#..#..#..##....#...#
#......##.....##..##.##...#....
#.....#.....#.#........#.......
.#.....#.................#....#
.###....#...#............#.#.#.
.#...#.#......#.#..............
....#...#......#.....#.......#.
........#.....#..........#....#
#..#......#...#...#.........#..
#....#......#...##.#...#...#...
#...#....#....#..#..#.....#..#.
#......##..#..#.#.#..#.#.......
..#..#...............#...##...#
............#..............#.##
.#.#.#......##.......#.......#.
....#.........##.......#...###.
.......#.#...#.#.#.......#.....
....#..#..#...#....#.##.#.##...
...##.##.#...#......#..........
#.....#...#.#...#.##..##.#.....
.......#.....#...#.#...##.#....
.#.............#.....#....##..#
##......#.......#...#....#.....
.###......#.................#..
#.#......##.........##..#......
...#....#..........#.#.........
..##..#.........#..............
.....#...#..................#.#
.............#.........#...#..#
....#....#......#.#.......#...#
#..#............#.#.......#...#
..#.....#............#.........
.#.....................###....#
........#.####.........#.#.#...
#...........##...#.........#..#
...........#..#......#...#.#...
....##...##.....#.....#........
import Control.Arrow
import Data.List
import Prelude hiding (Left, Right)
data Direction = North | East | South | West
deriving (Eq, Show)
data Turn = Left | Right
data Command = N Int | S Int | E Int | W Int | L Int | R Int | F Int
deriving (Read, Show)
data State =
St { facing :: Direction
, position :: (Int, Int)
, waypoint :: (Int, Int)
}
deriving Show
adjust :: String -> String
adjust [] = undefined
adjust (c:cs) = c:' ':cs
directions :: [Direction]
directions = [North, East, South, West]
move :: Direction -> Int -> (Int, Int) -> (Int, Int)
move North = second . (+)
move South = second . (subtract)
move East = first . (+)
move West = first . (subtract)
turn :: Turn -> Int -> Direction -> Direction
turn t i dir =
directions !! ((4 + ((dirpos dir + i * diroffs t) `mod` 4)) `mod` 4)
where dirpos North = 4
dirpos East = 1
dirpos South = 2
dirpos West = 3
diroffs Left = -1
diroffs Right = 1
drive :: State -> Command -> State
drive st cmd =
case cmd of
(N i) -> st { position = move North i pos }
(E i) -> st { position = move East i pos }
(W i) -> st { position = move West i pos }
(S i) -> st { position = move South i pos }
(F i) -> st { position = move dir i pos }
(R i) -> st { facing = turn Right (i `div` 90) dir }
(L i) -> st { facing = turn Left (i `div` 90) dir }
where pos = position st
dir = facing st
rotate :: Turn -> Int -> (Int, Int) -> (Int, Int)
rotate dir i way = iterate (single dir) way !! i
where
single Left (x,y) = (-y, x)
single Right (x,y) = (y, -x)
actual_drive :: State -> Command -> State
actual_drive st cmd =
case cmd of
(F i) -> st { position = (x + xoffs*i, y + yoffs*i) }
(N i) -> st { waypoint = move North i way }
(E i) -> st { waypoint = move East i way }
(W i) -> st { waypoint = move West i way }
(S i) -> st { waypoint = move South i way }
(R i) -> st { waypoint = rotate Right (i `div` 90) way }
(L i) -> st { waypoint = rotate Left (i `div` 90) way }
where (x,y) = position st
dir = facing st
way :: (Int, Int)
way@(xoffs, yoffs) = waypoint st
main :: IO ()
main = do
directions <- lines <$> readFile "input.txt"
let dirs = ((read . adjust) <$> directions) :: [Command]
let part1 = foldl' drive (St East (0,0) (0,0)) dirs
print $ part1
print $ uncurry (+) $ (abs *** abs) $ position part1
let part2 = foldl' actual_drive (St East (0,0) (10,1)) dirs
print $ part2
print $ uncurry (+) $ (abs *** abs) $ position part2
F10
N3
F7
R90
F11
W3
R180
S1
F2
R90
W3
F81
L270
W5
F30
R90
E5
S3
F44
R180
S4
F21
R270
F2
W3
F36
L90
S1
E3
F86
S2
F98
E4
F93
W5
R90
W5
F4
E4
F6
R90
N2
L90
F52
R90
W4
F30
E5
W5
N4
F1
N3
W2
F89
E1
L90
W1
R90
F67
N5
R90
F95
L90
E4
S4
E2
N4
E4
R90
R90
F99
W1
R90
E4
F26
W5
L90
F89
E2
F18
W3
L90
F64
N2
F69
L90
F81
R90
E4
L90
N5
E2
F25
W4
L180
N2
R90
F82
R90
S3
F64
E4
F11
R90
F93
E2
F18
L90
R180
F13
L90
F37
L90
F63
R90
W3
N2
E2
F90
E5
L90
F1
W1
S5
W2
E5
S1
L90
E3
N4
L180
F26
E1
L90
W3
L90
S5
R90
F40
N3
W2
F85
E1
R270
F87
W2
F87
N3
E1
S4
E3
W3
F55
S1
E2
N3
L90
F44
W4
L90
F5
S5
F97
S3
R90
S2
E4
N3
F39
W2
F43
N1
W1
N2
E1
L180
N2
W4
S2
W1
R180
E1
N1
F5
W2
S2
L90
E4
L90
N3
W4
L90
E3
E1
S5
E2
L180
F86
W1
L90
W5
L90
E4
F63
W5
R180
F98
E3
F67
W4
E2
N4
L90
E3
L90
F97
L90
F21
N1
R90
F34
L90
L180
F30
E4
N2
R180
N1
R180
N4
F77
L180
N5
S1
F81
W1
N5
F77
S2
W2
S4
E2
F19
R90
R90
N2
F57
S4
L90
W3
R90
N5
W3
F16
L90
E4
W2
S3
L90
N5
R90
F93
S3
W5
R90
F80
N4
R90
N1
F95
S3
R90
F38
R90
F81
E2
S1
E1
L90
N5
W2
L90
N1
R90
E5
F79
S3
E5
N3
F92
N2
W4
S3
L90
F79
W4
L90
F46
S4
L90
S5
R270
F33
W5
L90
F46
W5
R90
S3
R180
W4
E4
R180
F87
N5
F63
S2
E2
F35
W4
F19
R90
S3
E3
R180
E4
F14
E5
L270
F35
L180
F74
R90
S4
W1
F36
R90
S2
F1
L90
S4
F55
E4
N1
L90
S3
N3
W5
S4
L180
W1
S3
F30
S3
E2
F25
S4
F29
L90
W1
L90
F60
W2
S3
W1
S2
R90
F82
S5
L90
E4
R90
W1
F92
L90
F35
W4
F94
L90
F56
F52
L180
E2
S5
W1
L180
N3
E2
E1
F15
L90
F49
L180
F57
L180
F86
S1
R180
N3
F59
W4
F17
R90
W3
F7
L180
N3
L90
E3
F57
L180
W4
S1
L90
S3
F7
E2
S5
F36
E3
F87
L90
L180
F58
R90
N1
L270
F24
N5
F3
F65
S2
R90
F62
L270
F94
E5
N2
F79
R90
E4
F43
W5
N3
F81
N5
R90
F22
W2
R180
N2
L90
E5
F39
E4
F8
W4
N4
W4
S4
L90
S1
L180
W3
L90
N1
R90
W4
R90
F7
W4
F40
E5
L90
R270
E4
R90
F34
W2
R90
N2
L90
F45
R90
E5
R90
N2
F11
L90
F80
S2
E2
R180
E2
L180
S1
F39
L180
N4
F99
R270
W4
L90
R90
W1
E1
S5
R90
F91
W4
F93
L180
E1
F15
N2
R90
W4
F26
S2
R90
N5
L90
N4
W4
S3
F25
E4
F38
L90
W1
F86
E5
L90
W5
L90
F21
W2
F99
L90
N4
L180
F40
S2
W4
F70
W3
F32
N1
W1
L90
N5
R90
W3
F99
W3
N2
R90
S3
E2
L90
N5
F36
S1
L180
W4
S5
E4
F54
L90
S5
E2
L90
F14
W1
N1
R90
S5
E4
F32
R90
N1
F23
E4
N4
W4
F57
N2
R180
E2
S4
F70
L90
W4
S3
F57
L90
E3
N5
R90
N4
W4
N5
W5
R90
W4
R90
E3
L90
N2
F93
L90
R180
S4
F28
E3
R90
S2
E3
R90
L90
F49
R180
F12
L180
N4
R180
S4
R90
S5
R90
F96
N4
F14
L90
S1
E2
L90
N3
R90
E2
W2
L180
N4
R90
W3
L90
N4
F69
E1
L90
S3
F62
R180
N3
F64
W1
S4
E1
L90
S3
F85
E2
L90
W3
R90
F92
N5
W2
N1
W1
R90
F1
R90
E2
R90
F34
N5
E2
N2
F79
L180
F63
L90
W2
F16
F81
S1
R180
F52
N4
W1
S3
R90
F58
E5
F99
W4
N3
L90
W4
F39
S2
F12
S1
W5
S2
F30
E2
F21
E2
N2
W5
L90
N1
W1
W3
N5
F65
S1
L180
F94
W1
L90
S2
E5
N3
F46
L180
S3
F1
L90
F77
N3
F36
N2
R90
F54
F65
N4
F99
E5
L180
E4
S3
E1
F83
E4
F50
N2
W2
R180
W5
R90
F96
L90
F7
E4
W2
F11
L180
N5
L180
S1
F92
S3
F3
readlayout =: 3 : 0
d =. 1!:1 y
d =. toJ d
d =. cutopen d
> d
)
slice_spec =. 1 1 ,: 3 3
step_individual =: 3 : 0
curr =. (< 1;1) { y
fl =. curr = '.'
occ =. curr = '#'
nums =. > ('#' & =) each > y
NB. (+/ & ;) = sum . flatten
NB. ((< 1;1) & {) = item at index 1,1
NB. ((f g h) x) = (f x) g (h x)
NB.
NB. so this line sums the box and subtracts the middle value, hence getting
NB. the number of adjacent, filled chairs.
adj =. ((+/ & ;) - ((< 1;1) & {)) nums
if. fl do. '.' else.
if. occ do.
if. (adj >: 4) do. 'L' else. curr end.
else.
if. (adj = 0) do. '#' else. curr end.
end.
end.
)
one =: 3 : 0
curr =. (< 1;1) { y
fl =. curr = '.'
occ =. curr = '#'
adj =. ((+/&;)-((<1;1)&{))>('#'&=)each>y
etf =. (]&'L')`(]&'#')@.(=&0)
fte =. (]&'L')`(]&'#')@.(<&4)
((etf`fte@.(]&occ))`(]&'.')@.(]&fl))adj
)
step =: 3 : 0
padded =. '.',"1('.',y,'.'),.'.'
NB. step_individual =. (+/ & ;) - ((< 1;1) & {)
slice_spec step_individual ;. _3 padded
)
part_one =: 3 : 0
seats =. readlayout < y
final =. step ^: _ seats
counts =. > ('#' & =) each > final
+/ ; counts
)
NB. angles =: (< 1 0) , (< 0 1) , (< 1 1) , (< 1 _1)
NB. angles =: angles , <"1 (_1 _1 *"1 > angles)
NB. the verb applied to angles above is "multiply each coordinate by -1, -1"
angles =: (, (<"1 @: (_1 _1 *"1 >))) (<1 0),(<0 1),(<1 1),(<1 _1)
NB. From here, I wasn't able to figure out how to bend J to my will enough to
NB. accomplish what I wanted to do.
NB.
NB. The struggle came in building line-of-sight vectors for each seat. My
NB. initial plan was to do it by constructing a table of each seat coordinate,
NB. then using [angles] above to draw rays out in all 8 directions, but that
NB. became pretty painful pretty quickly and I wasn't particularly having fun
NB. anymore.
L.LL.LL.LL
LLLLLLL.LL
L.L.L..L..
LLLL.LL.LL
L.LL.LL.LL
L.LLLLL.LL
..L.L.....
LLLLLLLLLL
L.LLLLLL.L
L.LLLLL.LL
import Control.Arrow
import qualified Data.List as L
import Data.Maybe
import Data.Vector
import Prelude hiding (concat, filter, head, length, map,
takeWhile, (++))
data Seat = Occupied | Empty deriving (Show, Eq)
display :: Vector (Vector (Maybe Seat)) -> String
display board = toList $ concat $ toList $ fmap (fmap disp) board
where disp Nothing = '.'
disp (Just Occupied) = '#'
disp (Just Empty) = 'L'
status :: Char -> Maybe Seat
status '.' = Nothing
status 'L' = Just Empty
status _ = undefined
parse :: String -> Vector (Vector (Maybe Seat))
parse = fromList . fmap fromList . ((status <$>) <$>) . lines
directions :: [(Int, Int)]
directions = half ++ ((negate *** negate) <$> half)
where half = [(1,0),(0,1),(1,1),(1,-1)]
(++) = (L.++)
seatVisible :: Vector (Vector (Maybe Seat)) -> (Int, Int) -> (Int, Int) -> Bool
seatVisible board (x,y) (xOffs, yOffs) =
fromMaybe False
$ foldl' f Nothing
$ map (fmap isOccupied . uncurry index)
$ takeWhile (\(x,y) -> 0 <= x && x < width && 0 <= y && y < height)
$ fromList $ (((x+) . (xOffs*)) &&& ((y+) . (yOffs*))) <$> [1..]
where
-- index x y = (board ! y) ! x
index = flip (.) (board !) . flip (!)
height = length board
width = length (head board)
isOccupied Occupied = True
isOccupied Empty = False
f (Just x) (Just y) = Just x
f (Just x) Nothing = Just x
f Nothing (Just y) = Just y
f Nothing Nothing = Nothing
step :: Vector (Vector (Maybe Seat)) -> Vector (Vector (Maybe Seat))
step board =
fmap (uncurry stepSeat <$>) $
generate height (\y -> generate width (\x -> (x,y)))
where
index = flip (.) (board !) . flip (!)
height = length board
width = length (head board)
seatChange visible Occupied = if visible > 4 then Empty else Occupied
seatChange visible Empty = if visible == 0 then Occupied else Empty
stepSeat :: Int -> Int -> Maybe Seat
stepSeat x y =
let visible = L.length $ L.filter (seatVisible board (x,y)) directions
in seatChange visible <$> index x y
fix :: Eq a => (a -> a) -> a -> a
fix f x = if x' == x then x' else fix f x'
where x' = f x
readBoard :: String -> IO (Vector (Vector (Maybe Seat)))
readBoard = (parse <$>) . readFile
solve :: String -> IO ()
solve s = do
board <- readBoard s
let equilibrium = fix step board
print $ length $ filter isOccupied $ concat $ toList $ equilibrium
return ()
where
isOccupied (Just Occupied) = True
isOccupied _ = False
main :: IO ()
main = solve "input.txt"
import Control.Arrow
import Control.Monad
import qualified Data.Map.Strict as M
import Data.Maybe
data Seat = Occupied | Empty deriving (Show, Eq)
data Board =
B { table :: M.Map (Int, Int) Seat
, getWidth :: Int
, getHeight :: Int
}
deriving (Show, Eq)
newtype Direction = D (Int, Int)
(!?) = (M.!?)
display :: Board -> String
display board =
concat
[([disp (tbl !? (x,y)) | x <- [0..width-1]] ++ "\n") | y <- [0..height-1]]
where tbl = table board
width = getWidth board
height = getHeight board
disp Nothing = '.'
disp (Just Occupied) = '#'
disp (Just Empty) = 'L'
printBoard :: Board -> IO ()
printBoard = putStr . display
parse :: String -> Board
parse ss =
let
rows = lines ss
height = length rows
width = length $ head rows
annotated = join $ zipWith (\y -> zipWith (\x s -> ((x,y), s)) [0..]) [0..] rows
asList = map (second $ const Empty) $ filter ((== 'L') . snd) annotated
tbl = M.fromList asList
in
B tbl width height
seesOccupied :: Board -> (Int, Int) -> Direction -> Bool
seesOccupied board (x,y) dir@(D (xOffs, yOffs)) =
if x < 0 || x >= width || y < 0 || y >= height
then False
else case M.lookup next tbl of
Just Occupied -> True
Just Empty -> False
Nothing -> seesOccupied board next dir
where tbl = table board
width = getWidth board
height = getHeight board
next = (x+xOffs, y+yOffs)
step :: Board -> Board
step board = board { table = M.mapWithKey go tbl}
where
tbl = table board
go loc status =
let visible = length $ filter (seesOccupied board loc) directions
in case status of
Occupied -> if visible >= 5 then Empty else Occupied
Empty -> if visible == 0 then Occupied else Empty
directions :: [Direction]
directions = map D $ half ++ ((negate *** negate) <$> half)
where half = [(1,0),(0,1),(1,1),(1,-1)]
fix :: Eq a => (a -> a) -> a -> a
fix f x = if x' == x then x' else fix f x'
where x' = f x
readBoard :: String -> IO Board
readBoard = (parse <$>) . readFile
solve :: String -> IO ()
solve s = do
board <- readBoard s
let equilibrium = fix step board
print $ M.foldr (+) 0 $ M.map numSeated $ table equilibrium
return ()
where numSeated Occupied = 1
numSeated Empty = 0
main :: IO ()
main = solve "input.txt"
LLLLL.LLLL.LL..LLLLLLLLLLLLLLLLLLLLLLLLL.LLLLLLLLLLLLLLL.L.LLLLLLLLL.LLLLLLL.LLLL.LLLLLLLL
LLLLLLLL.LLLLL.LLLLLLLLLLLLLLLL.LLLLLLLL.LLLLLLLLLLLL.LLLLLLLL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.L.L.LLL..LLL..L...L.......LLL..L.....LL...LL....L.
LLLLL.LLLLLLLL.LLLLLLLLL.LLLLLLLLLLLL.LLLLL.LLLLLLLLL.LLLL.LLLLLLLLL.LLLL.LLLLLLL.LLLLLLLL
LLLLL.LLLLLLLLLLLLLL.LLL.LLLLLL.LLLLLLLL.LLLLLLLLL.LL.LLLL.LLLLLLL.L.LLLLLLLLLLLL.LLLLLLLL
LLLLL.LLLL.LLL.LLLLLLLLL.LLLLLLLLLLLLLLL..LLLLL.LLLLL.LLLL..LL..LLLL.LLLLLLL.LLLL.LLLLLLLL
LLLLL.LLLLLLLLLLLLLLLLLLLLLLLLL.LLLLLLLL.LLLLLL.LLLLLLLLLL..LLLL.LL..LLLLLLL.LLLLLLLLLLLLL
LLLLLLLLLLLLLL.LL.LLLLLL.LLLL.L..LLLLLLL.LLL.LL.LLLLLLLLLL.LLLLLLLLL.L.LLLLL.LLLL.LLLLLL.L
I was planning to do this in J, but gave up.
My next initial attempt was in Haskell but was something awful like O(n^4) with
bad constant factors, as seen in `part2_tooslow.hs`
readtable =: 3 : 0
d =. 1!:1 y
d =. toJ d
d =. cutopen d
d =. 0 ". each d
d =. > d
)
NB. to derive the below from above, just substitute the values of [d] in-place,
NB. then remove all parentheses.
readtable_tacit =: 3 : '>0 ". each cutopen toJ 1!:1 y'
NB. second argument minus first argument
NB. {: = all but last element
NB. {. = all but first element
NB. ({: - {.) t = ({: t) - ({. t)
diff =: {: - {.
part_one =: 3 : 0
NB. y is always the input to a monadic (single-argument) function
data =. readtable y
sorted =. /:~ data
NB. (x f \ y) means "apply f to successive runs of length x from y"
NB. in this case, it means "apply diff to adjacent pairs (2) in y"
diffs =. /:~ (2 diff \ sorted)
NB. (= t) is "self-classify", which is equivalent to ((nub t) =/ t)
NB. (nub t) is the standard deduplication function
NB. ((nub t) =/ t) compares each element of (nub t) to each element of t,
NB. giving 1 when they match and 0 when they don't
NB. This gives a table with 2 rows and n columns
separated =. = diffs
NB. (/) is effectively foldr -- it interleaves the elements of the table
NB. with the given operator. So (+/ 1 2 3 4) is (1+2+3+4).
NB. (+/) " 1 says "apply the verb (+/) at rank 1 (per row)".
counts =. +/ " 1 separated
NB. Increment the number of 1-increases for the first connection (0-1), and
NB. also the number of 3-increases for the final connection (last-device).
NB. This isn't strictly correct if the lowest adapter has voltage 3, but I
NB. already know that it has voltage 1. Properly, we should just prepend a
NB. 0 voltage to [sorted] before doing all this, then add only to the 3s
NB. column.
amended =. 1 + counts
answer =. */ amended
answer
)
part_one_tacit =: 3 : '*/ 1 &+ +/ " 1 = 2 ({: - {.) \ /:~ /:~ readtable < y'
trib =: 3 : '{. ((1 & }. , +/) ^: y) 1 1 2'
part_two =: 3 : 0
data =. readtable y
sorted =. /:~ data
NB. remember to add the initial plug
sorted =. 0, sorted
diffs =. 2 diff \ sorted
NB. remember to add the final output
diffs =. diffs, 3
NB. Okay, deep breath:
NB. ({.) = head
NB. (1 & }.) = drop 1
NB. (+/) = sum
NB. ((1 & }.) , +/) t = ((1 & }.) t) , (+/ t)
NB. (^: y) = repeat y times
NB. 1 1 2 = first three elements of the tribonacci sequence
trib =. 3 : '{. ((1 & }. , +/) ^: y) 1 1 2'
NB. for each element in [diffs], replace it with a [1] if it is equal to 1,
NB. otherwise replace with 0. Effectively maps all 3s to 0s
values =. 1= / diffs
NB. see above. replace all 3s with 1s and 1s with 0s
partitions =. 3= / diffs
sums =. partitions +/ ;. 2 values
combinations =. trib each sums
answer =. */ > combinations
answer
)
NB. I give up on inlining the [trib] call. The best I got was [dyad_trib],
NB. which works like so:
NB.
NB. 4 dyad_trib 1 1 2 ==> 7 13 24
NB.
NB. However, the obvious next step to make it monadic, bonding it to the
NB. initial values [1 1 2], doesn't seem to work, and I can't find any
NB. literature on how to accomplish this.
dyad_trib =: (1 & }.) , +/ ^:
part_two_tacit =: 3 : '*/ > trib each ((3 & (=/)) +/ ;. 2 (1 & (=/))) (, & 3) 2 ({: - {.) \ (0 & ,) /:~ readtable < y'
30
73
84
136
132
117
65
161
49
68
139
46
21
127
109
153
163
160
18
22
131
146
62
113
172
150
171
98
93
130
170
59
1
110
2
55
37
44
148
102
40
28
35
43
56
169
33
5
141
83
15
105
142
36
116
11
45
82
10
17
159
140
12
108
29
72
121
52
91
166
88
97
118
99
124
149
16
9
143
104
57
79
123
58
96
24
162
23
92
69
147
156
25
133
34
8
85
76
103
122