aoc23/08/input.pl
2023-12-08 17:10:35 -08:00

802 lines
13 KiB
Prolog

:- op(700, xfx, to).
direction("lrlrrrlrrrlllrlrrllrlrrrlrlrrrlrlrrrlrlrrrlrrrlrllrrrlrlrlrrlrrlrlrrlrrlrrllrrrlrrrlrrlrrlrrlrrrllrrlrlrrlrlrrlrrlrlrrlrrllrlrrrlrrlrrrllrlrlrllrllrllrlrrllrrlrlrlrrlrllrrrllrrrlrrllrrrlrrrlrlrrrllrrrlrlrrrlllrrrlrlrlrrrlrrrlrrrlrlrrlllrrlrrrllrlrrrlrlrlllrrlrlrrrlrlrrrr").
gnk to lbv-qnp.
pjq to ghf-fjf.
klm to ttr-bql.
ldt to fxs-fbb.
tkh to nbh-jrn.
qnd to kjc-srd.
sng to bqp-lxn.
gms to jdn-nkm.
ntl to pts-dhk.
nbn to ffd-prl.
ncp to qkb-hmr.
nqt to rdk-bhc.
tdk to ghm-ghm.
bjs to tgc-gbj.
xnh to ggj-tkl.
nkv to gtc-ncp.
hfl to lqq-rvt.
hkc to bqm-nkp.
kch to gjg-gjg.
mfd to crd-vdp.
fnz to xsm-pqq.
nvt to tdn-jvt.
pcq to hld-bkq.
gpf to mnj-ngp.
pcx to lpd-bjk.
ccg to tts-tts.
bgg to tqp-nfg.
hsp to dvs-qqm.
tsx to gbv-kxm.
rkk to bnc-fnz.
hvj to rpd-mgb.
cxc to btd-vdn.
nbh to sqq-pjb.
cqn to srv-mcf.
lpd to ppr-rhs.
bkm to fjv-xtv.
kqv to pck-dxj.
vcl to pdn-mtc.
jvs to qqp-bdm.
mjt to jcx-nrr.
vsr to nqt-kng.
nkm to hnf-bfd.
hgj to bnt-kfk.
vmc to qnd-rkc.
djg to prd-lbd.
jct to nfm-njf.
fpx to njf-nfm.
hpd to snt-jxr.
qlk to kxv-klf.
hmr to tdk-cxj.
rql to qdp-gbq.
vdt to bgp-mxh.
pfv to tnh-lqv.
ttf to flv-skm.
qkl to jnb-skx.
rxc to qfp-vmv.
ngj to qpn-gsf.
mpz to jvh-bnb.
fpb to xnh-nms.
lqp to sng-vvm.
hqf to mnm-vhl.
xxj to prl-ffd.
kph to ttf-snq.
jdt to kch-jmc.
krk to pcx-bmg.
fjv to qlk-qsn.
mpg to ljg-pkd.
tch to rrq-qtl.
sds to jqr-bxr.
rkr to kvd-ngn.
tvj to xgs-pcq.
vsq to nhp-qqs.
rdk to xtd-mhb.
sgp to prp-xjd.
svn to bkm-nsv.
sjc to dgl-frh.
njx to trn-mhn.
rcg to bsn-dqr.
hxj to kdl-srr.
bqz to pql-frm.
nks to shm-shm.
fpj to stm-ctn.
sfm to pvc-tgm.
vss to mgv-jls.
dgl to nbb-bst.
xrq to lpn-mkf.
rsz to svm-xmg.
ttk to kst-mgq.
fjf to crc-rxf.
cmt to hph-kpl.
sdr to ltd-tvk.
bst to kqv-qph.
dgt to bcq-mlx.
qpn to mmd-lkl.
shm to frm-pql.
xdd to qcs-vmd.
snq to flv-skm.
tlf to qtc-grk.
cpb to dfx-gdn.
brj to ldr-cdr.
jnl to jtd-smv.
ftg to vrn-vrn.
gbj to vgh-djt.
tgs to fpb-qgt.
mhb to dkl-kmx.
gnh to sfq-jxk.
ltd to xjq-mbl.
pcr to jdd-ktl.
dmd to khc-kvh.
ftt to ltb-bld.
lmt to rkc-qnd.
jgt to fdt-vdd.
mdv to xts-mrf.
plv to kxc-cnm.
prj to shc-mnl.
pml to grx-qgj.
vvm to lxn-bqp.
ngn to gbg-xjx.
vcg to srv-mcf.
qfp to tjs-xpd.
lvx to fpx-jct.
rbc to drm-vhc.
xkt to ccg-flm.
sdh to bnf-gkn.
bvq to qsh-vsq.
smv to skn-hhj.
dbd to rsm-pkb.
dqr to hvs-dvc.
mnk to dxt-cld.
ffd to dlf-jpq.
gbg to tkp-kpm.
chk to mmt-mqc.
bxr to gmv-bgt.
sfd to xsp-sds.
prt to hdb-rcg.
qxj to qqt-bhg.
tgr to tqd-tjm.
gjg to rvq-tvj.
bfd to sgs-nch.
pnd to bpl-tkv.
jpg to gnq-qkp.
fdt to npf-sff.
dlx to xvp-bnr.
snt to qfr-rmt.
dnd to tvk-ltd.
ssf to llf-frv.
drk to ftg-lbt.
vqv to jvs-rrh.
xbv to dsc-nrl.
cvl to krf-njx.
xgp to bqj-rxc.
mlx to tbd-qsg.
jdf to ccg-ccg.
gvn to scn-pkh.
ncb to gkn-bnf.
llf to pnd-lmm.
shx to txm-prj.
knl to ksl-vqq.
jsk to sqd-mpg.
pps to khc-kvh.
nkj to dbd-rfb.
cnm to fcb-dhp.
txj to dbj-dlx.
qsh to qqs-nhp.
brc to pln-gms.
bhp to jnh-clp.
bql to sdr-dnd.
tgc to vgh-djt.
mhm to vhv-hfp.
ngp to hnn-hdx.
skm to sxh-ptr.
tfn to smk-gxl.
nsr to glb-pch.
rhs to xcx-rfh.
bnc to pqq-xsm.
xjx to kpm-tkp.
lft to tmh-ssp.
kvd to xjx-gbg.
skx to ngf-ntc.
ckq to fcl-mrm.
mtc to pbm-tgr.
rhv to tgs-kdv.
mmd to vmj-tfn.
psm to xdk-gsg.
kxm to rdn-xps.
pln to nkm-jdn.
hdk to skx-jnb.
xgs to hld-bkq.
fmb to phl-tfg.
lhh to xrf-stp.
ltb to tdc-bcx.
frv to lmm-pnd.
grk to fdh-cqd.
nrr to hns-kbj.
bgt to ldt-vbj.
srd to cbg-dmm.
knf to dvl-knl.
kxc to fcb-dhp.
ghb to nnj-qmh.
pgq to jjx-vsf.
skb to xxt-ntm.
lxp to prd-lbd.
prl to jpq-dlf.
frm to lbn-cpb.
ksl to fpt-ttc.
crc to rcl-hqf.
svm to bjs-xkd.
pxb to pmc-hpd.
jpq to mkj-mkc.
ttr to dnd-sdr.
cbh to ftd-jjq.
xps to nsp-lss.
kmx to qsl-sjc.
cld to mdp-ckq.
gxv to mkk-dbb.
bqp to tqh-lkn.
ftb to gjq-gxv.
kpl to drr-rsz.
mkf to sdh-ncb.
ssp to cbn-xcf.
xjq to nnd-tpt.
ntt to ndj-qfb.
plf to nbh-jrn.
xdk to gpf-fsg.
ntc to dgt-xrb.
sgj to qmh-nnj.
tnh to vgb-fdr.
dfx to hfc-ktx.
dbj to xvp-bnr.
vdd to sff-npf.
jkl to frt-cvl.
xsp to bxr-jqr.
dbp to psr-ljs.
khc to mjt-ktp.
tkp to vrx-gvn.
dkl to sjc-qsl.
dlp to xxj-nbn.
kln to hrp-jpm.
tpp to nhj-pcr.
qvf to qnp-lbv.
vmd to ctf-sfm.
nfm to qkl-hdk.
mcf to bjv-jxl.
pqg to xtq-qmc.
bgp to hft-ktd.
pts to ddg-rbc.
jls to shl-vpt.
dht to npc-krp.
tjm to khm-bxb.
trh to ndj-qfb.
ctf to pvc-tgm.
pmj to bhp-tdf.
aaa to mpf-vmm.
xcf to lvx-fnt.
frh to bst-nbb.
qll to hdb-rcg.
xvp to qhd-pml.
bnx to tlq-tsx.
bxb to jsj-kdq.
fpt to lbc-vjf.
fcb to tjk-mjd.
kng to rdk-bhc.
dbb to rfx-flk.
lqq to rtp-hgj.
lbt to vrn-rlt.
xkd to gbj-tgc.
lkn to xdd-cpc.
xhm to cnm-kxc.
dtc to qqt-bhg.
bpl to dms-gqc.
qpp to mrf-xts.
prk to nkp-bqm.
mgs to mpg-sqd.
stm to mts-ghd.
skd to mgv-jls.
qph to dxj-pck.
hdb to dqr-bsn.
dsc to vxm-chk.
tqf to gjt-fnj.
fxs to ghq-bvq.
sff to hkc-prk.
drr to xmg-svm.
rkp to xxn-ldq.
nnj to klg-hfl.
vjf to hmj-rdc.
lxn to tqh-lkn.
cxj to ghm-cmt.
hmc to gms-pln.
ljs to jdf-xkt.
xch to ttr-bql.
lkg to qxj-dtc.
qfb to mht-cfl.
rdn to lss-nsp.
dhs to shm-bqz.
nkt to gsg-xdk.
mch to htp-blc.
nvx to mgs-jsk.
qtc to fdh-fdh.
nnd to dgp-lbf.
gjv to xhm-plv.
gsg to fsg-gpf.
bnv to stm-ctn.
ldq to mch-gxs.
mhn to kph-pkc.
lbf to pps-dmd.
qdp to nkv-hsq.
mpf to mnk-lth.
dhq to cdr-ldr.
vmm to mnk-lth.
hft to brc-hmc.
ltr to nkt-psm.
hdx to gjc-ftt.
ghf to rxf-crc.
bkq to ftb-hjh.
bxx to njc-npk.
fvp to brg-ntj.
rdc to lht-vmg.
jkt to qpp-mdv.
pvp to ghb-sgj.
xxn to gxs-mch.
shc to gnh-pcj.
gsf to lkl-mmd.
krp to mgl-vgq.
jxk to tgn-tjp.
mgq to xrq-vbn.
fln to mgb-rpd.
dhp to mjd-tjk.
sqq to dvp-vcd.
hfh to cbh-jmm.
mbp to ndf-tfk.
klg to rvt-lqq.
npf to prk-hkc.
nms to ggj-tkl.
qqp to cgm-tch.
sfg to nvg-nsr.
rvq to xgs-pcq.
sqd to pkd-ljg.
jcx to hns-kbj.
qsn to kxv-klf.
glx to nkt-psm.
tjs to gjv-mpk.
qlj to xjd-prp.
nsv to fjv-xtv.
gxx to rfb-dbd.
hsr to brg-ntj.
hbf to cdc-nxl.
xss to psr-ljs.
qtl to tqf-hqm.
tkl to dnf-pvp.
brk to jkq-jkk.
scn to mfc-pmj.
gmv to vbj-ldt.
hns to lmt-vmc.
rgr to ntt-trh.
pnc to kch-kch.
xnk to jnl-qfh.
rrr to pqt-ngr.
tdn to kbc-ttk.
nqn to khn-ssf.
hmk to rrh-jvs.
rfb to pkb-rsm.
sfq to tgn-tjp.
jkq to svn-bdb.
ctn to mts-ghd.
qnt to tqp-nfg.
vhl to jjp-hbf.
rfh to plf-tkh.
ktd to brc-hmc.
vrx to scn-pkh.
bnt to jkl-jcl.
mdn to dlc-brk.
cbg to sks-pjq.
qfh to jtd-smv.
hvs to xgp-ccx.
nqh to bkx-vsr.
gqq to mbv-hmn.
lsn to ntm-xxt.
flq to rrr-qlt.
lxm to prt-qll.
hjh to gxv-gjq.
srv to jxl-bjv.
tmh to xcf-cbn.
prb to ktv-ndd.
jjq to qhq-qdb.
ksv to ntt-trh.
xkh to vjs-jgt.
sjp to qnt-bgg.
ntr to bnc-bnc.
pbm to tjm-tqd.
rpd to dvg-prb.
xpd to mpk-gjv.
nch to gkg-ngj.
ktp to jcx-nrr.
gqc to qnr-pfv.
mkc to vlf-sfd.
ntm to fbf-xnk.
tvk to mbl-xjq.
rmt to xkv-rhc.
nhp to dpm-mhm.
jnb to ngf-ntc.
rtp to bnt-kfk.
gjt to tkr-gpl.
tts to vfm-vfm.
flk to bnv-fpj.
cjj to qvf-gnk.
qkp to fbg-tpp.
xqt to jvt-tdn.
jvh to xkx-jkm.
ndj to cfl-mht.
jxx to brk-dlc.
xjd to smn-lkg.
jxl to kvb-rhv.
vmg to kkm-jkt.
fbg to nhj-pcr.
lkl to vmj-tfn.
nxl to xss-dbp.
src to ftg-lbt.
pdc to cqn-vcg.
bld to tdc-bcx.
nhj to ktl-jdd.
dgc to vfm-zzz.
ltx to qtc-grk.
ccx to bqj-rxc.
drm to dgb-pgx.
vqq to ttc-fpt.
bhc to xtd-mhb.
cdc to dbp-xss.
sxh to pnc-pnc.
kbc to kst-mgq.
dxt to ckq-mdp.
prp to smn-lkg.
sgs to ngj-gkg.
vbn to lpn-mkf.
bnf to kgk-pgk.
hld to ftb-hjh.
fgt to tcg-ntl.
vbt to dvs-qqm.
xvt to qll-prt.
sbh to bnb-jvh.
vgb to vss-skd.
xjj to cxc-pkx.
jkk to bdb-svn.
bsn to hvs-dvc.
dbx to qsr-hxj.
qsg to khj-vmp.
cpk to crd-vdp.
jgd to jmm-cbh.
vgh to cqm-dlp.
gbq to hsq-nkv.
grx to lsn-skb.
flm to tts-dgc.
ppr to xcx-rfh.
vdp to hvv-vdb.
gkn to pgk-kgk.
xda to bnb-jvh.
mnl to pcj-gnh.
mgb to prb-dvg.
fbb to bvq-ghq.
ntj to lxp-djg.
pqq to nvt-xqt.
tqp to tvg-fmv.
lqk to bpc-hsx.
mtg to tsm-pxb.
vsf to lxm-xvt.
hjb to bmg-pcx.
vmj to gxl-smk.
cxb to qlf-sjp.
hcp to ssf-khn.
qlh to hsx-bpc.
nfg to tvg-fmv.
pkb to lhh-hkj.
brg to djg-lxp.
tlq to kxm-gbv.
ddg to drm-vhc.
bqm to nvx-klt.
ktx to ljp-dvh.
xts to dhq-brj.
tfg to vqv-hmk.
jcd to vsf-jjx.
vfm to mpf-vmm.
lgj to njc-njc.
pqb to bgp-mxh.
cbn to lvx-fnt.
fcl to nqh-txn.
jnh to rkp-qdf.
lht to jkt-kkm.
mjd to pdc-prv.
qgt to xnh-nms.
kst to xrq-vbn.
kdv to fpb-qgt.
hfp to nnk-mbp.
bjk to ppr-rhs.
xxm to mfd-cpk.
qlt to pqt-ngr.
hmj to lht-vmg.
xdr to tcg-ntl.
nnk to tfk-ndf.
vjc to nsr-nvg.
mmm to qlf-sjp.
bnb to xkx-jkm.
ljg to vjc-sfg.
qqt to srf-xxm.
jpm to hsr-fvp.
gnq to fbg-tpp.
pjb to vcd-dvp.
nkp to klt-nvx.
gjc to ltb-bld.
mrf to dhq-brj.
srf to cpk-mfd.
fss to vxj-dhg.
xxz to tvj-rvq.
ndd to rgn-lsj.
tqd to khm-bxb.
xjb to pxb-tsm.
lsj to xch-klm.
jbj to jgd-hfh.
dms to qnr-pfv.
dlf to mkc-mkj.
hnn to ftt-gjc.
vxm to mqc-mmt.
lmm to tkv-bpl.
bmg to bjk-lpd.
qgj to lsn-skb.
frt to njx-krf.
skn to dht-dbm.
lbd to jxx-mdn.
kfk to jkl-jcl.
rrh to bdm-qqp.
nrl to chk-vxm.
lcx to vjs-jgt.
cnr to gbq-qdp.
tgn to pqb-vdt.
grt to dbj-dlx.
fdh to ntr-ntr.
crd to vdb-hvv.
dmm to pjq-sks.
vhc to pgx-dgb.
ftd to qdb-qhq.
npc to mgl-vgq.
prv to vcg-cqn.
tsm to pmc-hpd.
cqm to xxj-nbn.
bnr to pml-qhd.
nsp to cbr-gqq.
tjk to prv-pdc.
mst to knl-dvl.
vmp to jff-pqg.
tdf to jnh-clp.
mqc to hvj-fln.
vpt to bnx-jcc.
gkp to phl-tfg.
jjx to xvt-lxm.
mmt to fln-hvj.
crp to hfh-jgd.
dbm to krp-npc.
lqv to vgb-fdr.
xrf to gfv-phk.
rrq to tqf-hqm.
rxf to rcl-hqf.
jrn to pjb-sqq.
jtd to skn-hhj.
htp to jtr-vcl.
jmm to ftd-jjq.
mbl to nnd-tpt.
rcl to mnm-vhl.
lgs to qvf-gnk.
csc to cnr-rql.
mfc to bhp-tdf.
hsx to hsp-vbt.
gbv to rdn-xps.
vxj to qhv-lqp.
jkm to xjj-gmc.
mts to krk-hjb.
qdb to drk-src.
ggj to dnf-pvp.
xxt to xnk-fbf.
xsm to xqt-nvt.
qqm to xjb-mtg.
kdq to qlh-lqk.
hnb to tmh-ssp.
frj to vxj-dhg.
pql to lbn-cpb.
sks to ghf-fjf.
dlc to jkq-jkk.
jmc to gjg-xxz.
stp to gfv-phk.
qnp to lcx-xkh.
klf to cjj-lgs.
xsa to pqq-xsm.
ktv to rgn-lsj.
fdr to skd-vss.
pch to grt-txj.
ktl to xdr-fgt.
lbb to nrl-dsc.
xkv to jbj-crp.
khj to jff-pqg.
ngf to xrb-dgt.
dvh to qlj-sgp.
mrm to txn-nqh.
tgm to lgj-bxx.
mkk to rfx-flk.
rlt to fbh-lgl.
gxs to htp-blc.
xkx to gmc-xjj.
vmv to xpd-tjs.
mgl to ltx-tlf.
njc to nks-nks.
clp to qdf-rkp.
smk to nkj-gxx.
kpm to gvn-vrx.
bcq to tbd-qsg.
tpt to lbf-dgp.
cfa to frm-pql.
kvb to tgs-kdv.
bdm to cgm-tch.
jjp to cdc-nxl.
pmc to jxr-snt.
pgx to hcp-nqn.
lbc to rdc-hmj.
mbv to dbx-ddq.
kxv to lgs-cjj.
djt to dlp-cqm.
ldr to lft-hnb.
gxl to nkj-gxx.
smn to qxj-dtc.
dcj to gkp-fmb.
gdn to ktx-hfc.
kgk to phn-kln.
vbj to fbb-fxs.
ddq to qsr-hxj.
kjc to cbg-dmm.
blc to vcl-jtr.
qnr to lqv-tnh.
krf to trn-mhn.
jff to qmc-xtq.
mpk to plv-xhm.
pkc to ttf-snq.
vrn to fbh-fbh.
dvl to vqq-ksl.
xtd to kmx-dkl.
vdb to mxn-jpg.
fmv to rgr-ksv.
hmn to ddq-dbx.
trn to pkc-kph.
gkg to qpn-gsf.
mdp to mrm-fcl.
dhg to qhv-lqp.
bdb to nsv-bkm.
hph to drr-drr.
bkx to kng-nqt.
kvh to ktp-mjt.
vdn to glx-ltr.
tfk to cxb-mmm.
cqd to ntr-rkk.
hhj to dbm-dht.
vhv to nnk-mbp.
fbf to jnl-qfh.
pkx to btd-vdn.
phk to xbv-lbb.
qmh to klg-hfl.
shl to jcc-bnx.
fnt to jct-fpx.
hnf to nch-sgs.
lbv to lcx-xkh.
mkj to sfd-vlf.
ccl to rrr-qlt.
rsm to hkj-lhh.
hfc to ljp-dvh.
mxh to ktd-hft.
pvc to lgj-bxx.
mnj to hnn-hdx.
dhk to ddg-rbc.
jcl to frt-cvl.
fsg to ngp-mnj.
phl to hmk-vqv.
gfv to xbv-lbb.
txn to bkx-vsr.
gjq to dbb-mkk.
xcx to tkh-plf.
mht to knf-mst.
kdl to frj-fss.
mnm to jjp-hbf.
xmg to bjs-xkd.
qhq to drk-src.
dvc to ccx-xgp.
qqs to mhm-dpm.
tvg to ksv-rgr.
cgm to qtl-rrq.
qfr to rhc-xkv.
vlf to xsp-sds.
dnf to ghb-sgj.
qhv to sng-vvm.
rvt to hgj-rtp.
rgn to xch-klm.
qmc to flq-ccl.
tjp to vdt-pqb.
qkb to tdk-cxj.
snd to gkp-fmb.
cpc to qcs-vmd.
khn to llf-frv.
qlf to bgg-qnt.
vjs to fdt-vdd.
fnj to gpl-tkr.
mxn to gnq-qkp.
bqj to vmv-qfp.
npk to nks-dhs.
hja to xmg-svm.
hqm to fnj-gjt.
dvp to dcj-snd.
bcx to rkr-nth.
bhg to xxm-srf.
hsq to gtc-ncp.
txm to mnl-shc.
pqt to csc-xgc.
njf to qkl-hdk.
mgv to vpt-shl.
tkr to pgq-jcd.
lgl to sbh-mpz.
phn to hrp-jpm.
lbn to gdn-dfx.
jcc to tsx-tlq.
dxj to shx-chb.
khm to kdq-jsj.
xrb to bcq-mlx.
pcj to sfq-jxk.
dvs to xjb-mtg.
pck to chb-shx.
ttc to vjf-lbc.
pkd to vjc-sfg.
ghm to hph-hph.
chb to prj-txm.
qsr to kdl-srr.
tcg to dhk-pts.
ngr to csc-xgc.
vgq to ltx-tlf.
jqr to gmv-bgt.
tqh to cpc-xdd.
kkm to mdv-qpp.
lss to cbr-gqq.
dvg to ktv-ndd.
tbd to khj-vmp.
prd to mdn-jxx.
gpl to pgq-jcd.
tkv to gqc-dms.
rkc to srd-kjc.
qsl to dgl-frh.
jxr to rmt-qfr.
cfl to mst-knf.
bjv to rhv-kvb.
psr to jdf-xkt.
hpa to rvq-tvj.
qdf to ldq-xxn.
glb to grt-txj.
bpc to hsp-vbt.
flv to sxh-ptr.
jtr to mtc-pdn.
qcs to ctf-sfm.
srr to fss-frj.
dpm to hfp-vhv.
pdn to pbm-tgr.
vcd to dcj-snd.
kbj to lmt-vmc.
rhc to crp-jbj.
dgp to dmd-pps.
hvv to mxn-jpg.
lth to dxt-cld.
xtv to qsn-qlk.
cbr to mbv-hmn.
cdr to hnb-lft.
ghq to vsq-qsh.
tdc to nth-rkr.
xtq to flq-ccl.
gmc to cxc-pkx.
pgk to phn-kln.
nth to ngn-kvd.
pkh to pmj-mfc.
jdn to hnf-bfd.
fbh to sbh-sbh.
jdd to fgt-xdr.
hkj to xrf-stp.
klt to mgs-jsk.
ghd to hjb-krk.
hrp to fvp-hsr.
ptr to pnc-jdt.
ljp to sgp-qlj.
jvt to ttk-kbc.
zzz to vmm-mpf.
btd to glx-ltr.
gtc to qkb-hmr.
ndf to cxb-mmm.
dgb to nqn-hcp.
jsj to qlh-lqk.
nbb to kqv-qph.
xgc to rql-cnr.
qhd to grx-qgj.
rfx to fpj-bnv.
lpn to ncb-sdh.
nvg to pch-glb.