summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <daniel.silverstone@codethink.co.uk>2015-12-18 18:01:10 +0000
committerDaniel Silverstone <daniel.silverstone@codethink.co.uk>2015-12-18 18:01:10 +0000
commit80c7033c78eb3405b60db994926ff176909a767f (patch)
tree8cb3e45e2ce7dd830d4c8288b31dde5c8e2b4036
downloadaoc-80c7033c78eb3405b60db994926ff176909a767f.tar.bz2
Advent of code2015
-rw-r--r--advent-day-1.input1
-rw-r--r--advent-day-10.input1
-rw-r--r--advent-day-11.input1
-rw-r--r--advent-day-12.input1
-rw-r--r--advent-day-13.input56
-rw-r--r--advent-day-14.input9
-rw-r--r--advent-day-15.input4
-rw-r--r--advent-day-16.input500
-rw-r--r--advent-day-17.input20
-rw-r--r--advent-day-18.input100
-rw-r--r--advent-day-2.input1000
-rw-r--r--advent-day-3.input1
-rw-r--r--advent-day-4.input1
-rw-r--r--advent-day-5.input1000
-rw-r--r--advent-day-6.input300
-rw-r--r--advent-day-7.input339
-rw-r--r--advent-day-8.input300
-rw-r--r--advent-day-9.input28
-rw-r--r--advent.hs888
19 files changed, 4550 insertions, 0 deletions
diff --git a/advent-day-1.input b/advent-day-1.input
new file mode 100644
index 0000000..21497dc
--- /dev/null
+++ b/advent-day-1.input
@@ -0,0 +1 @@
+(((())))()((((((((())()(()))(()((((()(()(((()((()((()(()()()()()))(((()(()((((((((((())(()()((())()(((())))()(()(()((()(()))(()()()()((()((()(((()()(((((((()()())()((((()()(((((()(())()(())((())()()))()(((((((())(()())(()(((())(()))((())))(()((()())))()())((((())))(()(((((()(())(((()()((()((()((((((((((())(()())))))()))())()()((((()()()()()()((((((())())(((()())()((()()(((()()()))(((((()))(((()(()()()(()(()(((())()))(()(((()((())()(()())())))((()()()(()()(((()))(((()((((()(((((()()(()())((()())())(()((((((()(()()))((((()))))())((())()()((()(()))))((((((((()))(()()(((())())(())()((()()()()((()((()((()()(((())))(()((())()((((((((()((()(()()(((())())())))(())())))()((((()))))))())))()()))()())((()())()((()()()))(()()(((()(())((((())())((((((((()()()()())))()()()((((()()))))))()((((()(((()))(()()())))((()()(((()))()()())())(((())((()()(())()()()(((())))))()())((()))()))((())()()())()())()()(()))())))())()))(())((()(())))(()(())(()))))(()(())())(()(())(()(()))))((()())()))()((((()()))))())))()()())((())()((()()()))()(((()(()))))(())()()))(((()())))))))))(((())))()))())()))))()()(((())))))))()(()()(()))((()))))((())))((()((())))())))()()(()))())()(()((()())(()(()()())())(()()))()))))(()())()()))()()()()))(()(()(()))))))()(()))()))()()(()((())(()(())))()(((())(())())))))()(()(()))))()))(()()()(())()(()(())))()))))()()(((((())))))())()())())())()())()))))()))))))))())()()()()()()())))()))((())()))())))()((())()))))()))())))))))())()()()))()()(()((((()(((((((()(())((()())((()()))()))))(())))()()()(())((())()())))(())))(())))(((()()))()(())(((()(()))((())))())()))((((()))())()))))))))()(())())))(()))()(()()))())()()(())())))())()()(()())))()((()())(()(())(())))))))))))))(()))))()))))))()()())(()(((((()(()())))())()))(()))()))(()()))()())(()))())()(())((()()))))))())))())()(((())))(()(()))()()))()(()))))))((()())(()))))))()())))()()))))))))((((((((()()()(()))))))()())))())))()()((())()))((())(())))())())))()()()((()((()(())))())()(())))))))))()())))()()()()()()))()))((())())(()(()))))))(()()))()))(())))()))))))))))))(()))))))))()))))()))()())()))()()))))))()))))((()))))(()))())()(())))(()())((((()())))()))))(()))()(()()(())))))())))))()))))))())))())))))())))())())))())(()))))(())()(())))())()))((()()))))))())))((())))))))())))(())))))()()())))))())))))()))))))()))()()()(()(((()())())())(()))())))))((()(())(()))))))))(())))()()()())())(()))))()()()))()))())())())()(())))()(((()((((())))))))()))))))))))))))))))))((())()())(()))))()()))))))(()()(())())))())))((())))((())))))))))))))()))))()(()))))))())))))()))(()()())(()())))))))))()))))))(())))))()()))()())(((())))()))(()))))))))(())())))())))())())())()()))((())()(())()())()))()())(())(()))))()())))(()(((()))))))()(()())()()()))()))))))))()()()(())()())()(((((()))()())())(()))))()()()(())))())))()((()())))(()))())()(()())())(()))()()))((()()))((()()()()())))(())()))(()(())))((()()))))))))())))))))())()()))))))))))))))))(())()(())(())()())())()))()(()))))())())))))()())()(()))()()(())))(())())))))(()))))))))))))))())())(())(())))(((()))()))))())((())(()))())))))))())))))())))()))()))))))))))))())()))))()))))((()))(())))()(())))(())()))()))())))())))))))()(()())())))()()())))(())))))(()))))))))))))(()))()))()))())))(((()()()(())((()())))()())(((()))(())()))((()()()())))())(())(()))))()(((((())))(()))())())))))))((((()()()))())())()(()(()())))))))))()())())))(())))()())(((()(())())()()))())())))))))((()())((()()(()))(()(())))()))()))(()))(()))()()(()(((())((((()))()(()))((())()(()(()())()(()))()())))))(()))()))())()())))())))(())))((())(()())))))()))(())(()))()())()(()()((()(()))))))()(())(()())(())()))(((())()))(()()(()()()))))(()(())))()))))())))))())(()()()()()()(((())))(()()))()((())(((((()()())))(()))(()))()()))(((())())()(((()()()()))))(()))(())())))()())(()()())())))))))()))))((())))()())(()))(()(()))())))))())(())))))()()())())()))()()(())))(()))(())((((((())(()))(()))())()))(()()(())))()))(()()))()))()(())))(())))((()(()))(())()()())())))(((()()())(())()))))))()(((()(((((()()(((())(())))())()((()))))((()())()(())(((())))(((()((()(()(()))(()()))())(()))(())(())))()))))))((((()))()((((()(()))()))()()))))()(()(()))()(()((()(((()(()()(((()))))()(((()(()(()(((()(()())())()()(()(()())())(()((((())(()))()))(((((()()())(())()((()()())))()()(((()()))()((((((((()(())))())((()))))(())))(()))))((()((((()()(())(((((()))(((((((((((((()())))((((()(((()((())())()))((()))()(()()((()()()()(()()(()(()(((())()(()((((((()((()()((())()((((()((()()(()()())((()()()((()((())()(()(((()((())((((())(()))((()(()))(()())()((((((((()(((((((((((()))(()(((()(()()()((((())((())()())()))(())((())(()))(((()((()(())))(()))))((()()))))((((()(()(()())(()(())((((((((()((((()((()(((((()))())()(()))(()()((()(())(((((()(())()(((((()()))))))()(((())()(()()((((())()((())((()(((())(((()))((()()((((()(())))))((()((((()((()((()(((())((()))(((((((()(((()((((((((())()))((((())(((((()((((((((()(((()((()(((()()(((()((((((()()(()((((((((()()(()(()(())((((()())()))))(((()))((((())((((()())((()(())()((()((((((()((((((()(())))()())(((())())())()(())()(()())((()()((((())((((((())(()(((((()((((())()((((()(()(())(()())(((())()((())((((()))()((((((())(()(((()(((()((((((()(((()))(()()())())((()((()())()((((())(((()(()(((((((((())(())))()((()()()()(())((()))(((((((()(((((((((()(()))))(()((((((((()((((()((()()((((((()()(((((((()(()(())()(())((()()()((()(((((()())()(((((()())()()((()(()())(()()()(((()()(((((()((((((()()((()(()()()((((((((((((()((((((((()()(((()())))()(((()()(())())((((()((((()((((()()()(())(())((()(()(((((((((((((((()(())(())))))()()))((()(((()(())((()(((()(()()((((()()(((()(((()(((((()()((()(()(((()))((((((()((((((((()((()((())(((((()(((())(())())((()()))((((())()()((()(((()(((((()()(((()))(((()(()(((((((((((((()))((((((((()(((()))))())((((((((((((())((())((()())(((())((())(()((((((((((()(((())((()()(()((())(((((((((((()))((((((((((((()(()())((()((()((()(()(((()((((((((()()(()((()(()(((()))((()))(((((((((((((()(())((((((())(((()(())(()(()(()((()()))((((()((((()((((())))())((((()((((()))((((((()((((((()((()(((())))((())(()))(()((()((((()((()(((()()))((((()()()(((((((())(((())(()))())((((()())(((()(((((((((((()(()(()((()(((((((((((((((()()((((()((((((((()(((()()((()((((()))(((()(())((((((()((((())()((((()((()))(())()(()(((()((())())((((((()(()(())())(((())(()(()())(((((()((()((())()())(())))(((()(())))))))(((()(((()))()((()(((()()((()())()()))())))(((()))(()(((()(((((((((()(()(((((()()(((()())()()))))()(((()))(((()(()(()(()(()))()(())()))(()(((())))(()))))))))))(())((()((())((()(())()(())((()()((((()()((()()))((())(((()((()(())(())))()(()(((((()((()))())()(((((()()(((()(()((((((())(()))(())()))((()(()()))(())())()))(((())))(()((()(((())(())())))((()()((((((((((((((()((()(()()(()(((()))())()()((()()()(())(()))(()())(((())((())()(())()()(()()(())))((()(((()))))(((()()(()()))())((()((())()))((((()()()())((())))(((()(())(((((()(((((()((()(()((((()()(((()()()(((()())(((()()((((())(()))(((()))(())())((()))(((()((()))(((()()((())((()(((((()((((()()())((()))()((((()((()(()()()(
diff --git a/advent-day-10.input b/advent-day-10.input
new file mode 100644
index 0000000..067b0ee
--- /dev/null
+++ b/advent-day-10.input
@@ -0,0 +1 @@
+1321131112
diff --git a/advent-day-11.input b/advent-day-11.input
new file mode 100644
index 0000000..5915be7
--- /dev/null
+++ b/advent-day-11.input
@@ -0,0 +1 @@
+cqjxjnds
diff --git a/advent-day-12.input b/advent-day-12.input
new file mode 100644
index 0000000..ccdd55b
--- /dev/null
+++ b/advent-day-12.input
@@ -0,0 +1 @@
+{"e":[[{"e":86,"c":23,"a":{"a":[120,169,"green","red","orange"],"b":"red"},"g":"yellow","b":["yellow"],"d":"red","f":-19},{"e":-47,"a":[2],"d":{"a":"violet"},"c":"green","h":"orange","b":{"e":59,"a":"yellow","d":"green","c":47,"h":"red","b":"blue","g":"orange","f":["violet",43,168,78]},"g":"orange","f":[{"e":[82,-41,2,"red","violet","orange","yellow"],"c":"green","a":77,"g":"orange","b":147,"d":49,"f":"blue"},-1,142,136,["green","red",166,-21],"blue","orange",{"a":38}]},"orange","yellow"],"green",-22,[37,[4,-40,["red","yellow",["yellow",177,"red","blue",139,[55,13,"yellow","violet",-21,140,"yellow",117],"blue","blue",106],"blue",{"a":23}],183,92,"orange","green"],"orange"],-5],"c":[{"e":{"e":-13,"c":-11,"a":{"a":49,"b":189},"g":144,"b":186,"d":{"e":[146,[32,"violet","red","orange",-22],"blue","violet",57,{"e":12,"a":"red","d":37,"c":-13,"h":"green","b":-27,"g":"orange","f":"orange","i":"red"},56,-1,"red",-25],"c":-14,"a":[["orange","green","green","red",-25],-16,104,177,"red"],"g":"red","b":"blue","d":2,"f":"green"},"f":[{"e":{"c":-15,"a":"green","b":144,"d":-32},"c":"yellow","a":["blue","blue"],"b":"yellow","d":135,"f":"violet"}]},"a":{"e":"blue","a":[145,128,"orange","violet",23,["orange",[78,"yellow","orange","orange","orange","green",122,-35,"blue"],159,114]],"d":"yellow","c":{"e":[100,"green",{"e":"blue","a":36,"d":84,"j":"orange","c":"blue","h":118,"b":85,"g":"violet","f":"blue","i":27},"blue","blue"],"a":"red","d":"blue","j":[159,22,"violet","orange","blue","orange","blue",186,175,{"e":29,"a":150,"d":"green","c":129,"h":138,"b":-29,"g":7,"f":"red","i":"violet"}],"c":"yellow","h":["blue",-9,41,{"e":144,"c":"violet","a":161,"b":116,"d":126,"f":197},173,123,50,"red",154],"b":-23,"g":"orange","f":"green","i":"red"},"h":26,"b":30,"g":106,"f":{"c":{"e":-28,"c":["red","violet","blue","orange","yellow","violet",-30,134,0],"a":-37,"b":41,"d":143},"a":121,"b":"yellow","d":[198,"yellow"]}},"d":{"e":-2,"a":"green","d":{"a":0,"b":"blue"},"j":"violet","c":[{"e":"violet","a":"orange","d":"violet","c":-36,"h":68,"b":195,"g":41,"f":63},11,-20,{"e":[100,43,183],"a":"yellow","d":["orange","yellow","violet","yellow",143,162,-23,168,145,-33],"j":80,"c":"orange","h":{"a":"orange"},"b":"violet","g":-21,"f":-38,"i":"green"},{"e":"red","a":81,"d":3,"c":"blue","h":[167,"blue","yellow",135,64,116,134,14,160],"b":"red","g":"blue","f":"green"},["red",[139,"orange","blue","blue","orange","blue"],"orange","red",113,26,"yellow","yellow",85]],"h":[[117],"yellow",{"e":187,"c":"orange","a":-22,"b":["orange"],"d":68},154,["green","orange","blue",87,"green","orange",46,"violet"],{"a":{"e":178,"c":"blue","a":-2,"g":99,"b":"orange","d":-34,"f":"green"}},"blue"],"b":"violet","g":[13,"yellow",43,"orange"],"f":{"e":-40,"a":"blue","d":50,"c":"violet","h":{"e":"orange","a":[-27,159,"violet","red",130,83,"red","violet",-27],"d":-42,"j":"blue","c":9,"h":{"e":"yellow","a":"blue","d":177,"c":156,"h":"violet","b":0,"g":"orange","f":-43,"i":"orange"},"b":"blue","g":[114,"blue",-4,"red","red","yellow","green"],"f":81,"i":"red"},"b":73,"g":176,"f":"red"},"i":{"e":["orange",-16,["violet",63,"blue",-40,119,22,"orange","orange","violet","green"],-30,{"e":"yellow","c":172,"a":"green","g":"yellow","b":"green","d":"yellow","f":"red"},190,28,{"e":"orange","c":"red","a":"orange","b":51,"d":-31,"f":136},"orange",82],"a":"blue","d":"red","c":["blue",81,"blue","blue","green",191,"blue","blue",1],"h":{"e":"orange","c":{"e":"blue","a":"green","d":55,"j":-36,"c":13,"h":"yellow","b":162,"g":82,"f":"red","i":"red"},"a":"violet","b":"yellow","d":-24,"f":190},"b":[{"e":"green","a":"green","d":-49,"j":"green","c":"orange","h":43,"b":"orange","g":35,"f":"violet","i":"blue"},"yellow",32,"yellow"],"g":"blue","f":0}},"c":"blue","h":69,"b":166,"g":[[88,["blue",21,"yellow","violet"]],["red",169],"red"],"f":176},{"e":["yellow",88,164,{"e":"red","c":"yellow","a":[20,"blue","violet"],"g":-31,"b":80,"d":"yellow","f":"green"},{"e":"orange","c":"green","a":149,"b":"orange","d":-46,"f":[160,83,"orange","red",177,-11]},"green",[156,"red",{"c":7,"a":[152,107,130],"b":{"c":"yellow","a":114,"b":38,"d":"blue"},"d":"orange"},{"a":49,"b":-34},34,-32,"green"]],"a":134,"d":-12,"c":[-33,{"e":102,"a":"red","d":{"e":"orange","a":"green","d":43,"c":"violet","h":{"a":"violet"},"b":-24,"g":"blue","f":"blue","i":[68,"blue"]},"j":-28,"c":87,"h":"violet","b":122,"g":"violet","f":"green","i":"violet"}],"h":"violet","b":["orange",-14,{"e":37,"a":86,"d":{"e":186,"a":-25,"d":71,"c":"orange","h":86,"b":113,"g":27,"f":"green","i":"yellow"},"c":16,"h":"orange","b":"green","g":["yellow","yellow",["orange","violet","violet","green",58,"orange"],["orange",131,"red","blue","orange",183,82,"orange","yellow","blue"],49,"orange","violet","violet","yellow","orange"],"f":"yellow"},[141,"violet","red",-24,18,103,88,169,75],["yellow",["green",55,92,"yellow","orange",135,{"e":"green","c":141,"a":-11,"b":129,"d":"orange","f":"green"},"violet"],14,[{"a":130},["red","violet",182,"blue",149,"orange",-25,"blue","blue"],61,-18,"orange",14,{"e":"red","a":135,"d":"yellow","j":"red","c":23,"h":89,"b":82,"g":"orange","f":"red","i":72},"red"],["red","blue","red",78,134,53,160],-20,98,{"e":[198,69,168,145,-29,"red","orange","orange","yellow"],"a":"violet","d":"green","j":184,"c":[7,99,186,"blue"],"h":10,"b":"blue","g":166,"f":"yellow","i":177}],"green",{"e":"red","a":"green","d":-8,"j":-47,"c":{"e":"orange","c":74,"a":"yellow","b":"orange","d":34,"f":124},"h":152,"b":"red","g":"yellow","f":161,"i":["blue","red","orange","orange","orange",-38,"orange","red"]},"yellow","blue",75],"g":[67,["orange",109,114,32,"green","green","yellow",["yellow","orange",-40,["green","orange","yellow",187,3,"yellow","violet","orange",195,"yellow"],"blue","yellow","blue"]],[32,{"c":43,"a":"red","b":"blue","d":25}],{"c":"red","a":24,"b":139},{"e":"orange","a":153,"d":43,"c":143,"h":["violet","yellow","green",159,165,{"a":"blue","b":"violet"}],"b":150,"g":["red","red","orange",[138,"green"]],"f":"green"},"violet",-12,"red",["violet","green"]],"f":{"e":{"e":39,"a":"orange","d":{"e":[11],"c":"violet","a":"orange","g":49,"b":"red","d":0,"f":{"a":45}},"c":"violet","h":-30,"b":[93,-1,"red",[39,"red","green"],"green",[154,"blue","orange",147,"orange","yellow"],106,["green",71,-9],-37],"g":"blue","f":"blue","i":176},"c":98,"a":164,"b":["violet","orange",[85,{"e":"yellow","a":113,"d":176,"c":"green","h":"violet","b":"orange","g":166,"f":"green","i":"green"},[145,"green",-7,"violet"]],{"e":["green","green"],"a":"red","d":79,"j":"blue","c":-41,"h":"yellow","b":"violet","g":"blue","f":148,"i":20}],"d":12,"f":[-34,"yellow"]}},{"e":{"e":[{"a":159},["red",-46,{"a":11},166,116,{"e":-39,"c":-24,"a":194,"b":27,"d":91},-37,85,["green"],61],"yellow",{"a":135},["orange","orange",128,"green",-20,97,{"e":108,"c":195,"a":"blue","g":51,"b":"green","d":"violet","f":28}]],"a":"green","d":164,"c":"violet","h":"orange","b":"green","g":{"e":"red","c":151,"a":"violet","b":46,"d":"yellow","f":["red"]},"f":-35,"i":"orange"},"a":{"e":7,"a":{"a":-28},"d":151,"c":{"c":147,"a":165,"b":[-5,["violet","blue","orange","violet",3,"yellow",86,"orange",197,51],6,156,43,94,"blue",{"e":130,"c":"orange","a":-29,"b":89,"d":-41,"f":"orange"},76]},"h":{"e":153,"a":"violet","d":"yellow","j":"green","c":{"c":"blue","a":"violet","b":113,"d":"yellow"},"h":{"e":"blue","a":["yellow",29,69],"d":"orange","c":"red","h":"green","b":164,"g":"blue","f":{"c":16,"a":191,"b":61}},"b":195,"g":"yellow","f":"green","i":"red"},"b":82,"g":[51,-47,186,{"e":4,"c":27,"a":60,"b":"orange","d":32,"f":"violet"},{"e":"blue","a":72,"d":17,"j":"blue","c":"red","h":0,"b":"yellow","g":195,"f":["red","green",82,-31,"blue",-24,"yellow","red","violet"],"i":43},["green"]],"f":"blue"},"d":["violet",22,118],"j":-45,"c":174,"h":79,"b":180,"g":{"c":-7,"a":{"e":["blue","violet"],"c":"blue","a":"violet","g":"red","b":"orange","d":"orange","f":{"a":"violet","b":33}},"b":183,"d":132},"f":["violet","violet","green",[[[66,"violet","violet","green","green"]],[181,"yellow",167,134,"orange",{"e":"red","c":"violet","a":"violet","b":107,"d":-19},{"e":0,"c":166,"a":"green","b":"blue","d":"red"}],19,-31,108]],"i":["red","red",[159],[139,"blue",{"a":106},48,117,164,["blue",161,"green",174,"orange",152,"red","orange",["red","yellow","blue",-43]],105,22,"green"],[110]]},153,{"a":{"e":"orange","a":[{"e":"red","a":"yellow","d":"green","c":"violet","h":{"e":"blue","c":62,"a":148,"g":"violet","b":6,"d":"yellow","f":-1},"b":"yellow","g":-14,"f":58},"violet","yellow",{"e":4,"a":"blue","d":{"e":"green","a":-49,"d":"yellow","j":-39,"c":"orange","h":"red","b":"blue","g":59,"f":"violet","i":46},"c":195,"h":22,"b":160,"g":"orange","f":"orange","i":38},"red",["orange","red","yellow",34,101,"yellow"],40,["orange",{"e":148,"c":"red","a":85,"g":62,"b":-13,"d":-25,"f":"orange"},-47,34,{"e":"violet","c":80,"a":"red","b":34,"d":100},58,185,"yellow","orange",["yellow","green","violet",84,"blue","orange",13]],183],"d":"red","j":[-2,"red","yellow",176,-24,140,"blue","yellow",155,{"e":-28,"c":"violet","a":{"a":"green","b":3},"b":"red","d":-16}],"c":["violet",-16],"h":"blue","b":"green","g":["yellow","yellow","yellow",44,"orange",50,36,{"e":"green","a":162,"d":112,"c":166,"h":92,"b":31,"g":"blue","f":-12}],"f":"yellow","i":["yellow","violet",[19,"red",["violet","violet",195]],["yellow",[106],"red","orange","blue"],178,{"e":"violet","a":104,"d":"red","c":"yellow","h":{"c":-47,"a":"blue","b":84},"b":"green","g":0,"f":"blue","i":"red"},105]}},{"e":7,"c":[156],"a":{"a":{"e":{"e":"violet","a":["blue","yellow","orange"],"d":"green","c":[159,"blue","violet","red",61,3],"h":"red","b":"green","g":132,"f":130},"c":92,"a":"orange","b":"green","d":[186,122],"f":"yellow"}},"g":["yellow","violet"],"b":"violet","d":{"e":{"c":"orange","a":127,"b":41,"d":[36,61,178,"yellow","green","red","violet",{"e":-18,"a":"yellow","d":"red","c":0,"h":"yellow","b":"yellow","g":6,"f":"yellow"},162]},"c":-6,"a":{"c":{"e":"red","c":78,"a":"blue","b":91,"d":49,"f":14},"a":["green"],"b":{"a":22},"d":{"a":"blue"}},"b":154,"d":"orange","f":{"a":170}},"f":-33},"blue",82],"a":{"c":["green",["red","orange",{"e":-28,"a":{"a":"violet","b":110},"d":[[174,140,72],191,"yellow",108,195,{"a":"violet"},147,53],"c":"yellow","h":"green","b":"violet","g":"red","f":["blue","orange","violet",[48,118],156,144,-46,110,["orange","yellow","blue","red"],149],"i":{"e":"orange","c":101,"a":{"e":111,"a":"blue","d":"orange","j":"orange","c":-40,"h":13,"b":"orange","g":"yellow","f":32,"i":"yellow"},"g":{"e":"orange","a":"blue","d":195,"j":81,"c":185,"h":20,"b":4,"g":"green","f":112,"i":147},"b":-22,"d":199,"f":"yellow"}},"yellow",19,128,-3,27,["orange",{"e":-8,"c":156,"a":"yellow","b":"red","d":20,"f":-37},[{"c":19,"a":"blue","b":150},"orange",-12,9]]],[12,{"e":"blue","c":162,"a":["blue",184,"yellow","orange",{"a":"yellow","b":"green"},88,-19,60,"yellow"],"g":"yellow","b":191,"d":-6,"f":"violet"}],{"c":"yellow","a":"orange","b":{"a":"violet","b":["orange","orange","violet",{"e":"red","a":"red","d":163,"c":153,"h":"green","b":6,"g":"blue","f":17,"i":63},163,[164,-41,"violet","violet",126]]},"d":-38}],"a":{"e":{"c":-1,"a":"orange","b":{"c":131,"a":{"e":-11,"c":120,"a":"green","b":198,"d":152,"f":37},"b":77,"d":{"e":8,"a":21,"d":"blue","c":"yellow","h":"violet","b":11,"g":"violet","f":{"e":148,"c":98,"a":80,"b":78,"d":68}}},"d":"orange"},"a":["violet",[-30,117],[78,31],74,197,"red","orange",95],"d":"green","c":[96,"violet"],"h":{"e":{"c":"green","a":[76,16,125,"green",15,"violet",130,60,"red"],"b":"orange","d":-38},"a":71,"d":158,"j":-16,"c":[["yellow","green",183,165,-28,4,102],-20,"blue","violet",{"e":"yellow","c":{"e":"orange","a":"yellow","d":"red","c":"orange","h":"orange","b":169,"g":"violet","f":48},"a":99,"b":["blue",-1,"blue"],"d":104,"f":20},83],"h":"green","b":[-14,[28],"yellow",[93,"blue",-24,160,35,25,-32,"green"],{"e":[51,"red",64,"red","blue",-16,31,146,"blue","yellow"],"c":122,"a":"orange","b":"yellow","d":{"c":53,"a":179,"b":"blue","d":-44}},17,110],"g":151,"f":"orange","i":{"a":"violet","b":{"a":[-24]}}},"b":["violet",{"e":{"e":91,"a":{"e":"blue","a":-25,"d":70,"c":"green","h":"violet","b":48,"g":"violet","f":"orange"},"d":"yellow","c":136,"h":90,"b":{"e":26,"c":"green","a":"blue","g":"violet","b":192,"d":198,"f":86},"g":"orange","f":"blue"},"a":137,"d":47,"c":11,"h":"yellow","b":"orange","g":"orange","f":{"e":"blue","a":45,"d":"violet","j":146,"c":-38,"h":4,"b":157,"g":104,"f":-13,"i":"yellow"}},{"e":191,"a":"blue","d":"green","c":"blue","h":-19,"b":148,"g":"blue","f":{"e":57,"c":"red","a":167,"b":[-42,147,166,74,-32,"orange","violet","yellow"],"d":"green","f":71}},"green",[184,"yellow",[["yellow","yellow"],"green",{"e":-24,"a":1,"d":44,"c":"yellow","h":"yellow","b":144,"g":"violet","f":"green","i":-7},86,119,52,"orange",["red","red",18,"orange",192,116],120,109]],["violet",-14,"violet",{"e":-29,"c":{"e":"green","a":"red","d":"blue","j":68,"c":9,"h":"orange","b":25,"g":"red","f":10,"i":"green"},"a":-15,"b":"blue","d":"violet","f":125},119,[127,"violet","green",39]]],"g":"green","f":-14},"b":23,"d":{"c":{"c":98,"a":"yellow","b":97},"a":-29,"b":{"a":192,"b":["violet","yellow",65,{"c":{"e":"violet","c":"yellow","a":"violet","b":"blue","d":"orange"},"a":"red","b":176},192]},"d":"orange"}},"b":[{"e":"yellow","c":45,"a":81,"b":["orange"],"d":"violet","f":[-3,"red",146,186,"orange","red","blue",{"e":"green","c":22,"a":"yellow","b":"blue","d":-2,"f":"green"},0,180]},[[-36,["orange",[166],"violet"],{"c":86,"a":[2,173,78,"violet","orange",["violet","yellow","blue",107,24,-1,"orange",13,"green","violet"]],"b":"violet","d":107},100,["yellow",-22,[177,69,144,84,159,"violet"],"green"],{"e":"green","a":78,"d":173,"c":"blue","h":36,"b":[[-48,164,"red","blue",45],["green","orange",23,15,110,49,"blue"],"violet",0,192,53],"g":["blue","violet"],"f":"orange","i":[{"e":186,"c":"orange","a":"green","b":174,"d":"yellow","f":46},"violet",188,"yellow",54,-6,"blue","violet",0,{"e":166,"a":"yellow","d":"red","j":"blue","c":"red","h":97,"b":"violet","g":32,"f":173,"i":95}]},{"a":58,"b":"blue"},"green",["red",150,3,"orange",32,106,[["blue"],118,{"c":178,"a":7,"b":185,"d":"violet"},"red",164,"red",[128,"red"],-44],{"e":"orange","a":"orange","d":130,"c":"yellow","h":"yellow","b":{"e":91,"a":161,"d":-44,"c":-45,"h":"blue","b":"orange","g":122,"f":"orange"},"g":"yellow","f":"blue"},139,{"a":97}]],"orange",["orange",0,"blue","red",{"e":192,"c":92,"a":{"a":["red",164,"yellow",189,"blue",150,"green","violet",-35,33],"b":"red"},"g":"yellow","b":{"a":"blue"},"d":"red","f":-31},111,"yellow","red",[["green","green",42,-47,[88,142,"blue",59,-42,"violet"],"green"],"orange",["violet","yellow","violet",198,94,44,"orange","green","blue",26],"blue","violet"]],{"a":118}],{"e":-35,"a":{"e":["orange",-1,121,"red"],"c":"violet","a":[[127,-18,-4,[-40,42,"violet",167,"orange",112,"orange"],30,31,"violet",37],{"c":"blue","a":"green","b":172},[141,154],146,"yellow"],"b":"blue","d":-3},"d":"red","c":-17,"h":-3,"b":["violet","yellow",19,"red",8,138,37],"g":{"c":{"e":-5,"c":[-23,21,"green",-3,"red"],"a":163,"b":"blue","d":"red","f":["violet",136,"violet"]},"a":183,"b":-36,"d":"violet"},"f":["green",["green",{"e":"red","c":"yellow","a":10,"g":"blue","b":56,"d":"red","f":["green","red","red"]},["violet","orange",{"e":7,"c":170,"a":"green","b":55,"d":115},"green","blue"]]]},{"e":{"e":{"a":"blue","b":[192,"blue",86,93]},"a":"green","d":"yellow","c":186,"h":["violet","orange","orange","violet","red","orange",139,"violet","green",{"e":"red","a":85,"d":"orange","c":"yellow","h":[46,35,"red","green",-11,"blue"],"b":"yellow","g":"yellow","f":"orange"}],"b":{"e":77,"a":"yellow","d":"green","c":144,"h":"green","b":{"e":[27,"blue","yellow",-48,-21,-12,121,"violet"],"a":[-23],"d":"blue","j":{"e":"orange","c":"blue","a":"green","b":-34,"d":"green"},"c":"green","h":"green","b":61,"g":["blue"],"f":19,"i":"violet"},"g":86,"f":"orange"},"g":"yellow","f":"orange"},"c":{"c":["yellow",82,"red","orange",{"e":34,"c":"green","a":"violet","b":182,"d":"orange","f":{"e":-49,"a":184,"d":57,"j":"yellow","c":120,"h":"violet","b":170,"g":159,"f":-3,"i":99}},-37,{"e":84,"a":["violet",154,"violet",123,"violet",148,105,"yellow",195],"d":"orange","c":{"a":140},"h":"yellow","b":159,"g":76,"f":186},183],"a":[{"e":"yellow","a":-2,"d":"green","c":{"c":68,"a":"red","b":"blue"},"h":[140,99,-2,"green","orange","orange",-14,60,"red","green"],"b":"violet","g":1,"f":["yellow","violet"],"i":142},{"e":{"a":76,"b":-17},"c":46,"a":[76,1,79,36,-25,"yellow",0],"g":"yellow","b":185,"d":54,"f":"green"}],"b":{"e":127,"a":[["violet"],115,114,"red","orange",83,-17,-2],"d":{"e":198,"c":"red","a":46,"b":77,"d":"green"},"c":140,"h":"orange","b":89,"g":149,"f":"orange"}},"a":"blue","g":62,"b":"orange","d":"violet","f":{"e":-11,"a":[29,"yellow","yellow",187,"orange",{"e":147,"a":197,"d":["green",182,-2,95,-8,110,-38],"c":"violet","h":187,"b":90,"g":22,"f":"yellow","i":"green"},{"a":["blue","red",140],"b":"violet"},"blue",76,59],"d":-26,"c":[{"a":"orange","b":179},"red",{"e":"violet","c":"orange","a":"blue","g":"violet","b":25,"d":149,"f":-27},{"e":"green","a":"yellow","d":"violet","j":{"c":67,"a":179,"b":53},"c":145,"h":-4,"b":"blue","g":11,"f":"blue","i":"violet"}],"h":"red","b":"blue","g":{"e":"yellow","c":[93,12,118,-7,125,93,"yellow",182,113,"yellow"],"a":"green","b":"green","d":"violet"},"f":"green","i":"green"}},[7]],"d":[[[42,67,{"e":"yellow","a":"orange","d":{"e":"orange","c":"green","a":-26,"g":[68,162,"orange","red"],"b":105,"d":52,"f":"yellow"},"c":{"e":"orange","a":"orange","d":120,"c":"blue","h":[172,"orange",171,-40,139,161,"yellow",197],"b":"yellow","g":[162,"orange",2],"f":"yellow","i":"orange"},"h":-21,"b":"green","g":{"e":33,"a":6,"d":"violet","c":193,"h":89,"b":56,"g":146,"f":{"c":-46,"a":"green","b":161},"i":149},"f":65},[["yellow",31,-4],"red",-27,21,{"e":{"e":-25,"a":-1,"d":"violet","c":"violet","h":"blue","b":"green","g":"violet","f":"orange","i":"yellow"},"c":"orange","a":"orange","g":"orange","b":60,"d":{"e":"yellow","c":"green","a":"yellow","g":"violet","b":134,"d":149,"f":"yellow"},"f":"blue"},"violet",[66,"green",25,106,"red","orange"],{"a":{"e":"orange","a":95,"d":"red","c":176,"h":179,"b":87,"g":195,"f":71,"i":"violet"},"b":14},55],"blue"],[[62,"violet",58,[-42,"orange",{"e":186,"a":"orange","d":"green","j":100,"c":163,"h":-9,"b":"green","g":"orange","f":-8,"i":"orange"},"red",12,"orange",-3,162,"green"],"violet",94,"orange",41,58,"violet"],[["green","green","red"],"red",128,"blue","yellow","yellow",{"e":"yellow","a":193,"d":["orange",134],"j":["green",45,195,123,50,61],"c":"violet","h":-39,"b":13,"g":"yellow","f":{"e":-33,"c":26,"a":83,"b":122,"d":"orange"},"i":"orange"},"blue",46,"yellow"],"yellow","yellow",30,[158,{"c":"green","a":68,"b":122},{"e":95,"c":"orange","a":"green","b":115,"d":180,"f":"yellow"},[194,-29,"orange","violet",{"e":173,"a":193,"d":"green","j":"blue","c":"blue","h":"green","b":"yellow","g":"green","f":186,"i":"red"},135],"violet"]],"yellow",144,["violet","red",{"a":[121],"b":134},{"a":-23,"b":"violet"},[7],[101,181,"yellow",{"e":"violet","c":"green","a":56,"b":"green","d":175}]],"violet",{"c":"green","a":{"e":"green","c":-42,"a":-49,"b":[["orange","yellow",-17,"orange",-11,-41,"red",32],"blue",46,{"a":"yellow","b":"violet"}],"d":"red","f":["violet","violet",-11]},"b":["orange",{"e":62,"c":"violet","a":-5,"b":39,"d":[122,129,"violet","orange"]},"green"]}]],"f":{"e":{"e":[{"e":{"a":"violet"},"c":171,"a":{"a":{"e":122,"a":"blue","d":164,"j":54,"c":"violet","h":-1,"b":148,"g":"blue","f":190,"i":-37}},"b":[{"a":158},"blue",26,{"e":"violet","c":"green","a":64,"g":36,"b":"blue","d":"blue","f":"green"},"violet",125,"orange"],"d":"violet"},"yellow",{"c":{"e":-46,"c":121,"a":191,"g":"blue","b":67,"d":-25,"f":"blue"},"a":"orange","b":{"a":108,"b":["red",-48]}},{"e":116,"c":"green","a":-34,"g":59,"b":"yellow","d":37,"f":{"e":-3,"a":105,"d":"red","c":"red","h":"green","b":27,"g":189,"f":"violet"}},"red",["yellow",152,{"e":"red","a":[164,155,"green","yellow"],"d":79,"c":"violet","h":{"e":"blue","c":53,"a":"orange","b":-43,"d":"violet","f":"orange"},"b":32,"g":"green","f":"green","i":23},"red","violet",-37,[["green","violet",131,-18,"green"],48,6,"red",83],152,181,75],{"e":[116,100,"red",{"a":156},"green"],"c":"red","a":170,"g":[28,59,"violet","violet",144],"b":13,"d":{"a":"yellow","b":"blue"},"f":{"e":-45,"c":"orange","a":"orange","b":"green","d":["orange","orange",98,-13,"yellow",183,193,"green"],"f":"green"}},128,["green"]],"a":{"e":{"e":"green","a":"yellow","d":{"c":-48,"a":["violet",195,77,-13,"green","red"],"b":"blue","d":"red"},"c":"violet","h":[-13,"green"],"b":27,"g":-37,"f":197},"c":68,"a":-23,"b":93,"d":"orange","f":{"a":"green","b":-4}},"d":[-48],"c":[["violet","blue","orange",{"e":42,"c":66,"a":["blue","blue","orange",144,130,"red","violet","red",112],"b":"blue","d":192},"orange",["orange",4,"violet",-47,"orange"],["violet","yellow",54,{"c":47,"a":"yellow","b":"red"},{"a":"violet"},151,-30,"orange","red"],-31,"blue"],135,{"e":"red","a":[5,117],"d":119,"j":189,"c":{"e":134,"a":142,"d":"orange","j":189,"c":"red","h":"violet","b":"yellow","g":122,"f":{"c":"orange","a":"violet","b":"yellow"},"i":107},"h":109,"b":15,"g":[157,135,122,-34,168,"green",-19,13,64],"f":{"e":"blue","c":174,"a":187,"g":"violet","b":36,"d":80,"f":188},"i":-10},60,"orange",146,{"e":-8,"a":{"a":63},"d":"green","c":67,"h":["blue","yellow","red","blue",["yellow",189,"orange","green"],"orange","violet"],"b":-29,"g":"orange","f":["violet","green","orange"]},{"e":"violet","c":"red","a":-45,"g":[45,"green",-24,-7,{"a":67,"b":"red"},"orange",188,["red","blue","red"],47,133],"b":{"e":112,"a":76,"d":"yellow","j":93,"c":"orange","h":137,"b":154,"g":["orange","red","yellow",-26,"orange"],"f":-3,"i":"yellow"},"d":{"e":"violet","c":48,"a":174,"b":"green","d":189},"f":[69,"red",{"a":"green","b":"blue"},"red",{"a":85}]},{"e":"violet","c":{"e":"violet","c":"red","a":-22,"b":3,"d":{"e":185,"c":52,"a":"yellow","b":165,"d":"blue","f":"yellow"}},"a":45,"b":"green","d":"blue"}],"h":"orange","b":{"e":"red","c":68,"a":171,"g":-30,"b":"orange","d":"violet","f":{"c":22,"a":["green"],"b":148}},"g":{"e":77,"c":28,"a":["green","green",{"a":"violet","b":115},{"e":59,"a":198,"d":"violet","c":"yellow","h":-38,"b":"violet","g":69,"f":"violet","i":-12},35],"b":"blue","d":{"e":[-20,"orange","green",116,"yellow",-21],"c":"red","a":"green","b":160,"d":["violet",-49,"yellow",[46,"blue",196]]}},"f":[162,{"c":[-30,"violet"],"a":"blue","b":"blue","d":83},"blue"],"i":"green"},"a":["blue",{"e":{"e":131,"c":"yellow","a":"blue","g":{"e":"yellow","c":70,"a":{"e":53,"c":100,"a":162,"b":-7,"d":-14,"f":"orange"},"b":"yellow","d":"green","f":149},"b":[184,"green","blue",-38,193,75,156],"d":96,"f":{"e":177,"c":0,"a":{"c":"red","a":-23,"b":"yellow","d":-37},"g":149,"b":"blue","d":61,"f":78}},"c":-21,"a":[{"e":{"a":"yellow"},"c":71,"a":{"e":-46,"a":"yellow","d":"green","c":78,"h":59,"b":"green","g":189,"f":"red","i":"red"},"b":"yellow","d":{"e":"violet","c":"violet","a":"orange","b":189,"d":21,"f":71},"f":15},"green",150,"yellow"],"b":101,"d":"blue","f":"blue"},"green",[[-10,{"c":61,"a":99,"b":"green"}],"violet",["blue",-41],54,[194,146,"green",90,"violet","violet",-5,"red"],{"e":114,"a":"green","d":{"e":"blue","a":"blue","d":["yellow",10,"blue",86,44,"violet","red","red"],"c":94,"h":{"e":"red","c":"blue","a":89,"g":197,"b":148,"d":91,"f":52},"b":"orange","g":"red","f":"green"},"c":[96,127,29],"h":"blue","b":"green","g":"yellow","f":{"e":"green","a":"blue","d":"orange","j":40,"c":"red","h":92,"b":-49,"g":-34,"f":8,"i":125},"i":-30},{"a":154,"b":100}]],"d":{"c":{"a":"violet","b":"violet"},"a":"yellow","b":{"e":[83,"red",["green",{"a":"violet"},126,105,86],[["blue",-40,148,"blue"],168,"red","green",["green",41,93,"red",-19],32,"violet","violet","blue","yellow"],{"a":"yellow","b":"green"},[85,164],17,60,66,{"c":"yellow","a":"yellow","b":-10,"d":"yellow"}],"a":[109,28,52,[118,"violet"],{"a":"blue"},10,163,"green",-21],"d":"green","c":"green","h":["violet","violet"],"b":"blue","g":{"e":-22,"c":["yellow",119,127],"a":"green","g":1,"b":[{"a":100,"b":"yellow"},63,41,168,152,"yellow",198,-14,30,103],"d":"violet","f":["blue",135,"yellow","green","yellow",["yellow",35,91,182]]},"f":"yellow","i":{"c":"green","a":[{"a":"yellow"},"green","orange",50,117,94,"red",89],"b":"red"}}},"j":{"e":{"e":{"a":70},"c":["blue","violet"],"a":113,"b":{"e":"yellow","c":-9,"a":135,"b":"yellow","d":81},"d":{"e":189,"a":-19,"d":-14,"j":{"e":"green","a":1,"d":"violet","c":"red","h":106,"b":"green","g":-19,"f":192,"i":"green"},"c":195,"h":"yellow","b":"orange","g":45,"f":"green","i":"violet"},"f":75},"a":"violet","d":"blue","c":"red","h":113,"b":[14,{"e":82,"a":{"e":59,"a":182,"d":"yellow","c":"blue","h":"yellow","b":"green","g":93,"f":"yellow","i":147},"d":58,"c":"violet","h":{"a":{"e":27,"a":"orange","d":181,"c":142,"h":195,"b":"yellow","g":44,"f":"yellow"}},"b":-14,"g":"red","f":{"a":154},"i":90},"orange",{"a":"blue","b":-11},["yellow",[38,-34,"orange",57],"orange",98,"violet","violet",{"a":134},[24,"blue","blue",172,114],10],[{"a":["yellow","green"]},166,"blue",["blue",{"e":"blue","c":-6,"a":"green","b":"green","d":"green","f":50},-44,{"e":"violet","a":"yellow","d":-27,"j":33,"c":"orange","h":146,"b":"green","g":30,"f":"violet","i":"violet"},"blue","red","violet",6]],113],"g":{"e":{"e":"red","a":125,"d":183,"j":74,"c":["green","yellow"],"h":12,"b":["green",-38,"yellow"],"g":71,"f":"blue","i":"blue"},"a":["green",86,28,[55,127,"blue",172,"green",83,"green","violet",{"a":53},"blue"],{"a":181,"b":57},[28,"violet"],"red",{"a":138},198],"d":"yellow","c":[{"e":"violet","c":65,"a":"green","b":{"e":"orange","a":68,"d":"orange","c":"green","h":161,"b":"green","g":"green","f":13},"d":-38},"blue",{"e":73,"a":40,"d":"green","c":"red","h":"yellow","b":117,"g":178,"f":170},"yellow",188],"h":{"a":-21},"b":{"c":86,"a":["green","green",170,"blue",-40,"yellow","red",10],"b":[["green","yellow",2,"violet",-30,"yellow","red",-40,"orange","violet"],"red",58,165,"red"],"d":13},"g":{"a":63},"f":"violet"},"f":["green"],"i":[["yellow","yellow","red",{"e":-5,"c":124,"a":"yellow","g":"violet","b":"orange","d":"violet","f":149},-16,9],"violet",-43,{"c":9,"a":52,"b":179,"d":74},"violet",[{"e":-30,"a":82,"d":"green","j":49,"c":{"e":"green","a":"violet","d":"yellow","j":"blue","c":37,"h":"violet","b":48,"g":12,"f":"green","i":"red"},"h":58,"b":["yellow","blue","blue",29,"orange","green","green",0],"g":128,"f":"orange","i":91},[181,"red","green","violet","red","green","orange",{"e":"green","a":"yellow","d":"green","c":24,"h":194,"b":128,"g":"red","f":162,"i":"violet"},191],"red","violet","yellow","red"],141,123]},"c":{"a":95},"h":{"a":138},"b":118,"g":"green","f":0,"i":"violet"}}
diff --git a/advent-day-13.input b/advent-day-13.input
new file mode 100644
index 0000000..83755b0
--- /dev/null
+++ b/advent-day-13.input
@@ -0,0 +1,56 @@
+Alice would lose 57 happiness units by sitting next to Bob.
+Alice would lose 62 happiness units by sitting next to Carol.
+Alice would lose 75 happiness units by sitting next to David.
+Alice would gain 71 happiness units by sitting next to Eric.
+Alice would lose 22 happiness units by sitting next to Frank.
+Alice would lose 23 happiness units by sitting next to George.
+Alice would lose 76 happiness units by sitting next to Mallory.
+Bob would lose 14 happiness units by sitting next to Alice.
+Bob would gain 48 happiness units by sitting next to Carol.
+Bob would gain 89 happiness units by sitting next to David.
+Bob would gain 86 happiness units by sitting next to Eric.
+Bob would lose 2 happiness units by sitting next to Frank.
+Bob would gain 27 happiness units by sitting next to George.
+Bob would gain 19 happiness units by sitting next to Mallory.
+Carol would gain 37 happiness units by sitting next to Alice.
+Carol would gain 45 happiness units by sitting next to Bob.
+Carol would gain 24 happiness units by sitting next to David.
+Carol would gain 5 happiness units by sitting next to Eric.
+Carol would lose 68 happiness units by sitting next to Frank.
+Carol would lose 25 happiness units by sitting next to George.
+Carol would gain 30 happiness units by sitting next to Mallory.
+David would lose 51 happiness units by sitting next to Alice.
+David would gain 34 happiness units by sitting next to Bob.
+David would gain 99 happiness units by sitting next to Carol.
+David would gain 91 happiness units by sitting next to Eric.
+David would lose 38 happiness units by sitting next to Frank.
+David would gain 60 happiness units by sitting next to George.
+David would lose 63 happiness units by sitting next to Mallory.
+Eric would gain 23 happiness units by sitting next to Alice.
+Eric would lose 69 happiness units by sitting next to Bob.
+Eric would lose 33 happiness units by sitting next to Carol.
+Eric would lose 47 happiness units by sitting next to David.
+Eric would gain 75 happiness units by sitting next to Frank.
+Eric would gain 82 happiness units by sitting next to George.
+Eric would gain 13 happiness units by sitting next to Mallory.
+Frank would gain 77 happiness units by sitting next to Alice.
+Frank would gain 27 happiness units by sitting next to Bob.
+Frank would lose 87 happiness units by sitting next to Carol.
+Frank would gain 74 happiness units by sitting next to David.
+Frank would lose 41 happiness units by sitting next to Eric.
+Frank would lose 99 happiness units by sitting next to George.
+Frank would gain 26 happiness units by sitting next to Mallory.
+George would lose 63 happiness units by sitting next to Alice.
+George would lose 51 happiness units by sitting next to Bob.
+George would lose 60 happiness units by sitting next to Carol.
+George would gain 30 happiness units by sitting next to David.
+George would lose 100 happiness units by sitting next to Eric.
+George would lose 63 happiness units by sitting next to Frank.
+George would gain 57 happiness units by sitting next to Mallory.
+Mallory would lose 71 happiness units by sitting next to Alice.
+Mallory would lose 28 happiness units by sitting next to Bob.
+Mallory would lose 10 happiness units by sitting next to Carol.
+Mallory would gain 44 happiness units by sitting next to David.
+Mallory would gain 22 happiness units by sitting next to Eric.
+Mallory would gain 79 happiness units by sitting next to Frank.
+Mallory would lose 16 happiness units by sitting next to George.
diff --git a/advent-day-14.input b/advent-day-14.input
new file mode 100644
index 0000000..6cf5489
--- /dev/null
+++ b/advent-day-14.input
@@ -0,0 +1,9 @@
+Dancer can fly 27 km/s for 5 seconds, but then must rest for 132 seconds.
+Cupid can fly 22 km/s for 2 seconds, but then must rest for 41 seconds.
+Rudolph can fly 11 km/s for 5 seconds, but then must rest for 48 seconds.
+Donner can fly 28 km/s for 5 seconds, but then must rest for 134 seconds.
+Dasher can fly 4 km/s for 16 seconds, but then must rest for 55 seconds.
+Blitzen can fly 14 km/s for 3 seconds, but then must rest for 38 seconds.
+Prancer can fly 3 km/s for 21 seconds, but then must rest for 40 seconds.
+Comet can fly 18 km/s for 6 seconds, but then must rest for 103 seconds.
+Vixen can fly 18 km/s for 5 seconds, but then must rest for 84 seconds.
diff --git a/advent-day-15.input b/advent-day-15.input
new file mode 100644
index 0000000..6281182
--- /dev/null
+++ b/advent-day-15.input
@@ -0,0 +1,4 @@
+Sprinkles: capacity 5, durability -1, flavor 0, texture 0, calories 5
+PeanutButter: capacity -1, durability 3, flavor 0, texture 0, calories 1
+Frosting: capacity 0, durability -1, flavor 4, texture 0, calories 6
+Sugar: capacity -1, durability 0, flavor 0, texture 2, calories 8
diff --git a/advent-day-16.input b/advent-day-16.input
new file mode 100644
index 0000000..b1bd498
--- /dev/null
+++ b/advent-day-16.input
@@ -0,0 +1,500 @@
+Sue 1: children: 1, cars: 8, vizslas: 7
+Sue 2: akitas: 10, perfumes: 10, children: 5
+Sue 3: cars: 5, pomeranians: 4, vizslas: 1
+Sue 4: goldfish: 5, children: 8, perfumes: 3
+Sue 5: vizslas: 2, akitas: 7, perfumes: 6
+Sue 6: vizslas: 0, akitas: 1, perfumes: 2
+Sue 7: perfumes: 8, cars: 4, goldfish: 10
+Sue 8: perfumes: 7, children: 2, cats: 1
+Sue 9: pomeranians: 3, goldfish: 10, trees: 10
+Sue 10: akitas: 7, trees: 8, pomeranians: 4
+Sue 11: goldfish: 1, perfumes: 4, cars: 6
+Sue 12: samoyeds: 6, trees: 6, perfumes: 2
+Sue 13: akitas: 10, pomeranians: 0, vizslas: 2
+Sue 14: cars: 2, perfumes: 3, children: 4
+Sue 15: goldfish: 2, children: 8, cars: 5
+Sue 16: goldfish: 9, cars: 0, vizslas: 5
+Sue 17: cats: 5, trees: 6, perfumes: 6
+Sue 18: cars: 0, perfumes: 8, pomeranians: 7
+Sue 19: trees: 2, goldfish: 5, perfumes: 4
+Sue 20: akitas: 4, vizslas: 4, trees: 0
+Sue 21: pomeranians: 7, trees: 0, goldfish: 10
+Sue 22: cars: 4, vizslas: 0, perfumes: 3
+Sue 23: vizslas: 8, trees: 1, akitas: 2
+Sue 24: children: 7, trees: 0, akitas: 1
+Sue 25: goldfish: 3, akitas: 2, trees: 2
+Sue 26: pomeranians: 4, vizslas: 4, samoyeds: 2
+Sue 27: cars: 0, trees: 8, akitas: 5
+Sue 28: perfumes: 6, cats: 0, cars: 2
+Sue 29: trees: 7, akitas: 1, vizslas: 1
+Sue 30: perfumes: 9, cars: 9, trees: 10
+Sue 31: pomeranians: 5, akitas: 9, samoyeds: 1
+Sue 32: pomeranians: 10, vizslas: 5, goldfish: 5
+Sue 33: vizslas: 2, akitas: 3, trees: 7
+Sue 34: goldfish: 10, perfumes: 0, samoyeds: 7
+Sue 35: akitas: 6, cats: 7, perfumes: 10
+Sue 36: pomeranians: 8, vizslas: 7, akitas: 6
+Sue 37: goldfish: 2, cars: 10, children: 7
+Sue 38: goldfish: 2, perfumes: 3, cars: 7
+Sue 39: trees: 9, vizslas: 10, cars: 5
+Sue 40: goldfish: 1, pomeranians: 0, trees: 2
+Sue 41: trees: 2, goldfish: 6, vizslas: 3
+Sue 42: akitas: 1, cars: 3, vizslas: 3
+Sue 43: akitas: 1, pomeranians: 1, vizslas: 3
+Sue 44: goldfish: 7, akitas: 3, vizslas: 10
+Sue 45: akitas: 8, samoyeds: 8, goldfish: 2
+Sue 46: trees: 0, vizslas: 4, cars: 9
+Sue 47: cars: 9, trees: 10, perfumes: 4
+Sue 48: akitas: 0, vizslas: 5, perfumes: 4
+Sue 49: goldfish: 9, trees: 1, cars: 4
+Sue 50: goldfish: 2, perfumes: 5, cars: 2
+Sue 51: samoyeds: 1, goldfish: 2, perfumes: 7
+Sue 52: cars: 0, perfumes: 4, goldfish: 8
+Sue 53: goldfish: 9, vizslas: 2, akitas: 9
+Sue 54: trees: 1, goldfish: 9, children: 5
+Sue 55: cars: 0, akitas: 5, trees: 4
+Sue 56: trees: 4, samoyeds: 5, children: 9
+Sue 57: children: 0, vizslas: 8, cars: 3
+Sue 58: trees: 4, pomeranians: 5, akitas: 5
+Sue 59: vizslas: 10, cats: 3, children: 2
+Sue 60: cats: 6, vizslas: 2, cars: 2
+Sue 61: akitas: 1, vizslas: 0, children: 4
+Sue 62: akitas: 4, trees: 9, children: 10
+Sue 63: pomeranians: 6, vizslas: 6, cars: 4
+Sue 64: perfumes: 8, pomeranians: 1, children: 8
+Sue 65: perfumes: 3, goldfish: 6, trees: 5
+Sue 66: goldfish: 10, akitas: 8, vizslas: 4
+Sue 67: vizslas: 10, samoyeds: 3, trees: 2
+Sue 68: samoyeds: 4, cars: 7, perfumes: 3
+Sue 69: perfumes: 2, goldfish: 0, trees: 2
+Sue 70: trees: 8, vizslas: 7, akitas: 6
+Sue 71: cars: 2, children: 7, perfumes: 3
+Sue 72: cars: 1, akitas: 9, perfumes: 0
+Sue 73: vizslas: 4, akitas: 7, cars: 5
+Sue 74: samoyeds: 3, cars: 3, akitas: 2
+Sue 75: trees: 2, cars: 1, vizslas: 7
+Sue 76: samoyeds: 9, perfumes: 1, trees: 6
+Sue 77: trees: 6, perfumes: 10, cars: 7
+Sue 78: trees: 0, children: 8, vizslas: 5
+Sue 79: vizslas: 0, trees: 0, samoyeds: 1
+Sue 80: trees: 6, goldfish: 8, perfumes: 0
+Sue 81: samoyeds: 8, pomeranians: 6, akitas: 5
+Sue 82: vizslas: 6, perfumes: 9, akitas: 4
+Sue 83: cats: 0, vizslas: 3, pomeranians: 10
+Sue 84: cars: 4, perfumes: 6, samoyeds: 5
+Sue 85: vizslas: 7, trees: 5, goldfish: 7
+Sue 86: goldfish: 2, trees: 2, vizslas: 1
+Sue 87: trees: 6, goldfish: 10, pomeranians: 4
+Sue 88: vizslas: 1, akitas: 0, perfumes: 8
+Sue 89: goldfish: 8, akitas: 3, vizslas: 7
+Sue 90: vizslas: 9, akitas: 7, perfumes: 9
+Sue 91: children: 7, cars: 7, trees: 9
+Sue 92: vizslas: 10, akitas: 8, goldfish: 1
+Sue 93: goldfish: 7, vizslas: 2, pomeranians: 0
+Sue 94: cats: 2, samoyeds: 6, pomeranians: 3
+Sue 95: samoyeds: 4, children: 4, pomeranians: 10
+Sue 96: pomeranians: 9, cats: 1, goldfish: 3
+Sue 97: trees: 1, akitas: 6, goldfish: 1
+Sue 98: vizslas: 7, akitas: 2, perfumes: 7
+Sue 99: pomeranians: 6, perfumes: 2, trees: 1
+Sue 100: cars: 3, children: 9, trees: 10
+Sue 101: children: 0, perfumes: 0, vizslas: 3
+Sue 102: cars: 4, goldfish: 5, children: 2
+Sue 103: pomeranians: 3, perfumes: 7, cats: 8
+Sue 104: akitas: 0, perfumes: 5, vizslas: 5
+Sue 105: akitas: 7, vizslas: 2, samoyeds: 8
+Sue 106: goldfish: 7, perfumes: 0, cats: 8
+Sue 107: cats: 6, pomeranians: 9, cars: 6
+Sue 108: akitas: 3, vizslas: 10, cats: 5
+Sue 109: akitas: 10, perfumes: 2, cars: 7
+Sue 110: goldfish: 7, pomeranians: 1, trees: 1
+Sue 111: akitas: 10, samoyeds: 6, vizslas: 6
+Sue 112: cats: 6, akitas: 7, trees: 9
+Sue 113: akitas: 1, trees: 9, vizslas: 8
+Sue 114: vizslas: 2, cats: 1, cars: 4
+Sue 115: akitas: 0, trees: 5, goldfish: 7
+Sue 116: goldfish: 2, trees: 10, akitas: 2
+Sue 117: cars: 4, goldfish: 10, perfumes: 5
+Sue 118: cars: 5, perfumes: 6, trees: 0
+Sue 119: perfumes: 5, vizslas: 1, cats: 0
+Sue 120: perfumes: 8, akitas: 9, vizslas: 4
+Sue 121: samoyeds: 2, vizslas: 7, perfumes: 6
+Sue 122: children: 6, trees: 9, perfumes: 2
+Sue 123: cars: 7, akitas: 0, pomeranians: 0
+Sue 124: akitas: 7, cats: 8, vizslas: 5
+Sue 125: goldfish: 3, trees: 1, cars: 4
+Sue 126: cars: 4, perfumes: 3, akitas: 0
+Sue 127: children: 10, vizslas: 5, akitas: 9
+Sue 128: akitas: 3, samoyeds: 2, cats: 8
+Sue 129: cats: 8, akitas: 1, vizslas: 8
+Sue 130: trees: 4, cars: 6, perfumes: 6
+Sue 131: akitas: 7, perfumes: 6, goldfish: 9
+Sue 132: akitas: 6, vizslas: 7, trees: 1
+Sue 133: akitas: 5, vizslas: 7, children: 9
+Sue 134: cars: 8, goldfish: 4, pomeranians: 4
+Sue 135: samoyeds: 1, pomeranians: 6, akitas: 4
+Sue 136: perfumes: 10, goldfish: 1, cars: 3
+Sue 137: cars: 3, samoyeds: 6, vizslas: 7
+Sue 138: samoyeds: 10, akitas: 3, perfumes: 4
+Sue 139: perfumes: 10, vizslas: 2, goldfish: 7
+Sue 140: samoyeds: 7, cars: 1, trees: 2
+Sue 141: children: 6, cats: 5, cars: 9
+Sue 142: cats: 0, trees: 1, akitas: 10
+Sue 143: samoyeds: 4, cars: 0, children: 7
+Sue 144: trees: 0, cars: 4, perfumes: 8
+Sue 145: goldfish: 7, cars: 5, trees: 1
+Sue 146: perfumes: 7, cars: 7, goldfish: 0
+Sue 147: trees: 2, goldfish: 7, vizslas: 5
+Sue 148: samoyeds: 8, perfumes: 1, trees: 0
+Sue 149: vizslas: 2, samoyeds: 5, trees: 0
+Sue 150: akitas: 4, perfumes: 4, pomeranians: 2
+Sue 151: trees: 2, cars: 0, goldfish: 10
+Sue 152: goldfish: 7, vizslas: 0, trees: 0
+Sue 153: children: 9, cats: 0, pomeranians: 10
+Sue 154: cars: 6, goldfish: 10, akitas: 5
+Sue 155: perfumes: 9, trees: 2, akitas: 3
+Sue 156: pomeranians: 9, perfumes: 5, cars: 9
+Sue 157: akitas: 0, trees: 2, cars: 7
+Sue 158: goldfish: 10, trees: 8, akitas: 7
+Sue 159: akitas: 5, trees: 10, cars: 10
+Sue 160: akitas: 3, trees: 5, cars: 8
+Sue 161: samoyeds: 2, cars: 7, perfumes: 4
+Sue 162: cars: 6, vizslas: 10, pomeranians: 5
+Sue 163: cars: 10, perfumes: 6, vizslas: 9
+Sue 164: pomeranians: 7, cars: 4, vizslas: 2
+Sue 165: goldfish: 9, vizslas: 3, trees: 1
+Sue 166: goldfish: 1, samoyeds: 3, trees: 1
+Sue 167: vizslas: 4, goldfish: 7, cats: 5
+Sue 168: children: 1, cars: 5, samoyeds: 7
+Sue 169: trees: 1, samoyeds: 3, goldfish: 6
+Sue 170: goldfish: 2, cars: 3, perfumes: 9
+Sue 171: cars: 4, goldfish: 0, trees: 6
+Sue 172: cats: 8, perfumes: 6, trees: 1
+Sue 173: akitas: 9, goldfish: 7, cars: 10
+Sue 174: vizslas: 2, trees: 0, akitas: 1
+Sue 175: perfumes: 3, vizslas: 8, akitas: 4
+Sue 176: perfumes: 0, akitas: 6, goldfish: 3
+Sue 177: perfumes: 6, children: 1, goldfish: 10
+Sue 178: cars: 5, vizslas: 3, children: 10
+Sue 179: perfumes: 3, trees: 8, cats: 9
+Sue 180: perfumes: 8, vizslas: 4, trees: 7
+Sue 181: perfumes: 7, vizslas: 9, samoyeds: 4
+Sue 182: vizslas: 9, trees: 4, pomeranians: 4
+Sue 183: trees: 9, cars: 3, goldfish: 5
+Sue 184: perfumes: 2, cars: 4, vizslas: 3
+Sue 185: children: 10, akitas: 10, cats: 9
+Sue 186: cars: 5, samoyeds: 0, trees: 0
+Sue 187: trees: 2, goldfish: 3, cars: 4
+Sue 188: goldfish: 3, vizslas: 1, cats: 6
+Sue 189: trees: 2, pomeranians: 10, cars: 7
+Sue 190: perfumes: 10, akitas: 3, samoyeds: 0
+Sue 191: cats: 5, vizslas: 6, akitas: 6
+Sue 192: samoyeds: 5, trees: 1, perfumes: 8
+Sue 193: pomeranians: 0, akitas: 9, cats: 0
+Sue 194: trees: 1, goldfish: 0, perfumes: 10
+Sue 195: perfumes: 2, akitas: 7, cars: 5
+Sue 196: perfumes: 5, samoyeds: 8, cars: 1
+Sue 197: vizslas: 2, pomeranians: 9, trees: 1
+Sue 198: trees: 8, vizslas: 6, children: 8
+Sue 199: pomeranians: 4, cars: 7, vizslas: 5
+Sue 200: trees: 0, perfumes: 10, akitas: 10
+Sue 201: cats: 9, akitas: 4, vizslas: 0
+Sue 202: goldfish: 9, pomeranians: 9, cats: 6
+Sue 203: cars: 5, perfumes: 5, trees: 2
+Sue 204: pomeranians: 7, children: 2, akitas: 6
+Sue 205: samoyeds: 7, pomeranians: 7, children: 6
+Sue 206: trees: 1, cars: 1, pomeranians: 4
+Sue 207: goldfish: 2, perfumes: 5, trees: 0
+Sue 208: perfumes: 2, samoyeds: 4, trees: 1
+Sue 209: cars: 8, perfumes: 6, goldfish: 9
+Sue 210: perfumes: 4, cars: 8, samoyeds: 3
+Sue 211: perfumes: 2, cars: 8, trees: 9
+Sue 212: trees: 7, perfumes: 2, akitas: 5
+Sue 213: children: 3, goldfish: 5, vizslas: 0
+Sue 214: akitas: 6, goldfish: 0, children: 0
+Sue 215: trees: 8, akitas: 3, goldfish: 1
+Sue 216: goldfish: 6, perfumes: 8, akitas: 3
+Sue 217: children: 7, trees: 2, vizslas: 6
+Sue 218: goldfish: 8, samoyeds: 4, pomeranians: 6
+Sue 219: goldfish: 8, samoyeds: 0, children: 9
+Sue 220: perfumes: 1, cars: 8, vizslas: 6
+Sue 221: perfumes: 9, cars: 10, children: 10
+Sue 222: perfumes: 9, vizslas: 1, trees: 0
+Sue 223: goldfish: 1, akitas: 2, vizslas: 8
+Sue 224: samoyeds: 8, akitas: 7, vizslas: 4
+Sue 225: goldfish: 1, cars: 4, perfumes: 10
+Sue 226: goldfish: 9, trees: 4, perfumes: 5
+Sue 227: vizslas: 5, trees: 4, goldfish: 7
+Sue 228: cars: 1, cats: 10, perfumes: 4
+Sue 229: vizslas: 8, cars: 10, akitas: 4
+Sue 230: cats: 1, children: 8, vizslas: 3
+Sue 231: perfumes: 7, cats: 6, samoyeds: 7
+Sue 232: cars: 3, children: 9, perfumes: 7
+Sue 233: vizslas: 1, samoyeds: 2, children: 2
+Sue 234: trees: 1, samoyeds: 8, children: 2
+Sue 235: trees: 6, akitas: 9, goldfish: 7
+Sue 236: children: 10, trees: 0, samoyeds: 8
+Sue 237: pomeranians: 4, trees: 1, goldfish: 2
+Sue 238: vizslas: 4, akitas: 2, cars: 0
+Sue 239: goldfish: 9, cars: 10, perfumes: 4
+Sue 240: perfumes: 3, vizslas: 6, trees: 6
+Sue 241: pomeranians: 6, akitas: 4, trees: 2
+Sue 242: cars: 8, perfumes: 5, children: 7
+Sue 243: trees: 4, perfumes: 7, cars: 3
+Sue 244: perfumes: 6, akitas: 1, vizslas: 7
+Sue 245: akitas: 3, perfumes: 9, samoyeds: 0
+Sue 246: pomeranians: 3, vizslas: 9, samoyeds: 1
+Sue 247: cars: 0, goldfish: 7, cats: 2
+Sue 248: trees: 5, goldfish: 6, perfumes: 3
+Sue 249: trees: 0, pomeranians: 7, perfumes: 9
+Sue 250: cars: 9, trees: 1, goldfish: 10
+Sue 251: perfumes: 3, cars: 8, trees: 7
+Sue 252: cars: 5, akitas: 7, trees: 8
+Sue 253: perfumes: 7, akitas: 3, trees: 8
+Sue 254: goldfish: 8, samoyeds: 1, vizslas: 7
+Sue 255: perfumes: 3, cars: 4, children: 6
+Sue 256: perfumes: 9, trees: 8, children: 7
+Sue 257: trees: 8, children: 6, cars: 4
+Sue 258: vizslas: 1, trees: 10, goldfish: 9
+Sue 259: vizslas: 5, trees: 6, goldfish: 9
+Sue 260: trees: 0, goldfish: 6, cars: 7
+Sue 261: cars: 1, perfumes: 4, goldfish: 9
+Sue 262: cars: 7, goldfish: 9, cats: 9
+Sue 263: cars: 0, children: 5, goldfish: 8
+Sue 264: cars: 2, akitas: 8, trees: 0
+Sue 265: perfumes: 9, children: 8, samoyeds: 7
+Sue 266: cats: 1, children: 1, vizslas: 10
+Sue 267: vizslas: 8, children: 2, trees: 6
+Sue 268: akitas: 10, vizslas: 3, cats: 2
+Sue 269: children: 4, goldfish: 1, cats: 6
+Sue 270: vizslas: 5, cars: 9, akitas: 9
+Sue 271: vizslas: 5, children: 4, akitas: 3
+Sue 272: cars: 1, goldfish: 0, vizslas: 0
+Sue 273: goldfish: 10, samoyeds: 1, akitas: 2
+Sue 274: goldfish: 10, children: 2, pomeranians: 0
+Sue 275: children: 0, vizslas: 1, samoyeds: 6
+Sue 276: children: 1, vizslas: 3, samoyeds: 1
+Sue 277: perfumes: 4, cats: 6, children: 10
+Sue 278: pomeranians: 7, goldfish: 3, cars: 4
+Sue 279: perfumes: 5, goldfish: 9, trees: 7
+Sue 280: goldfish: 6, trees: 5, perfumes: 8
+Sue 281: cars: 2, akitas: 1, vizslas: 7
+Sue 282: vizslas: 4, akitas: 3, children: 8
+Sue 283: pomeranians: 8, akitas: 9, vizslas: 4
+Sue 284: samoyeds: 10, trees: 10, pomeranians: 2
+Sue 285: akitas: 9, perfumes: 7, goldfish: 6
+Sue 286: akitas: 2, vizslas: 7, goldfish: 10
+Sue 287: pomeranians: 8, cars: 6, samoyeds: 5
+Sue 288: pomeranians: 1, trees: 0, goldfish: 0
+Sue 289: trees: 10, samoyeds: 1, children: 0
+Sue 290: cats: 10, samoyeds: 6, trees: 0
+Sue 291: vizslas: 9, trees: 6, goldfish: 5
+Sue 292: cats: 4, perfumes: 8, cars: 3
+Sue 293: goldfish: 10, perfumes: 10, cats: 0
+Sue 294: cats: 7, trees: 6, akitas: 4
+Sue 295: vizslas: 8, cars: 1, akitas: 6
+Sue 296: vizslas: 5, akitas: 10, trees: 1
+Sue 297: pomeranians: 8, samoyeds: 5, vizslas: 4
+Sue 298: perfumes: 10, children: 5, vizslas: 2
+Sue 299: cars: 10, akitas: 7, cats: 5
+Sue 300: trees: 1, perfumes: 7, cars: 7
+Sue 301: cars: 9, vizslas: 1, perfumes: 3
+Sue 302: perfumes: 9, vizslas: 1, akitas: 5
+Sue 303: akitas: 9, trees: 1, goldfish: 10
+Sue 304: children: 10, vizslas: 6, pomeranians: 8
+Sue 305: trees: 3, goldfish: 6, cats: 9
+Sue 306: cars: 5, perfumes: 9, vizslas: 5
+Sue 307: children: 0, goldfish: 7, trees: 2
+Sue 308: trees: 9, samoyeds: 4, cars: 0
+Sue 309: cats: 8, vizslas: 2, perfumes: 3
+Sue 310: cars: 6, pomeranians: 6, vizslas: 6
+Sue 311: vizslas: 6, akitas: 7, cats: 10
+Sue 312: trees: 0, goldfish: 7, cars: 0
+Sue 313: perfumes: 5, akitas: 5, cars: 2
+Sue 314: akitas: 10, vizslas: 3, samoyeds: 8
+Sue 315: cars: 3, perfumes: 1, goldfish: 8
+Sue 316: pomeranians: 6, goldfish: 9, perfumes: 1
+Sue 317: goldfish: 4, akitas: 6, cars: 2
+Sue 318: perfumes: 8, vizslas: 8, akitas: 0
+Sue 319: akitas: 10, cars: 5, vizslas: 6
+Sue 320: vizslas: 4, akitas: 3, cats: 4
+Sue 321: goldfish: 4, akitas: 8, cars: 8
+Sue 322: pomeranians: 5, vizslas: 7, cats: 1
+Sue 323: perfumes: 1, trees: 6, goldfish: 0
+Sue 324: goldfish: 6, trees: 10, cars: 10
+Sue 325: akitas: 2, samoyeds: 6, trees: 9
+Sue 326: vizslas: 4, akitas: 7, cars: 9
+Sue 327: children: 3, perfumes: 4, cars: 1
+Sue 328: akitas: 9, perfumes: 6, cars: 10
+Sue 329: perfumes: 2, goldfish: 0, trees: 1
+Sue 330: vizslas: 10, pomeranians: 7, goldfish: 6
+Sue 331: trees: 3, vizslas: 8, cars: 3
+Sue 332: akitas: 2, cats: 1, goldfish: 8
+Sue 333: cars: 6, trees: 2, vizslas: 0
+Sue 334: samoyeds: 7, cars: 7, trees: 3
+Sue 335: cats: 7, children: 1, perfumes: 8
+Sue 336: akitas: 5, goldfish: 10, vizslas: 5
+Sue 337: cats: 3, vizslas: 0, akitas: 10
+Sue 338: perfumes: 8, cars: 1, trees: 8
+Sue 339: cars: 4, samoyeds: 8, children: 2
+Sue 340: goldfish: 9, pomeranians: 1, samoyeds: 1
+Sue 341: akitas: 3, trees: 0, goldfish: 2
+Sue 342: perfumes: 4, vizslas: 8, pomeranians: 9
+Sue 343: akitas: 4, cars: 5, goldfish: 4
+Sue 344: samoyeds: 5, cats: 4, trees: 0
+Sue 345: samoyeds: 4, cars: 8, akitas: 2
+Sue 346: akitas: 3, vizslas: 10, perfumes: 10
+Sue 347: goldfish: 10, akitas: 4, cars: 1
+Sue 348: perfumes: 10, cats: 4, vizslas: 5
+Sue 349: akitas: 2, vizslas: 4, cars: 7
+Sue 350: akitas: 5, vizslas: 5, cars: 6
+Sue 351: vizslas: 8, perfumes: 6, cars: 3
+Sue 352: cars: 10, vizslas: 0, goldfish: 10
+Sue 353: cars: 10, perfumes: 5, children: 7
+Sue 354: vizslas: 6, akitas: 3, samoyeds: 9
+Sue 355: akitas: 2, perfumes: 7, cars: 10
+Sue 356: cars: 10, perfumes: 7, children: 6
+Sue 357: akitas: 4, cars: 8, trees: 1
+Sue 358: trees: 2, cars: 1, goldfish: 2
+Sue 359: vizslas: 5, cars: 9, trees: 4
+Sue 360: perfumes: 4, akitas: 3, cars: 3
+Sue 361: children: 3, akitas: 2, cats: 5
+Sue 362: cars: 8, cats: 4, akitas: 10
+Sue 363: cats: 2, trees: 1, vizslas: 4
+Sue 364: vizslas: 2, pomeranians: 5, samoyeds: 9
+Sue 365: samoyeds: 2, akitas: 7, goldfish: 9
+Sue 366: goldfish: 8, trees: 7, cats: 2
+Sue 367: perfumes: 2, vizslas: 6, trees: 5
+Sue 368: cars: 5, samoyeds: 0, perfumes: 6
+Sue 369: samoyeds: 10, trees: 10, vizslas: 1
+Sue 370: trees: 2, vizslas: 3, cars: 4
+Sue 371: akitas: 6, pomeranians: 2, cats: 4
+Sue 372: trees: 2, perfumes: 3, goldfish: 9
+Sue 373: vizslas: 5, children: 0, pomeranians: 6
+Sue 374: trees: 1, vizslas: 8, perfumes: 10
+Sue 375: cars: 0, akitas: 6, children: 0
+Sue 376: akitas: 1, vizslas: 0, trees: 0
+Sue 377: samoyeds: 10, cats: 5, pomeranians: 0
+Sue 378: goldfish: 3, pomeranians: 7, cats: 7
+Sue 379: perfumes: 0, cats: 0, trees: 8
+Sue 380: perfumes: 4, samoyeds: 1, akitas: 7
+Sue 381: akitas: 4, pomeranians: 2, children: 4
+Sue 382: vizslas: 9, akitas: 4, trees: 10
+Sue 383: trees: 1, vizslas: 10, akitas: 6
+Sue 384: trees: 3, akitas: 8, goldfish: 3
+Sue 385: goldfish: 6, perfumes: 2, children: 9
+Sue 386: children: 10, akitas: 7, goldfish: 7
+Sue 387: goldfish: 3, vizslas: 10, perfumes: 5
+Sue 388: children: 4, trees: 0, cars: 2
+Sue 389: trees: 0, cats: 3, goldfish: 10
+Sue 390: samoyeds: 9, pomeranians: 0, cats: 6
+Sue 391: samoyeds: 10, trees: 3, akitas: 4
+Sue 392: akitas: 9, goldfish: 10, perfumes: 7
+Sue 393: goldfish: 6, cars: 2, akitas: 9
+Sue 394: trees: 4, goldfish: 9, vizslas: 7
+Sue 395: vizslas: 4, samoyeds: 1, goldfish: 6
+Sue 396: vizslas: 5, cats: 0, samoyeds: 1
+Sue 397: goldfish: 7, cats: 0, trees: 7
+Sue 398: cars: 10, akitas: 1, vizslas: 7
+Sue 399: samoyeds: 10, cats: 6, goldfish: 6
+Sue 400: cats: 6, samoyeds: 0, trees: 2
+Sue 401: trees: 1, children: 4, goldfish: 2
+Sue 402: cats: 8, vizslas: 4, children: 3
+Sue 403: cars: 9, perfumes: 8, pomeranians: 2
+Sue 404: goldfish: 8, trees: 2, cars: 5
+Sue 405: perfumes: 1, pomeranians: 5, vizslas: 5
+Sue 406: perfumes: 6, trees: 2, pomeranians: 6
+Sue 407: trees: 0, goldfish: 6, cars: 6
+Sue 408: trees: 0, samoyeds: 7, goldfish: 9
+Sue 409: samoyeds: 10, goldfish: 6, pomeranians: 0
+Sue 410: perfumes: 5, vizslas: 6, trees: 0
+Sue 411: goldfish: 2, trees: 2, pomeranians: 0
+Sue 412: pomeranians: 4, perfumes: 8, cats: 8
+Sue 413: vizslas: 4, cars: 5, akitas: 1
+Sue 414: perfumes: 2, trees: 8, goldfish: 7
+Sue 415: akitas: 3, trees: 1, perfumes: 3
+Sue 416: cars: 7, trees: 1, perfumes: 8
+Sue 417: cars: 5, goldfish: 5, trees: 1
+Sue 418: cars: 9, goldfish: 4, samoyeds: 2
+Sue 419: pomeranians: 8, akitas: 1, goldfish: 6
+Sue 420: cars: 0, cats: 0, children: 8
+Sue 421: akitas: 10, goldfish: 1, vizslas: 8
+Sue 422: children: 8, vizslas: 6, samoyeds: 10
+Sue 423: samoyeds: 3, goldfish: 10, vizslas: 8
+Sue 424: cars: 3, children: 7, goldfish: 4
+Sue 425: cars: 9, perfumes: 9, goldfish: 8
+Sue 426: akitas: 5, trees: 10, vizslas: 10
+Sue 427: vizslas: 10, cars: 3, akitas: 7
+Sue 428: cats: 6, perfumes: 5, goldfish: 10
+Sue 429: goldfish: 7, trees: 5, vizslas: 10
+Sue 430: perfumes: 3, trees: 7, cars: 3
+Sue 431: cars: 2, vizslas: 1, akitas: 6
+Sue 432: pomeranians: 8, perfumes: 5, cars: 3
+Sue 433: children: 8, cars: 0, perfumes: 7
+Sue 434: samoyeds: 0, vizslas: 9, akitas: 10
+Sue 435: akitas: 3, vizslas: 8, cats: 4
+Sue 436: goldfish: 5, trees: 8, samoyeds: 8
+Sue 437: cars: 10, samoyeds: 9, goldfish: 7
+Sue 438: samoyeds: 5, akitas: 7, perfumes: 9
+Sue 439: goldfish: 10, perfumes: 5, cars: 0
+Sue 440: pomeranians: 1, samoyeds: 9, children: 4
+Sue 441: vizslas: 4, perfumes: 2, cats: 5
+Sue 442: trees: 0, pomeranians: 3, cars: 7
+Sue 443: akitas: 0, cars: 2, vizslas: 10
+Sue 444: children: 1, akitas: 9, trees: 0
+Sue 445: cars: 5, perfumes: 7, goldfish: 9
+Sue 446: akitas: 0, perfumes: 1, vizslas: 2
+Sue 447: vizslas: 7, perfumes: 0, cars: 5
+Sue 448: vizslas: 6, goldfish: 10, trees: 0
+Sue 449: cars: 7, vizslas: 7, trees: 3
+Sue 450: pomeranians: 4, akitas: 4, vizslas: 8
+Sue 451: cats: 4, perfumes: 8, children: 3
+Sue 452: samoyeds: 8, akitas: 9, cars: 1
+Sue 453: cars: 8, akitas: 5, vizslas: 2
+Sue 454: vizslas: 9, perfumes: 4, akitas: 4
+Sue 455: akitas: 3, goldfish: 2, vizslas: 6
+Sue 456: cars: 4, perfumes: 5, goldfish: 10
+Sue 457: trees: 9, pomeranians: 4, goldfish: 10
+Sue 458: pomeranians: 1, perfumes: 9, children: 6
+Sue 459: samoyeds: 0, goldfish: 8, vizslas: 6
+Sue 460: cars: 10, goldfish: 8, samoyeds: 8
+Sue 461: akitas: 8, goldfish: 9, vizslas: 2
+Sue 462: cars: 1, vizslas: 2, akitas: 8
+Sue 463: goldfish: 2, akitas: 4, samoyeds: 10
+Sue 464: children: 5, perfumes: 5, cars: 5
+Sue 465: perfumes: 9, trees: 0, samoyeds: 6
+Sue 466: akitas: 5, goldfish: 3, cats: 6
+Sue 467: perfumes: 3, goldfish: 0, trees: 4
+Sue 468: goldfish: 2, children: 4, trees: 1
+Sue 469: cars: 0, perfumes: 8, children: 7
+Sue 470: vizslas: 8, cats: 5, samoyeds: 9
+Sue 471: pomeranians: 7, trees: 2, goldfish: 3
+Sue 472: goldfish: 8, akitas: 4, perfumes: 5
+Sue 473: perfumes: 2, pomeranians: 3, cars: 8
+Sue 474: samoyeds: 0, akitas: 7, pomeranians: 6
+Sue 475: vizslas: 7, perfumes: 1, trees: 6
+Sue 476: vizslas: 3, samoyeds: 1, perfumes: 10
+Sue 477: cars: 6, perfumes: 5, vizslas: 2
+Sue 478: pomeranians: 1, goldfish: 3, akitas: 7
+Sue 479: goldfish: 10, trees: 0, cars: 3
+Sue 480: cats: 3, akitas: 5, vizslas: 8
+Sue 481: pomeranians: 5, vizslas: 2, trees: 3
+Sue 482: cars: 8, samoyeds: 10, goldfish: 10
+Sue 483: pomeranians: 3, vizslas: 6, goldfish: 5
+Sue 484: perfumes: 7, vizslas: 4, akitas: 7
+Sue 485: goldfish: 1, trees: 0, perfumes: 10
+Sue 486: goldfish: 6, perfumes: 0, akitas: 10
+Sue 487: cats: 2, akitas: 10, trees: 1
+Sue 488: akitas: 1, goldfish: 3, cars: 7
+Sue 489: goldfish: 3, akitas: 6, vizslas: 6
+Sue 490: goldfish: 8, perfumes: 2, akitas: 2
+Sue 491: trees: 4, vizslas: 8, perfumes: 6
+Sue 492: cars: 9, perfumes: 3, cats: 0
+Sue 493: trees: 3, vizslas: 6, goldfish: 7
+Sue 494: trees: 8, samoyeds: 1, perfumes: 5
+Sue 495: children: 9, akitas: 8, vizslas: 4
+Sue 496: vizslas: 2, pomeranians: 1, perfumes: 7
+Sue 497: trees: 2, akitas: 4, vizslas: 6
+Sue 498: akitas: 8, pomeranians: 7, trees: 0
+Sue 499: perfumes: 6, goldfish: 3, vizslas: 7
+Sue 500: cars: 1, perfumes: 6, vizslas: 1
diff --git a/advent-day-17.input b/advent-day-17.input
new file mode 100644
index 0000000..588b253
--- /dev/null
+++ b/advent-day-17.input
@@ -0,0 +1,20 @@
+50
+44
+11
+49
+42
+46
+18
+32
+26
+40
+21
+7
+18
+43
+10
+47
+36
+24
+22
+40
diff --git a/advent-day-18.input b/advent-day-18.input
new file mode 100644
index 0000000..5efaa1b
--- /dev/null
+++ b/advent-day-18.input
@@ -0,0 +1,100 @@
+#...##......#......##.##..#...##......##.#.#.###.#.#..#..#......####..#......###.#.#....#..##..###..
+####..#.#...#....#.#####.##.##.#..#.......#....#.##...###.###..#.#.#........#..#.#.##...##..#.####.#
+...#..##...#.#.###.#.###..#.##.####.###...#...........#.###..##.#.##.#.###...#.#..###....#.###.#..#.
+.#...##...####.#..#.....#..#...#.#.##...#...##..#.#.###....#..###.....##..#.###..###.....##..###...#
+..##.#####....##..#.#..##.##..######...#..###.######.....#..##...#.#..##..##..#..#..#..##.#.#.#.#...
+.###.###.###...##...##..###..##.###.#.....##..##.#.#########...##..##.#..##.#..##..####..#.#.#.#####
+#.#####..###.###.##.##.#...#.#.#.#..#.###...#..##.###.#...####.#..#.#.....###..#..####..#.#.#...##..
+....#...##.....#....####.##.#.###..#.#.##..#.#...##.###.###..#.##..#.#.##..##..#.##.###..#.#.###.###
+##.##...#.##...#.#..#.#..#...###...###.#..#..#.#####..###.#......#.....###.#####.#.#..#.#.#.##..#.#.
+#.#..#.....#.....##.#..##...###..##...##...###.#.###.#..#.#.###...##..##..#.###...#.#######.#...#.#.
+#.#.....####.#..#.##...#.##....#####.###.#.....#####....###..#........##..####...#...#.###....#..###
+##.#.##..#.#.##.#.....##.#.....###.####.#..######.....####.#.#..##.#.##...#..#.#.....#.####.#.......
+#..#..#.#..#.######.##..##.####.....##.#.##.#.######..#.#....#.#...#.#..#..#.#.###.#..#.#.#..#...###
+####..####.#.#.###.....#.#.#.##..#.##.##.##.#..##..##.#.##.....#.#..#.####.....###.#..#.####.#.#..##
+###.##..##.#.##..#..##...#.#####.##.#....##.####.#.##....#..###.#.#.##...#.....#.#.#.#.#..##.#.#..#.
+......#..####...##.##...#.##.##...##..#..##.###..#...#..##...#.#....###.####...#.##.###.#.##.####.##
+..#...#####.#.#..#.##....#..#...#..####.....###...##.###....#..#.###...#........#.#.##..#..#.#.....#
+#######.#.#.###.###..######.##..#####.##.###.###....####.#..##.##...###.#..############.#.##....##.#
+#.#...##.###.#.###..#.#.#.#.#.#..##..####.#..##.....#.##..#.##...##.#..##..#.#.#....##....##.#..#.#.
+..#.#.####.....###..#######.#.#.#.#...##.#####.....##...##...##.###..######.###..#...####.#..###.###
+.#.##....#.#.##..##.#.##.##..######...#.....#..#.#.#.#.....#.#..##.#.#.......#######....#.......#...
+..###.##.##..##....#.###...#.....##..##......###...##..###.##...##.###.#.#.#.###.###.#.#...###..#...
+.##.#.#...#...##.#.#...#..#..#.#...##.#.##...##..#....#.#..##.#..#.#..#.#.....#..#.#...#######.#.##.
+...####....#.###.#..###..##...##..#.#.#.###...#..##.##.##..##.#...#..#.##.....#.#........#..#.#.####
+.....##..###...#....#.#.#.#...###.###...#.#...#.#.####....#..####...###..#..######..##.##..###.#####
+#####.##..#....###.###....##.....#.#..#....#.#####.##.#.####.#.##...#..###...###..##...#.###.#####..
+###.##..........########.######....####.###.#..##...#.##.####.#.....##..#####..###...#####.....#.#.#
+##..#####.##.#.#####.#.##.##..#.##....########.#####.#...#.###.##...#.###.#.#..#....##.#..#...#.#.#.
+.##.#....#..#...#..#####..#..##.#......#..#....########...#..#...#.....####.#...##...#.###.#.#..##.#
+.##.##.#.##.#.##...#.#.#..##.##.###.#..##..#...###.##.###.#####.#.###..#..###.#...#.###.#...#..#.#.#
+.#..#..#.#..#..###..#....###.####.##.#.###.#.##.###.#.##.###.###...###...###.#...####...#.##.##.#.#.
+###..##...###...#..##.#..#.#...##....###.##.##..#####....###..#..#....#..###.###.#...#.##...#.#.#..#
+#....#.......##.....#.##...#..#.###.#.##..##..#.##..#.###..##.##...#####.#..#####..#####..#####....#
+.####.####....###..###.#.##.####.##.#...####.#.###.#.....#...####..#####.###..#.#.###.##.##...##..#.
+####..##...##.########...##..###..#..###.##.#.#.#........#.#####.#...#.###.####.#..####..#.#.#....##
+###.#..#...###.#..#..#.###...##..###.##.#.#...#..#...####..##....#.#..#..##.#.#...#####.###.#..#.#.#
+...##....#.###.#.#..##...##.###.#..#..#......#...#.#..####.#.##..######.####.#...#..#..#..##.#.#.##.
+##.####.#...#..#.#.##..##.#.#.###..##...####......#..######.#......#.##.#....##...###.#.#..#......##
+#.....#...#######.##.#..#.#...###.#..#.####....#.#.##.#.##...###..#...#.###.##..#.###..#.##...#####.
+#####.##...#..#.#.#.......#.##..#####..#####...###..##.#.#..###.#.#####.####..#.#..##...#.##...#.###
+.##.#..#######.###.#.####.....##...#.##.#.#..#...##....####......######.#..######.....##########.##.
+##...#.#..#.##.###.#.#.#.##.###.##..##.##.##...#.#..###.#######..#.....#####..#....######.#..##..###
+.#.#.###.....#..##..#.#..##..#.###...###.#..##...#...#.#####.#.#####..###.#..#...##..#.#..#..####...
+.#......##..#.....####.###....##.###.....###.##........#.###.##..#..#.#######.#.######..##..###.....
+..##.#.#..#.##...#.###.###...######..#..#.#..#....###.#.#....#..........#...##.##.##.#..##..#.#####.
+###.###.#..#.##..##.#..#..##.....##.....#..#######.#..#.#.#.####.###..###.#.#..#.##.##.####.###.####
+#.#.#..#....########.#..#..#...##..#.##..#.#..##..####...##.....#.##.#.#...########..#.###.#..#.#.##
+.##.....#...#.#...##.##....###...##..#.####...#..#.#..#..#.##..#.###.##.####.##..####.....##.#.....#
+....####.#.##.#.##.#..##.#.######.##.####..#...####.#..###.#.#..#..##.#.#.....##.#####.#.####...#.#.
+#..#####.#####.....##....######..##....#..#.#.###.#####.....##.##.####.#...##...#.##.#.#####.##.#...
+##.####..###.#....#...#.#.#.#.###.#####.#.####..####...####......##..#..#..#.#.##...########....#...
+.###.#.#.#.#..####.##.#..######..#.#.###.....#.#......#.#.#.#..####.##...##.#####.#.##..##..#..#.#..
+.....###...#...#.####.###.#.#.#.#.....#....#.####.###.##.##.##.#######......#.####......#....##.....
+##..#..#.#.##..#...#..##.##.##..###.#....##.##....####.#.##.###....#.##.#.#.##...##.###...#..#..####
+...#.#..##..##.#...##.##...#.#......#.#.##..###....####.##...#.#.###.#..#..#.####..##..##..#####.###
+.##.##..##########.##...#.##.####.#.#######.##.#.##.##..#...##....########.###..##.##.##.#..##.#.#.#
+#####.#....#.##..#.....#......##.##..#.##.###..##.......###..##.#.###.##.###....####.#..#.###..#.#.#
+.#...#..#.##....##....#...####....#...#..#...####...########.###.#..##.#.#.##..###..#.#.###.....##.#
+##..##.....###......#..###.##.####.##.####.#.#....#..#...#..#.#..#.###.#...#...#..##.##...#..#######
+.....##..###..##...#####.#.#.....###.#.#..####...#.#.#..#..####..##.#..###.####.#....##..###....#..#
+#.#.##.#....#.#####.#....##...#...##...##....#.#.......#....#..#...###.###.#.####..####....#.##.#.#.
+..##...##..###.#.#.##.#..#....#.#.....##.###.#.###.###.....#...#.#..#######.#####..#.###...##......#
+#......###..#....#.#..#.###.##.#...##..###.####.#.#....#.##..#.###..##.#..#####..##.###.....#..###..
+##.#.##..##.###.#..##.....#.##.....###....##.####.######.#...#..###....#.#...#.##.....###....#..#.#.
+.##.#.#.#.##..#.#.#..##..#.###.####....#..###.######..####.#.....###.##..#...###.#..######.##.#.##..
+...##.####.#..##.#####.##.#...##..#..#...#.#.#.#####...#....#..###...#..#....#.#.##.#.######.#..####
+..#.#.#.#...#.######.#.....#..#.#..###....#.#.########...#....#.#.##..#...##...#.#..#.#.###....##...
+#####..#..##..#..##..#..#.#.##.#....#####.####.##.#.###..##..##....#.....#.#####.#...#.#####.##.#.#.
+#.#..#####...####.###.###.....####.###.....##...##...#..#..#######.#.##....##..####.....##...#..#..#
+#.#.###.#.#..##..#....#.#...#.#.##.##..#.##.....##...#.#..##.......##.#.###..#####.#.##....#.##.....
+...#.......#....#.#.####.#.###.###..#....#..##.#..####........#.##..#...#.#...###.#..#.#.#...#...#..
+...##.#####.##.#.###.##.##.#.##..##.#.#.#.#.#.##.#..##...##.#.#..#..##.##.#####.#.###...#####..#..#.
+#######.#..#..#....##.#.#..####.#..#..###...#..#.......###.#.#.####....#.###...#.#.###.#.#.#.#..###.
+..##.##.#.##.###....###.##.#.###.#...#....#.####..###..###.#.#..#...##.#.#.#..##.###..###.#.##...###
+######..######..##..##.#.#.##.##.#..##..#.#.#.##..#.#...#...#.#.#..######.#..#.#.######..#......##.#
+#.#####.....#.......#########..###.##...#...##.#.#..#...#####...#...#..#.###.#..#.#...###.#.#.#...#.
+#....##....###...##.##.#...##.........##.#.#..#.#.##.#.######.#####..#..###.###.#...#.#.##.######...
+#.#...###.#.###.##.#.######.#######.###.##..#.#.#...######.##.####.##..#.#.#.#......##..##.........#
+..###..##....#.....##...#.#.###.#.#.....##.#...###.####.#...#...##..##.#.#.####..###...######....#.#
+..###.#.##.####.#..#.##....##..#####....#..##.##.#..#######...#.####...##.#.#.##.........#....#....#
+.##.#...#.####..#.#...#.##..######.##..##.#.###.##..###.###....##..#.##.##..##.#...###.##.##.###....
+#...###.###.#..#....#.......#..#.....###..#.###.##.##....#.####.#.####.##..##..#..#.....#....##.#.#.
+.##.#..#..#.##.......#.####.#######.....#.##.##.#.....#.#..#....######.#..###.##.##.....#.####..##.#
+###..#.###.#..####.....##....#..####....#.##.##..#...######.#########...#.#....##...###.#..#.##...#.
+#..###..##..#.#.##.###.#.#.##...###.#...##.##..#.###....###..#.#...#.###..######.#..#.###..#..#..#.#
+.#........##.#.###..###.#.#.##.....##.##.#.#...##..#.##....###..#.#.#.#.##....#.##..#.#...###...#...
+####.####..#....#.#.#..#..##.......##.####...###.##..#.#.##.#..##..######.......##.#.##..#...#.....#
+..#..#..###..##.##..######.#..###..###.#.##..##.#..#####.#.#.#.##..#.##..##.##......####.#..........
+...##.##..###.#...###....#.#.#.#.....#.##.....##...#...#......####...##.##....##.#..#.####.#..###.#.
+..#.....####.#.###.#####..#..###..#..#.#...#####...###.###....#.###..#...#..#..#.#..#.##..##.#.#....
+..##.#####...###.###.........#....##.####.##..#.#..#.#...#...##.##.##..#.#.##.########......#####...
+...###.#.#..#...#.###.###.......##.###.#..#.##########...#..#.#.#.##.#.###...######..#.#...###.##...
+.#.#.#######.#..##.##..##...#...####...#..#####.#..##...###.#.#...#.##...#......#..##.####..#.....##
+.##.##.#.#......#######..###.....##.#.##..###......#....####...#.###.#.##.#........#..#....##.....##
+#...#.###.#.##...##.####....#...#.###..#.#.....#.#....#.#.#.##...#.#..#####.#.#..#..#..#....#...####
+.....##...###......#####..##.##.##...##.#.#####..##...#.#.#.#.###...###.##.####..#.#..#.#..#.####.##
+#..#..##.#.##.#.##.#.#.#..###....###.##.#.##.#...#.#..#...#....###.#..#.#.######.#...####..#..##.#.#
+#..#.#..#...###.#..##.#...#...##.#......#...#..#..####..##.....#.###...#.#..#.#....#.#####.##.###...
+###....#.#..#.#..###..#.##......#...#..#..##.#..###..##..#..#.####..#...########..##.#.##.#.#.#...#.
+.#.#.##.##.###..#...#.#....#..#.##..#.#.#.#.##.##.#####...#........####..###..####.#####..#.##.#.##.
diff --git a/advent-day-2.input b/advent-day-2.input
new file mode 100644
index 0000000..b52434e
--- /dev/null
+++ b/advent-day-2.input
@@ -0,0 +1,1000 @@
+4x23x21
+22x29x19
+11x4x11
+8x10x5
+24x18x16
+11x25x22
+2x13x20
+24x15x14
+14x22x2
+30x7x3
+30x22x25
+29x9x9
+29x29x26
+14x3x16
+1x10x26
+29x2x30
+30x10x25
+10x26x20
+1x2x18
+25x18x5
+21x3x24
+2x5x7
+22x11x21
+11x8x8
+16x18x2
+13x3x8
+1x16x19
+19x16x12
+21x15x1
+29x9x4
+27x10x8
+2x7x27
+2x20x23
+24x11x5
+2x8x27
+10x28x10
+24x11x10
+19x2x12
+27x5x10
+1x14x25
+5x14x30
+15x26x12
+23x20x22
+5x12x1
+9x26x9
+23x25x5
+28x16x19
+17x23x17
+2x27x20
+18x27x13
+16x7x18
+22x7x29
+17x28x6
+9x22x17
+10x5x6
+14x2x12
+25x5x6
+26x9x10
+19x21x6
+19x4x27
+23x16x14
+21x17x29
+24x18x10
+7x19x6
+14x15x10
+9x10x19
+20x18x4
+11x14x8
+30x15x9
+25x12x24
+3x12x5
+12x21x28
+8x23x10
+18x26x8
+17x1x8
+2x29x15
+3x13x28
+23x20x11
+27x25x6
+19x21x3
+30x22x27
+28x24x4
+26x18x21
+11x7x16
+22x27x6
+27x5x26
+4x10x4
+4x2x27
+2x3x26
+26x29x19
+30x26x24
+8x25x12
+16x17x5
+13x2x3
+1x30x22
+20x9x1
+24x26x19
+26x18x1
+18x29x24
+1x6x9
+20x27x2
+3x22x21
+4x16x8
+29x18x16
+7x16x23
+13x8x14
+19x25x10
+23x29x6
+23x21x1
+22x26x10
+14x4x2
+18x29x17
+9x4x18
+7x22x9
+19x5x26
+27x29x19
+7x13x14
+19x10x1
+6x22x3
+12x21x5
+24x20x12
+28x2x11
+16x18x23
+2x13x25
+11x7x17
+27x21x4
+2x10x25
+22x16x17
+23x22x15
+17x13x13
+23x24x26
+27x18x24
+24x7x28
+30x12x15
+14x28x19
+2x15x29
+12x13x5
+17x22x21
+27x10x27
+17x6x25
+22x2x1
+1x10x9
+9x7x2
+30x28x3
+28x11x10
+8x23x15
+23x4x20
+12x5x4
+13x17x14
+28x11x2
+21x11x29
+10x23x22
+27x23x14
+7x15x23
+20x2x13
+8x21x4
+10x20x11
+23x28x11
+21x22x25
+23x11x17
+2x29x10
+28x16x5
+30x26x10
+17x24x16
+26x27x25
+14x13x25
+22x27x5
+24x15x12
+5x21x25
+4x27x1
+25x4x10
+15x13x1
+21x23x7
+8x3x4
+10x5x7
+9x13x30
+2x2x30
+26x4x29
+5x14x14
+2x27x9
+22x16x1
+4x23x5
+13x7x26
+2x12x10
+12x7x22
+26x30x26
+28x16x28
+15x19x11
+4x18x1
+20x14x24
+6x10x22
+9x20x3
+14x9x27
+26x17x9
+10x30x28
+6x3x29
+4x16x28
+8x24x11
+23x10x1
+11x7x7
+29x6x15
+13x25x12
+29x14x3
+26x22x21
+8x3x11
+27x13x25
+27x6x2
+8x11x7
+25x12x9
+24x30x12
+13x1x30
+25x23x16
+9x13x29
+29x26x16
+11x15x9
+11x23x6
+15x27x28
+27x24x21
+6x24x1
+25x25x5
+11x1x26
+21x4x24
+10x5x12
+4x30x13
+24x22x5
+26x7x21
+23x3x17
+22x18x2
+25x1x14
+23x25x30
+8x7x7
+30x19x8
+17x6x15
+2x11x20
+8x3x22
+23x14x26
+8x22x25
+27x1x2
+10x26x2
+28x30x7
+5x30x7
+27x16x30
+28x29x1
+8x25x18
+20x12x29
+9x19x9
+7x25x15
+25x18x18
+11x8x2
+4x20x6
+18x5x20
+2x3x29
+25x26x22
+18x25x26
+9x12x16
+18x7x27
+17x20x9
+6x29x26
+17x7x19
+21x7x5
+29x15x12
+22x4x1
+11x12x11
+26x30x4
+12x24x13
+13x8x3
+26x25x3
+21x26x10
+14x9x26
+20x1x7
+11x12x3
+12x11x4
+11x15x30
+17x6x25
+20x22x3
+1x16x17
+11x5x20
+12x12x7
+2x14x10
+14x27x3
+14x16x18
+21x28x24
+14x20x1
+29x14x1
+10x10x9
+25x23x4
+17x15x14
+9x20x26
+16x2x17
+13x28x25
+16x1x11
+19x16x8
+20x21x2
+27x9x22
+24x18x3
+23x30x6
+4x18x3
+30x15x8
+27x20x19
+28x29x26
+2x21x18
+1x23x30
+1x9x12
+4x11x30
+1x28x4
+17x10x10
+12x14x6
+8x9x24
+8x3x3
+29x8x20
+26x29x2
+29x25x25
+11x17x23
+6x30x21
+13x18x29
+2x10x8
+29x29x27
+27x15x15
+16x17x30
+3x3x22
+21x12x6
+22x1x5
+30x8x20
+6x28x13
+11x2x23
+14x18x27
+6x26x13
+10x24x24
+4x24x6
+20x8x3
+23x11x5
+29x5x24
+14x15x22
+21x17x13
+10x10x8
+1x11x23
+21x19x24
+19x9x13
+21x26x28
+25x11x28
+2x17x1
+18x9x8
+5x21x6
+12x5x2
+23x8x15
+30x16x24
+7x9x27
+16x30x7
+2x21x28
+5x10x6
+8x7x1
+28x13x5
+11x5x14
+26x22x29
+23x15x13
+14x2x16
+22x21x9
+4x20x3
+18x17x19
+12x7x9
+6x12x25
+3x30x27
+8x19x22
+1x9x27
+23x20x12
+14x7x29
+9x12x12
+30x2x6
+15x7x16
+19x13x18
+11x8x13
+16x5x3
+19x26x24
+26x8x21
+21x20x7
+15x1x25
+29x15x21
+22x17x7
+16x17x10
+6x12x24
+8x13x27
+30x25x14
+25x7x10
+15x2x2
+18x15x19
+18x13x24
+19x30x1
+17x1x3
+26x21x15
+10x10x18
+9x16x6
+29x7x30
+11x10x30
+6x11x2
+7x29x23
+13x2x30
+25x27x13
+5x15x21
+4x8x30
+15x27x11
+27x1x6
+2x24x11
+16x20x19
+25x28x20
+6x8x4
+27x16x11
+1x5x27
+12x19x26
+18x24x14
+4x25x17
+24x24x26
+28x3x18
+8x20x28
+22x7x21
+24x5x28
+23x30x29
+25x16x27
+28x10x30
+9x2x4
+30x2x23
+21x9x23
+27x4x26
+2x23x16
+24x26x30
+26x1x30
+10x4x28
+11x29x12
+28x13x30
+24x10x28
+8x12x12
+19x27x11
+11x28x7
+14x6x3
+6x27x5
+6x17x14
+24x24x17
+18x23x14
+17x5x7
+11x4x23
+5x1x17
+26x15x24
+3x9x24
+5x3x15
+5x20x19
+5x21x2
+13x5x30
+19x6x24
+19x17x6
+23x7x13
+28x23x13
+9x1x6
+15x12x16
+21x19x9
+25x5x5
+9x7x9
+6x5x8
+3x11x18
+23x25x11
+25x4x6
+4x27x1
+4x3x3
+30x11x5
+9x17x12
+15x6x24
+10x22x15
+29x27x9
+20x21x11
+18x10x5
+11x2x2
+9x8x8
+1x26x21
+11x11x16
+2x18x30
+29x27x24
+27x8x18
+19x3x17
+30x21x26
+25x13x25
+20x22x1
+10x1x12
+11x17x15
+29x11x30
+17x30x27
+21x22x17
+13x6x22
+22x16x12
+27x18x19
+4x13x6
+27x29x10
+3x23x10
+26x16x24
+18x26x20
+11x28x16
+21x6x15
+9x26x17
+8x15x8
+3x7x10
+2x28x8
+1x2x24
+7x8x9
+19x4x22
+11x20x9
+12x22x16
+26x8x19
+13x28x24
+4x10x16
+12x8x10
+14x24x24
+19x19x28
+29x1x15
+10x5x14
+20x19x23
+10x7x12
+1x7x13
+5x12x13
+25x21x8
+22x28x8
+7x9x4
+3x20x15
+15x27x19
+18x24x12
+16x10x16
+22x19x8
+15x4x3
+9x30x25
+1x1x6
+24x4x25
+13x18x29
+10x2x8
+21x1x17
+29x14x22
+17x29x11
+10x27x16
+25x16x15
+14x2x17
+12x27x3
+14x17x25
+24x4x1
+18x28x18
+9x14x26
+28x24x17
+1x26x12
+2x18x20
+12x19x22
+19x25x20
+5x17x27
+17x29x16
+29x19x11
+16x2x4
+23x24x1
+19x18x3
+28x14x6
+18x5x23
+9x24x12
+15x4x6
+15x7x24
+22x15x8
+22x1x22
+6x4x22
+26x1x30
+8x21x27
+7x1x11
+9x8x18
+20x27x12
+26x23x20
+26x22x30
+24x3x16
+8x24x28
+13x28x5
+4x29x23
+22x5x8
+20x22x3
+9x9x17
+28x3x30
+10x13x10
+10x25x13
+9x20x3
+1x21x25
+24x21x15
+21x5x14
+13x8x20
+29x17x3
+5x17x28
+16x12x7
+23x1x24
+4x24x29
+23x25x14
+8x27x2
+23x11x13
+13x4x5
+24x1x26
+21x1x23
+10x12x12
+21x29x25
+27x25x30
+24x23x4
+1x30x23
+29x28x14
+4x11x30
+9x25x10
+17x11x6
+14x29x30
+23x5x5
+25x18x21
+8x7x1
+27x11x3
+5x10x8
+11x1x11
+16x17x26
+15x22x19
+16x9x6
+18x13x27
+26x4x22
+1x20x21
+6x14x29
+11x7x6
+1x23x7
+12x19x13
+18x21x25
+15x17x20
+23x8x9
+15x9x26
+9x12x9
+12x13x14
+27x26x7
+11x19x22
+16x12x21
+10x30x28
+21x2x7
+12x9x18
+7x17x14
+13x17x17
+3x21x10
+30x9x15
+2x8x15
+15x12x10
+23x26x9
+29x30x10
+30x22x17
+17x26x30
+27x26x20
+17x28x17
+30x12x16
+7x23x15
+30x15x19
+13x19x10
+22x10x4
+17x23x10
+2x28x18
+27x21x28
+24x26x5
+6x23x25
+17x4x16
+14x1x13
+23x21x11
+14x15x30
+26x13x10
+30x19x25
+26x6x26
+9x16x29
+15x2x24
+13x3x20
+23x12x30
+22x23x23
+8x21x2
+18x28x5
+21x27x14
+29x28x23
+12x30x28
+17x16x3
+5x19x11
+28x22x22
+1x4x28
+10x10x14
+18x15x7
+18x11x1
+12x7x16
+10x22x24
+27x25x6
+19x29x25
+10x1x26
+26x27x30
+4x23x19
+24x19x4
+21x11x14
+4x13x27
+9x1x11
+16x20x8
+4x3x11
+1x16x12
+14x6x30
+8x1x10
+11x18x7
+29x28x30
+4x21x8
+3x21x4
+6x1x5
+26x18x3
+28x27x27
+17x3x12
+6x1x22
+23x12x28
+12x13x2
+11x2x13
+7x1x28
+27x6x25
+14x14x3
+14x11x20
+2x27x7
+22x24x23
+7x15x20
+30x6x17
+20x23x25
+18x16x27
+2x9x6
+9x18x19
+20x11x22
+11x16x19
+14x29x23
+14x9x20
+8x10x12
+18x17x6
+28x7x16
+12x19x28
+5x3x16
+1x25x10
+4x14x10
+9x6x3
+15x27x28
+13x26x14
+21x8x25
+29x10x20
+14x26x30
+25x13x28
+1x15x23
+6x20x21
+18x2x1
+22x25x16
+23x25x17
+2x14x21
+14x25x16
+12x17x6
+19x29x15
+25x9x6
+19x17x13
+24x22x5
+19x4x13
+10x18x6
+6x25x6
+23x24x20
+8x22x13
+25x10x29
+5x12x25
+20x5x11
+7x16x29
+29x24x22
+28x20x1
+10x27x10
+6x9x27
+26x15x30
+26x3x19
+20x11x3
+26x1x29
+6x23x4
+6x13x21
+9x23x25
+15x1x10
+29x12x13
+7x8x24
+29x30x27
+3x29x19
+14x16x17
+4x8x27
+26x17x8
+10x27x17
+11x28x17
+17x16x27
+1x8x22
+6x30x16
+7x30x22
+20x12x3
+18x10x2
+20x21x26
+11x1x17
+9x15x15
+19x14x30
+24x22x20
+11x26x23
+14x3x23
+1x28x29
+29x20x4
+1x4x20
+12x26x8
+14x11x14
+14x19x13
+15x13x24
+16x7x26
+11x20x11
+5x24x26
+24x25x7
+21x3x14
+24x29x20
+7x12x1
+16x17x4
+29x16x21
+28x8x17
+11x30x25
+1x26x23
+25x19x28
+30x24x5
+26x29x15
+4x25x23
+14x25x19
+29x10x7
+29x29x28
+19x13x24
+21x28x5
+8x15x24
+1x10x12
+2x26x6
+14x14x4
+10x16x27
+9x17x25
+25x8x7
+1x9x28
+10x8x17
+4x12x1
+17x26x29
+23x12x26
+2x21x22
+18x23x13
+1x14x5
+25x27x26
+4x30x30
+5x13x2
+17x9x6
+28x18x28
+7x30x2
+28x22x17
+14x15x14
+10x14x19
+6x15x22
+27x4x17
+28x21x6
+19x29x26
+6x17x17
+20x13x16
+25x4x1
+2x9x5
+30x3x1
+24x21x2
+14x19x12
+22x5x23
+14x4x21
+10x2x17
+3x14x10
+17x5x3
+22x17x13
+5x19x3
+29x22x6
+12x28x3
+9x21x25
+10x2x14
+13x26x7
+18x23x2
+9x14x17
+21x3x13
+13x23x9
+1x20x4
+11x4x1
+19x5x30
+9x9x29
+26x29x14
+1x4x10
+7x27x30
+8x3x23
+1x27x27
+7x27x27
+1x26x16
+29x16x14
+18x6x12
+24x24x24
+26x2x19
+15x17x4
+11x7x14
+14x19x10
+9x10x1
+14x17x9
+20x19x13
+25x20x8
+24x20x21
+26x30x2
+24x2x10
+28x4x13
+27x17x11
+15x3x8
+11x29x10
+26x15x16
+4x28x22
+7x5x22
+10x28x9
+6x28x13
+10x5x6
+20x12x6
+25x30x30
+17x16x14
+14x20x3
+16x10x8
+9x28x14
+16x12x12
+11x13x25
+21x16x28
+10x3x18
+5x9x20
+17x23x5
+3x13x16
+29x30x17
+2x2x8
+15x8x30
+20x1x16
+23x10x29
+4x5x4
+6x18x12
+26x10x22
+21x10x17
+26x12x29
+7x20x21
+18x9x15
+10x23x20
+20x1x27
+10x10x3
+25x12x23
+30x11x15
+16x22x3
+22x10x11
+15x10x20
+2x20x17
+20x20x1
+24x16x4
+23x27x7
+7x27x22
+24x16x8
+20x11x25
+30x28x11
+21x6x24
+15x2x9
+16x30x24
+21x27x9
+7x19x8
+24x13x28
+12x26x28
+16x21x11
+25x5x13
+23x3x17
+23x1x17
+4x17x18
+17x13x18
+25x12x19
+17x4x19
+4x21x26
+6x28x1
+23x22x15
+6x23x12
+21x17x9
+30x4x23
+2x19x21
+28x24x7
+19x24x14
+13x20x26
+19x24x29
+8x26x3
+16x12x14
+17x4x21
+8x4x20
+13x27x17
+9x21x1
+29x25x6
+7x9x26
+13x25x5
+6x9x21
+12x10x11
+30x28x21
+15x6x2
+8x18x19
+26x20x24
+26x17x14
+27x8x1
+19x19x18
+25x24x27
+14x29x15
+22x26x1
+14x17x9
+2x6x23
+29x7x5
+14x16x19
+14x21x18
+10x15x23
+21x29x14
+20x29x30
+23x11x5
diff --git a/advent-day-3.input b/advent-day-3.input
new file mode 100644
index 0000000..e69cd4f
--- /dev/null
+++ b/advent-day-3.input
@@ -0,0 +1 @@
+^^<<v<<v><v^^<><>^^<v<v^>>^^^><^>v^>v><><><<vv^^<^>^^<v^>v>v^v>>>^<>v<^<v^><^>>>>><<v>>^>>^>v^>><<^>v>v<>^v^v^vvv><>^^>v><v<><>^><^^<vv^v<v>^v>>^v^>v><>v^<vv>^><<v^>vv^<<>v>>><<<>>^<vv<^<>^^vv>>>^><<<<vv^v^>>><><^>v<>^>v<v^v<^vv><^v^><<<<>^<>v>^v>v<v<v<<>v<^<<<v>>>>>^^v>vv^^<>^<>^^^^<^^^v<v^^>v<^^v^^>v>^v^^^^>><<v<>v<>^v^<v<>><>^^><<^^<^^>vv<>v^<^v<vv<<<>^>^^>^<>v^^vv<>>v><<<>vvv<>v<>><^<^v<>^vv>^^v<v<v><^<>>vv<^>>^>>vv^v<vv^vv<^<<>>^v^<>^>>>>vv>^^>v>vv>v><^vv^<<v>^<<^^<v<v>vv<v^^<>^^v>^>>v><^<<vv<<v^vv^^^v>>v<<v^><vv^><vv<^vv<<vv^v<<^v<^^v>><<v^>>^^<>v>><<v<>>^^<v>>^^>>vvv^><<<<<^<^vv<^<><v<<>^^^<<<^>^^^<v<<vv>vv<>^<>v<^v>^<<<v<v<v>>^v<>>v<<^<<v<<>^<<<><><>^>>>>^>v^v<<v<v<<>>vv<^vvv^^^^<vv>vv>^v^^v^<v^v><^vv<^vv>v<^>vv<>>^>^><vv<><^>v>^v>vvv<>^>^v<><>vv>><^v^<><><v>>v^v^><^<^>vv>v<^>vvv>v<<<<<^<v<<vv<^^^<<>>^v<vv<^<>v>^<v<>><><>^<<v>v^>^<vv>><><>>^>^>><^<v>^^>^^>^^v^^<^v^^>v^^>>><<><v<v<<v^vv<><><>^<v>^<<^^v^>v>><>^^^><^vvv<^^^^^v><<><v<^^v><><>>^>vv<vvvv<<>>><v<^^^^v<<^><v>^vv<v^^v^vv<^^>^^<v>><<v^>v<^^>^<^<v<^^v>^<<v>^>>>^v<>v<^^^>vvv^v<<^><>>><vvv^<^^^<^>>v>>><v>^^vvv^vvv<^^^^v^v^<vv^<v>^<<^>v^v^<<><>><^v><v<><<>><<<>^v>v<>^<v^v>^vv>>^<>v^^<<v><^v>>v<>>^v^^>><^>v^<^v^^>><>v^>^v^v<<<v^<v^^v<^>v<><>vv>>>>^>v<>v<<<>^^>vv^v<><v^<>^<<<<>>^^>^v<v^v<<><>^v<>>^v^<<^<^>>>^vv<><v<^^<>v^>>v<^^v<v>>>^>><<><<<>><vv<v>>^v>><^<v><vv>^vv<v<>>><>v^><>vv<^^v^^^v<>><^vvv<<^<>v>>>v>><v><>>><>><v^><v^v<v>^v>v<v>>^^<^>^>v><>vv>^v><<>>>>>>>^<<^vv^^vvvv<^^><<<v<<>vvv<>^><<v<v^v^<<v>v<>>^<vv^<v<v>^<<^^vv>v>^<vv<<>v<v^<>v>>^v^^vvvv>^^>>v^v^^><<^>v>>^^>^<^^<>v<v>vv^vv>v<v>>^v<><^vv^<vv<v^^^v<^v^>>^v>>>^^<^<^>^v^>^>>>^v>^>^^^>>^<>v^^<>^v<<^^>^^<vv<>v<^v^>><^v^>^<>>^vv^vv^>v^<vvvvvv^>><^^<^v<^<v^<<^^<<v^<^>><>v><^v^v^^^v>v^<>^<<v<^^vvv<v>^^>^v^^<><vv^v^>v^<<>>vv<>>>>v>v<>^>>>v<>^^><v<v^^^<>^<^><>^><<v>><>^<<>>><<^<vvv<^><v>>^vv^v>><v<>vv^<<^^<<><v><<^<v<vv<<^v^vv>v^>>>v<<<<v<<>v>^vv<^v><v<v>v<^>^^vv>v><v>><<v<<v^v>>><>^<>><><<^<<^v^v<<v>v>v<v<^^>vv<^v^^^<v^<<<v<>v^><^v>^<^<v>>^<<<v>>v^<><>>^v<>vvv<vvvvv<^^><^>><^^>^>^v^vv<^><<^v>><^^v>^v<>^>vvvv><^>^<<v^^vv<v^^<><>v>^>>^<^<<<^v^^^>^>>^>><><<^>v^^<v>>v<<<<vvv<vvvv^<^<v^^<>^>vvv^<vv^v^v>^<<><v><^v^v^^^>^^>^vv<>v>>v^>vv^vv>v<^v^^>>^v^v<>>^^><<v<<>><>>>^>^<>^^v^^><^<>><<^<vv^^^^^>>vv^<v^<^>>>>v<<><<^>vv>vvv>^<><>>>>vv><<v^v<^^^<<^^^vv^<v<><><<<<>><<v^<>v>v^><>v^v^^><>v>v>^^v<^v<>>^^^^^<v>><v^>^^<v>><v^^>v<^<^>>>^><^^>><<>>^><>^^^>v^^^>^^v^<>^^><^>>><><^>>v<v^>v<^><v<v^<>v<^v>v^<^vv^^><<<><><^v^<v<^^>v>v^>>^^vv^<v>^v>^<^v<>^>^><^<v>^v><^<^<>v^^>^><>>><<v><<><>v<<^v^^<^><>^<><><v>v<^^<v<v>>^^<<>>^<v>><^><^<^>^^v<>v>>><><<>^>v><><<<<v^^^^v<>>^^^v>><<^v>^>>><vv^>>^vv<^<>>^<^^<^v>v<v<<<<<>^<<^<<<<<^<^>>^><<>><>v^v>^<^>v^<><vvv^>^v^v^v><^<v<>vv<<^<>^^^<>^v>^<v^^<v^v>v<>>^>v<<>v<>v^v>v<<<>>v>vv>>v<<>v<>v<^>^>^<v>>v>^>^^^<vv>v<<>>><v>^vvv^^>^^<^vv^^^^>v>^v^>v^^v^>>^v>^vv>^^v^<<<<>^<><^<^<<^^>v^^^v<>>vvv<v>>vv><v<v>^<^v>>^v<vv^<<v<vv><^^v^v>v<>^v<<<^^v^^^<^v>v^v^v>><vvv<<>v<>^v>vv^v>vv<<^v<v>^v>v>><^v<v<>v>>>><<<><vv><>^v^<^vvv>v<>><^v>^>><v>vv<><><>v><>>><^>vv>>^<>v^>>^><<<^><<>^v^>>><><>vv>^<>^>^v^^><^>>><<>v^<^vv>^<^vv>><v<>vv<v><><<^><>v<^^<^>vv^^^^vv<<v><>vv<><v>v<>>>>^><v><>^<><>v<>><<>^^vvv>^^^<><>>vvv^v>><>vv<vv>^^^v^<<>^^v<><<^^v<>^^>^<^^v>>v^v^^>>v>>>^<<^<>^>^^v>>>><vv<<>^v<<vv><<^^vv><^>vv<>>v<v>v^>v>>v^<vv<<<v><v^>vvv^^>vv^<<v>v^>>v^<>>><><<^^<^v>^>>>v>v>^v<>vv><vv<vvv<<v>v>^v<<<>><<><><>v^>>>v^>v^>>vv^^<v>^<>>><^>v^<>^^><v>v<><<<><v^v<<<v<v^>v^v>^>v<^<>v>v^^>>v>vv^v<>>^^^^<>v^>>>>>>>><v<^<<vvv<^v^>^v<^<<>>><<<^<<^>^>v^<>^<<<>v>><^vv^>^>^>>>^<vv><v^^^<v^<v<><v^vvv<>v<vvv^vv<<<v^<^<^vvvv^<<vv<^v><<>^>^<v^v^<^>v^><>>v^>v^>^>>v<>vv^v<<>^^>>vv<>vv>>^v<^vv>^v>v<v^vvv^<<^><>v^<><vv><>v^^><<<><>^>^v^<>><vv<^>v^v>v<>><v<<^>^<vv<^v>^<<v><^<^^vv^<>><v^>^vv^<>>^^^^v>v><^^^v^<<<>^<^<<>><>>v<<^v^>><><v^>>^vv^v>vv>>>>>>^^<<>v^>v^v>^^>>><vv^^^v>^v>>^^^<>><>v^<<<v<vv^^<v^<<<>v>v^^^<vv<>>^v>^v<^<<><>vv>^^^<^^vv<v<<vv>^^>vv>v<<^>^vv><^><v>^^^^v<<vv>v^<<^^>>^^vvvv^v^>vv>>v^<v>vvv<>>^><>>v^^>>^<>>vvvv^>><v^v<^^<^vv>>v<<^<<^><v^^><v^>v^>><<<v>v>v^>^v<v^vv<^^^v<^<vvvvv<<vvv>><>v<v<v<<^v<><<>vv>><v>><^>>^^v>^>><>vv^><<>>vv<<<^<^^>^<<^>>>><v<^v<<<>>v>vv<^>^v><>>v<v^v<>v^vvvv>v^>>v><<^<v>^^v>>vv^^>v>^v>^v^^>^<^vv<v<<^>vv<<^>>^<<^^>>^<^>v^><^vv>^^v><v^>>><>v^v>^v<^><<<>vv><v>v<><>>v^<>^^>^<>^<<^>>vv^><^<v<^^vvv>>v^>>v^>v>vv><>>v<^>><<<v<<vv><v<v<v>v<v>vv^vvv^vv^>^>v><vv<v^^<>>>>vv^>^<>v<^>^<^v>vv<^<<>>^<^<vv><^^<>^<<v^v^>v<<><v>v>><^v<<^vvv>v>v<<^^<^^>v<vv<v<v^v>^^^>^>vv<v<<^^v^<v<^>^^^vv>v<>>>vv>><><^><><<<vvv<<^^v^<v^<<^>>vv>vv^v^>>><v><<v^v>>v>>vv>^^vvv^>^^>^>^>^v<<^vv^>vvv^^vv><^>^v^>^><>v<^^vv<v><v^<><^<>><v>^^v^v>v^vv<>><^v>^<^v>^<>^v>>>><<vv^^^vv^>>><vv^v>>v><^v^vv><<^v<<>^^<v><^v>vvv<><^^><<^v><>^<^v<^^<^vvvv^^>>>>vv>v>>>v<v^><<<<v>>v^><v>>vv^v<vv<>vv<>vvv>>>><>>><>^v<v^v><vvv<<v^^v^v<>>><>>^vv<<v<><<vv<v^>^^vv><^v^v<v^vvv^v>v^^^vv>^><^vvv<<>^vvv^<v<v^v>>>>^<<<><<<<<^v<^^>>>>^>^<v^^^v<vvv<vv^<>v<<<^<^>>v^<v><<><<^^vvv^>v<>>^^>v>^v>>v<v><v>>>>^<^<^>v^v<vv<>^>><>^<<^vvv^^<>^<vvv<>v^>^^<<^>^vv><vvv>>v^v^>v><v>^<^^<>^>^>>>^^vvv^<<>v^<<>><>v<^<^>v^>^vv><v<^<<<^v>^>>^<^v^<<<<^v^><v^v>v^><<v<><<v^<<^<<v<<v><v><><^^^^>v>^^<v>>v<vvv<<<>><>>^><<><^<>>^^>vv<^><^v^><vvv>>>vvv<<vv^<^^^<^>^<>>^>>^v^<^^v>^<v<<>^^v<^vv^><vvv>>^v><<^<v^<><><>>^>vv<<>^^^v^^<v<>><>>vv>v^>vvv^^v<vv<^<^>>^>>^>>v^<<<v^>v^<^v^vv^><^<^v<<v<<>v>^v^<<<v^vv<v<<>^^<v>>>^<v<^>^^v<v>>>><vv<^^<<>><<v<v>^^v^>>^^>>^v^<^v>v^v^v^v^>v^vv<><>^^<>^><^^^<<<^<v>v<<>^<^^^^^v^<^<<^^>^vv<>v^>><>>^>v>v<>^>v<v^>>><>^<><v>>>^>^>>v^><v<>v><^vv^>v<<v>v<><<vv<<v>^><^<v^>v<<v^v<<><v><>v<v><>^^<v<>><<>v>vv<<v>^v<v>vv><><>vv^<<>^>^<^>>>^v>v<^v^^^vv<>>>^<<^>>><<^^v^>v^<^v>vvv>v^^vv>^^>>v<>^<<>^<><^^v^>><>^>v>>^^^<<^^v<>^^>^<>^>><^>^vvv><^>^<^>^>>vv<^>>^v>>^<>>^^>>>v^<v>>v<<v<^>>v^^vv>v><^v^^><vv^v<^>v<<>v^^<><>^>vvv><^^^>^v^>v>>^vvv<^vv>^^>^>>v<>><<^v<<v^>^><>vv^<<^^vv><v>>^<^><^<v>^v<v>^<<>^v^^>v^>>^^^<^vv>v^>>>vv<<>v>>>^>v^^<v^v^^v^>>v<v<<v>^<<>>vv<<^v>v<<vv<<^<^v<^<><^^>v>>v>v^>><vv<^v<^>^>>v>^><<^<<>^v<v>>><^^<^<<<v^^>^>vv<<>^<>^<v^<<^v>vv>^^^v<^v><v<<<<<vv>vv>^^^^>v>v><<^<<<^vv><^<<<><v>><v^v>v<<v^^<v^>v>^v^v^<^<^vv>vvv<^^v<>v<<<<>v<v^<vvv^^^<<^<^<<>^<<><<<>v<^>^^v<^^v^>vv>vvv>v><v^^<<>>^><^>>v<<vv>v<<^^^v<<^v^^><><<<><<>v>^<<>v<<<^v>><v^v<^v<v^vv>v>><<^<><^v^^v<v>^>^>vvvv<<><<>>^<vv>^^><v<>v>v<v^^>^><>>><^><<><<<^<>v^><vv^^^^>>^v^>v^<>>v>^^><^<^v^<v^>>v>^vvv<>>v<v^v><>^vvvv<v^<<v^<<^^vv>><<<<<<v><<<v<v^v^^<v^^<>v<<<<^v<<><<v^<^><v<vv<v^v^<v^^vv<v^v<<<>^<<>vv<v<^>^<<><vv<<vv<v<^<^<>><^^<<>>>vv>>>>>>^v<v<>>v^v^^<v^<<<<>><<^v^^^<>^<vv>>>><>v^v^vvv^>>v>><v^v<<<^v>>^^<<^^vv><<<^^^<<<v><^^>>>>vvv^v<^>^^>v<^<><vv<v<>v>>>^vv<<^<v>^v^>^>^v>v>v^v^>v<<v>><>><v^^<<^>>>><<^v^<>^v<vv><>vvv^>v>v<v<v^>^<><><>^>>><v<<<v^vv><>^>^^<<v^>>v^^>^<v>><>><>v^v^^v>>>>vv>>^v<<^v^<>^>v^^>^^<<vvvvvvv>^<v^<<^<<>><<<^^^v^^^^v<^<>v<^^<>vv^^v^<>^<<^>>v>v<<<^^^^vvv^<^<><>v<<v^<^<>>><<><<<v<v<v><vv>^^<vv<<vv<<<v<^>^^vv<v<>><<>>>^v<<>^>>>v^>v>^^<>^<vv<><^>v>^>>>><>^^>v^^v>^vv^^v^><<<>>v<>v<vv<vv^v^v<^v^<^^><<<><vv^^>^<^<<>v>>>>^<<v>v<v>vv<^><^<v><<^>v>>v><<v<<^v^<>>^>>>^v^v>v^^vv^>^<^^>>^><^vv^^vv^<>>^^^^<^^><><v<>>^>>^><vv^>^vvv<^<<v^^<<<>^><>>>^^<><v<v<><<v^^^^^<^<^<<>><<>>>>^<<>>>^<^v^>><<^>>>^<<v>^>><>^<v>^<><v>^v^^vv<><^>vv^^v^<^^^v^vvv^>><>>v<<vv<>>^<^vvv<<^^><vvv^^<v<>vv^^<<>><v>><^^vvv<<<^>^<><^>vv^><^<<>vv<<v>>vv>v>v^<vv><vv><<>^^^^v^^^^<v>^<<^><><^^v^>v>^>><^><<>v^<v>>>^vvv>>^<^<>^^v^vv^^v><<vv^<>>>v<<<>v>^<>v<<>v^>^<<><<><v<v<v<>v^>v<><^^>^<^v^^><^>vv>^>vv<v<^v>vv>^^><<>vv^>^v<<^<<^<<>v<v<^<v>v>>^><v^^v^v>>>><v^v^<<<vv<<^^<>>v^v<^v>v>^^^v<v><v^^^vv<>v^v<^<>v><><v^<>>vv>v><>v>^v<><<<<<<v<>>v^vv<<<<v<<v><^<>^>><>^^vv>^<^<<>vv>>vv<vvv>><><v<>><^<v>^><^<<v>><v><v>^<v>><>v^^^^v<v^^v<>^^vv<>v<>v>^vv^><v^<<^<>^<>^^^>v^>>>v><<^>>v<^v<>^^<v<><v^v<v>v<><v<vv><<>v<^<^>v<>v^>v>^^<<<^^vv^<><<<>>v>^^<>v>>>><v<v<^^^v<v<v^><<>v^v<>v>><<<<v^<><^<<^>^<vvv<v^^v>>v^vv^><^v^^<>^^><<v^>>vv>^<v^vv<^^v<>>vvv<^v^>>^<v<v>>^>^^<<^>^>^v><>>^<^^v>^>>^^<><>>>^^>^^vvv>v<^^<>v^v^^<v<<^<v^v^<<>v^v<v<<v<>>><<^^^>>v>^vv>^>^^v<>^^<>v^^<><v<v<vvv^<vv<<>v^><<><v<>vv<<^vvvv><<<v>v>v^>v^<>v^>^<v<vvv^>^<>^>^^v<>><<<><v<^^>^v<v>^^v^v<<<^v^<>^<>v>^^>v<v<v>v>^^<<<><<^>v<v<^vv^v><^^<<vv>^<<v><>^>>>>><v^v<<<^>^v^v<<v<>vvv<<>v>v>>^v^v^>><<<<>v^<v<><<>>>^>>^>><<v>
diff --git a/advent-day-4.input b/advent-day-4.input
new file mode 100644
index 0000000..d75e0dc
--- /dev/null
+++ b/advent-day-4.input
@@ -0,0 +1 @@
+yzbqklnj
diff --git a/advent-day-5.input b/advent-day-5.input
new file mode 100644
index 0000000..a9b6e77
--- /dev/null
+++ b/advent-day-5.input
@@ -0,0 +1,1000 @@
+sszojmmrrkwuftyv
+isaljhemltsdzlum
+fujcyucsrxgatisb
+qiqqlmcgnhzparyg
+oijbmduquhfactbc
+jqzuvtggpdqcekgk
+zwqadogmpjmmxijf
+uilzxjythsqhwndh
+gtssqejjknzkkpvw
+wrggegukhhatygfi
+vhtcgqzerxonhsye
+tedlwzdjfppbmtdx
+iuvrelxiapllaxbg
+feybgiimfthtplui
+qxmmcnirvkzfrjwd
+vfarmltinsriqxpu
+oanqfyqirkraesfq
+xilodxfuxphuiiii
+yukhnchvjkfwcbiq
+bdaibcbzeuxqplop
+ivegnnpbiyxqsion
+ybahkbzpditgwdgt
+dmebdomwabxgtctu
+ibtvimgfaeonknoh
+jsqraroxudetmfyw
+dqdbcwtpintfcvuz
+tiyphjunlxddenpj
+fgqwjgntxagidhah
+nwenhxmakxqkeehg
+zdoheaxqpcnlhnen
+tfetfqojqcdzlpbm
+qpnxkuldeiituggg
+xwttlbdwxohahwar
+hjkwzadmtrkegzye
+koksqrqcfwcaxeof
+wulwmrptktliyxeq
+gyufbedqhhyqgqzj
+txpunzodohikzlmj
+jloqfuejfkemcrvu
+amnflshcheuddqtc
+pdvcsduggcogbiia
+yrioavgfmeafjpcz
+uyhbtmbutozzqfvq
+mwhgfwsgyuwcdzik
+auqylgxhmullxpaa
+lgelzivplaeoivzh
+uyvcepielfcmswoa
+qhirixgwkkccuzlp
+zoonniyosmkeejfg
+iayfetpixkedyana
+ictqeyzyqswdskiy
+ejsgqteafvmorwxe
+lhaiqrlqqwfbrqdx
+ydjyboqwhfpqfydc
+dwhttezyanrnbybv
+edgzkqeqkyojowvr
+rmjfdwsqamjqehdq
+ozminkgnkwqctrxz
+bztjhxpjthchhfcd
+vrtioawyxkivrpiq
+dpbcsznkpkaaclyy
+vpoypksymdwttpvz
+hhdlruwclartkyap
+bqkrcbrksbzcggbo
+jerbbbnxlwfvlaiw
+dwkasufidwjrjfbf
+kkfxtjhbnmqbmfwf
+vmnfziwqxmioukmj
+rqxvcultipkecdtu
+fhmfdibhtjzkiqsd
+hdpjbuzzbyafqrpd
+emszboysjuvwwvts
+msyigmwcuybfiooq
+druyksfnbluvnwoh
+fvgstvynnfbvxhsx
+bmzalvducnqtuune
+lzwkzfzttsvpllei
+olmplpvjamynfyfd
+padcwfkhystsvyfb
+wjhbvxkwtbfqdilb
+hruaqjwphonnterf
+bufjobjtvxtzjpmj
+oiedrjvmlbtwyyuy
+sgiemafwfztwsyju
+nsoqqfudrtwszyqf
+vonbxquiiwxnazyl
+yvnmjxtptujwqudn
+rrnybqhvrcgwvrkq
+taktoxzgotzxntfu
+quffzywzpxyaepxa
+rfvjebfiddcfgmwv
+iaeozntougqwnzoh
+scdqyrhoqmljhoil
+bfmqticltmfhxwld
+brbuktbyqlyfpsdl
+oidnyhjkeqenjlhd
+kujsaiqojopvrygg
+vebzobmdbzvjnjtk
+uunoygzqjopwgmbg
+piljqxgicjzgifso
+ikgptwcjzywswqnw
+pujqsixoisvhdvwi
+trtuxbgigogfsbbk
+mplstsqclhhdyaqk
+gzcwflvmstogdpvo
+tfjywbkmimyyqcjd
+gijutvhruqcsiznq
+ibxkhjvzzxgavkha
+btnxeqvznkxjsgmq
+tjgofgauxaelmjoq
+sokshvyhlkxerjrv
+ltogbivktqmtezta
+uduwytzvqvfluyuf
+msuckpthtgzhdxan
+fqmcglidvhvpirzr
+gwztkqpcwnutvfga
+bsjfgsrntdhlpqbx
+xloczbqybxmiopwt
+orvevzyjliomkkgu
+mzjbhmfjjvaziget
+tlsdxuhwdmghdyjb
+atoecyjhwmznaewi
+pyxpyvvipbqibiox
+ajbfmpqqobfsmesj
+siknbzefjblnohgd
+eqfhgewbblwdfkmc
+opylbscrotckkrbk
+lbwxbofgjkzdxkle
+ceixfjstaptdomvm
+hnkrqxifjmmjktie
+aqykzeuzvvetoygd
+fouahjimfcisxima
+prkzhutbqsyrhjzx
+qqwliakathnsbzne
+sayhgqtlcqqidqhj
+ygduolbysehdudra
+zricvxhdzznuxuce
+ucvzakslykpgsixd
+udirhgcttmyspgsb
+yuwzppjzfsjhhdzi
+gtqergjiuwookwre
+xvxexbjyjkxovvwf
+mlpaqhnnkqxrmwmm
+ezuqbrjozwuqafhb
+mcarusdthcbsonoq
+weeguqeheeiigrue
+pngtfugozxofaqxv
+copphvbjcmfspenv
+jiyahihykjjkdaya
+gdqnmesvptuyrfwp
+vbdscfywqmfxbohh
+crtrfuxyjypzubrg
+seihvevtxywxhflp
+fvvpmgttnapklwou
+qmqaqsajmqwhetpk
+zetxvrgjmblxvakr
+kpvwblrizaabmnhz
+mwpvvzaaicntrkcp
+clqyjiegtdsswqfm
+ymrcnqgcpldgfwtm
+nzyqpdenetncgnwq
+cmkzevgacnmdkqro
+kzfdsnamjqbeirhi
+kpxrvgvvxapqlued
+rzskbnfobevzrtqu
+vjoahbfwtydugzap
+ykbbldkoijlvicbl
+mfdmroiztsgjlasb
+quoigfyxwtwprmdr
+ekxjqafwudgwfqjm
+obtvyjkiycxfcdpb
+lhoihfnbuqelthof
+eydwzitgxryktddt
+rxsihfybacnpoyny
+bsncccxlplqgygtw
+rvmlaudsifnzhcqh
+huxwsyjyebckcsnn
+gtuqzyihwhqvjtes
+zreeyomtngvztveq
+nwddzjingsarhkxb
+nuqxqtctpoldrlsh
+wkvnrwqgjooovhpf
+kwgueyiyffudtbyg
+tpkzapnjxefqnmew
+ludwccvkihagvxal
+lfdtzhfadvabghna
+njqmlsnrkcfhtvbb
+cajzbqleghhnlgap
+vmitdcozzvqvzatp
+eelzefwqwjiywbcz
+uyztcuptfqvymjpi
+aorhnrpkjqqtgnfo
+lfrxfdrduoeqmwwp
+vszpjvbctblplinh
+zexhadgpqfifcqrz
+ueirfnshekpemqua
+qfremlntihbwabtb
+nwznunammfexltjc
+zkyieokaaogjehwt
+vlrxgkpclzeslqkq
+xrqrwfsuacywczhs
+olghlnfjdiwgdbqc
+difnlxnedpqcsrdf
+dgpuhiisybjpidsj
+vlwmwrikmitmoxbt
+sazpcmcnviynoktm
+pratafauetiknhln
+ilgteekhzwlsfwcn
+ywvwhrwhkaubvkbl
+qlaxivzwxyhvrxcf
+hbtlwjdriizqvjfb
+nrmsononytuwslsa
+mpxqgdthpoipyhjc
+mcdiwmiqeidwcglk
+vfbaeavmjjemfrmo
+qzcbzmisnynzibrc
+shzmpgxhehhcejhb
+wirtjadsqzydtyxd
+qjlrnjfokkqvnpue
+dxawdvjntlbxtuqc
+wttfmnrievfestog
+eamjfvsjhvzzaobg
+pbvfcwzjgxahlrag
+omvmjkqqnobvnzkn
+lcwmeibxhhlxnkzv
+uiaeroqfbvlazegs
+twniyldyuonfyzqw
+wgjkmsbwgfotdabi
+hnomamxoxvrzvtew
+ycrcfavikkrxxfgw
+isieyodknagzhaxy
+mgzdqwikzullzyco
+mumezgtxjrrejtrs
+nwmwjcgrqiwgfqel
+wjgxmebfmyjnxyyp
+durpspyljdykvzxf
+zuslbrpooyetgafh
+kuzrhcjwbdouhyme
+wyxuvbciodscbvfm
+kbnpvuqwmxwfqtqe
+zddzercqogdpxmft
+sigrdchxtgavzzjh
+lznjolnorbuddgcs
+ycnqabxlcajagwbt
+bnaudeaexahdgxsj
+rlnykxvoctfwanms
+jngyetkoplrstfzt
+tdpxknwacksotdub
+yutqgssfoptvizgr
+lzmqnxeqjfnsxmsa
+iqpgfsfmukovsdgu
+qywreehbidowtjyz
+iozamtgusdctvnkw
+ielmujhtmynlwcfd
+hzxnhtbnmmejlkyf
+ftbslbzmiqkzebtd
+bcwdqgiiizmohack
+dqhfkzeddjzbdlxu
+mxopokqffisxosci
+vciatxhtuechbylk
+khtkhcvelidjdena
+blatarwzfqcapkdt
+elamngegnczctcck
+xeicefdbwrxhuxuf
+sawvdhjoeahlgcdr
+kmdcimzsfkdfpnir
+axjayzqlosrduajb
+mfhzreuzzumvoggr
+iqlbkbhrkptquldb
+xcvztvlshiefuhgb
+pkvwyqmyoazocrio
+ajsxkdnerbmhyxaj
+tudibgsbnpnizvsi
+cxuiydkgdccrqvkh
+cyztpjesdzmbcpot
+nnazphxpanegwitx
+uphymczbmjalmsct
+yyxiwnlrogyzwqmg
+gmqwnahjvvdyhnfa
+utolskxpuoheugyl
+mseszdhyzoyavepd
+ycqknvbuvcjfgmlc
+sknrxhxbfpvpeorn
+zqxqjetooqcodwml
+sesylkpvbndrdhsy
+fryuxvjnsvnjrxlw
+mfxusewqurscujnu
+mbitdjjtgzchvkfv
+ozwlyxtaalxofovd
+wdqcduaykxbunpie
+rlnhykxiraileysk
+wgoqfrygttlamobg
+kflxzgxvcblkpsbz
+tmkisflhativzhde
+owsdrfgkaamogjzd
+gaupjkvkzavhfnes
+wknkurddcknbdleg
+lltviwincmbtduap
+qwzvspgbcksyzzmb
+ydzzkumecryfjgnk
+jzvmwgjutxoysaam
+icrwpyhxllbardkr
+jdopyntshmvltrve
+afgkigxcuvmdbqou
+mfzzudntmvuyhjzt
+duxhgtwafcgrpihc
+tsnhrkvponudumeb
+sqtvnbeiigdzbjgv
+eczmkqwvnsrracuo
+mhehsgqwiczaiaxv
+kaudmfvifovrimpd
+lupikgivechdbwfr
+mwaaysrndiutuiqx
+aacuiiwgaannunmm
+tjqjbftaqitukwzp
+lrcqyskykbjpaekn
+lirrvofbcqpjzxmr
+jurorvzpplyelfml
+qonbllojmloykjqe
+sllkzqujfnbauuqp
+auexjwsvphvikali
+usuelbssqmbrkxyc
+wyuokkfjexikptvv
+wmfedauwjgbrgytl
+sfwvtlzzebxzmuvw
+rdhqxuechjsjcvaf
+kpavhqkukugocsxu
+ovnjtumxowbxduts
+zgerpjufauptxgat
+pevvnzjfwhjxdoxq
+pmmfwxajgfziszcs
+difmeqvaghuitjhs
+icpwjbzcmlcterwm
+ngqpvhajttxuegyh
+mosjlqswdngwqsmi
+frlvgpxrjolgodlu
+eazwgrpcxjgoszeg
+bbtsthgkjrpkiiyk
+tjonoglufuvsvabe
+xhkbcrofytmbzrtk
+kqftfzdmpbxjynps
+kmeqpocbnikdtfyv
+qjjymgqxhnjwxxhp
+dmgicrhgbngdtmjt
+zdxrhdhbdutlawnc
+afvoekuhdboxghvx
+hiipezngkqcnihty
+bbmqgheidenweeov
+suprgwxgxwfsgjnx
+adeagikyamgqphrj
+zzifqinoeqaorjxg
+adhgppljizpaxzld
+lvxyieypvvuqjiyc
+nljoakatwwwoovzn
+fcrkfxclcacshhmx
+ownnxqtdhqbgthch
+lmfylrcdmdkgpwnj
+hlwjfbvlswbzpbjr
+mkofhdtljdetcyvp
+synyxhifbetzarpo
+agnggugngadrcxoc
+uhttadmdmhidpyjw
+ohfwjfhunalbubpr
+pzkkkkwrlvxiuysn
+kmidbxmyzkjrwjhu
+egtitdydwjxmajnw
+civoeoiuwtwgbqqs
+dfptsguzfinqoslk
+tdfvkreormspprer
+zvnvbrmthatzztwi
+ffkyddccrrfikjde
+hrrmraevdnztiwff
+qaeygykcpbtjwjbr
+purwhitkmrtybslh
+qzziznlswjaussel
+dfcxkvdpqccdqqxj
+tuotforulrrytgyn
+gmtgfofgucjywkev
+wkyoxudvdkbgpwhd
+qbvktvfvipftztnn
+otckgmojziezmojb
+inxhvzbtgkjxflay
+qvxapbiatuudseno
+krpvqosbesnjntut
+oqeukkgjsfuqkjbb
+prcjnyymnqwqksiz
+vuortvjxgckresko
+orqlyobvkuwgathr
+qnpyxlnazyfuijox
+zwlblfkoklqmqzkw
+hmwurwtpwnrcsanl
+jzvxohuakopuzgpf
+sfcpnxrviphhvxmx
+qtwdeadudtqhbely
+dbmkmloasqphnlgj
+olylnjtkxgrubmtk
+nxsdbqjuvwrrdbpq
+wbabpirnpcsmpipw
+hjnkyiuxpqrlvims
+enzpntcjnxdpuqch
+vvvqhlstzcizyimn
+triozhqndbttglhv
+fukvgteitwaagpzx
+uhcvukfbmrvskpen
+tizcyupztftzxdmt
+vtkpnbpdzsaluczz
+wodfoyhoekidxttm
+otqocljrmwfqbxzu
+linfbsnfvixlwykn
+vxsluutrwskslnye
+zbshygtwugixjvsi
+zdcqwxvwytmzhvoo
+wrseozkkcyctrmei
+fblgtvogvkpqzxiy
+opueqnuyngegbtnf
+qxbovietpacqqxok
+zacrdrrkohfygddn
+gbnnvjqmkdupwzpq
+qgrgmsxeotozvcak
+hnppukzvzfmlokid
+dzbheurndscrrtcl
+wbgdkadtszebbrcw
+fdmzppzphhpzyuiz
+bukomunhrjrypohj
+ohodhelegxootqbj
+rsplgzarlrknqjyh
+punjjwpsxnhpzgvu
+djdfahypfjvpvibm
+mlgrqsmhaozatsvy
+xwktrgyuhqiquxgn
+wvfaoolwtkbrisvf
+plttjdmguxjwmeqr
+zlvvbwvlhauyjykw
+cigwkbyjhmepikej
+masmylenrusgtyxs
+hviqzufwyetyznze
+nzqfuhrooswxxhus
+pdbdetaqcrqzzwxf
+oehmvziiqwkzhzib
+icgpyrukiokmytoy
+ooixfvwtiafnwkce
+rvnmgqggpjopkihs
+wywualssrmaqigqk
+pdbvflnwfswsrirl
+jeaezptokkccpbuj
+mbdwjntysntsaaby
+ldlgcawkzcwuxzpz
+lwktbgrzswbsweht
+ecspepmzarzmgpjm
+qmfyvulkmkxjncai
+izftypvwngiukrns
+zgmnyjfeqffbooww
+nyrkhggnprhedows
+yykzzrjmlevgffah
+mavaemfxhlfejfki
+cmegmfjbkvpncqwf
+zxidlodrezztcrij
+fseasudpgvgnysjv
+fupcimjupywzpqzp
+iqhgokavirrcvyys
+wjmkcareucnmfhui
+nftflsqnkgjaexhq
+mgklahzlcbapntgw
+kfbmeavfxtppnrxn
+nuhyvhknlufdynvn
+nviogjxbluwrcoec
+tyozixxxaqiuvoys
+kgwlvmvgtsvxojpr
+moeektyhyonfdhrb
+kahvevmmfsmiiqex
+xcywnqzcdqtvhiwd
+fnievhiyltbvtvem
+jlmndqufirwgtdxd
+muypbfttoeelsnbs
+rypxzbnujitfwkou
+ubmmjbznskildeoj
+ofnmizdeicrmkjxp
+rekvectjbmdnfcib
+yohrojuvdexbctdh
+gwfnfdeibynzjmhz
+jfznhfcqdwlpjull
+scrinzycfhwkmmso
+mskutzossrwoqqsi
+rygoebkzgyzushhr
+jpjqiycflqkexemx
+arbufysjqmgaapnl
+dbjerflevtgweeoj
+snybnnjlmwjvhois
+fszuzplntraprmbj
+mkvaatolvuggikvg
+zpuzuqygoxesnuyc
+wnpxvmxvllxalulm
+eivuuafkvudeouwy
+rvzckdyixetfuehr
+qgmnicdoqhveahyx
+miawwngyymshjmpj
+pvckyoncpqeqkbmx
+llninfenrfjqxurv
+kzbjnlgsqjfuzqtp
+rveqcmxomvpjcwte
+bzotkawzbopkosnx
+ktqvpiribpypaymu
+wvlzkivbukhnvram
+uohntlcoguvjqqdo
+ajlsiksjrcnzepkt
+xsqatbldqcykwusd
+ihbivgzrwpmowkop
+vfayesfojmibkjpb
+uaqbnijtrhvqxjtb
+hhovshsfmvkvymba
+jerwmyxrfeyvxcgg
+hncafjwrlvdcupma
+qyvigggxfylbbrzt
+hiiixcyohmvnkpgk
+mmitpwopgxuftdfu
+iaxderqpceboixoa
+zodfmjhuzhnsqfcb
+sthtcbadrclrazsi
+bkkkkcwegvypbrio
+wmpcofuvzemunlhj
+gqwebiifvqoeynro
+juupusqdsvxcpsgv
+rbhdfhthxelolyse
+kjimpwnjfrqlqhhz
+rcuigrjzarzpjgfq
+htxcejfyzhydinks
+sxucpdxhvqjxxjwf
+omsznfcimbcwaxal
+gufmtdlhgrsvcosb
+bssshaqujtmluerz
+uukotwjkstgwijtr
+kbqkneobbrdogrxk
+ljqopjcjmelgrakz
+rwtfnvnzryujwkfb
+dedjjbrndqnilbeh
+nzinsxnpptzagwlb
+lwqanydfirhnhkxy
+hrjuzfumbvfccxno
+okismsadkbseumnp
+sfkmiaiwlktxqvwa
+hauwpjjwowbunbjj
+nowkofejwvutcnui
+bqzzppwoslaeixro
+urpfgufwbtzenkpj
+xgeszvuqwxeykhef
+yxoldvkyuikwqyeq
+onbbhxrnmohzskgg
+qcikuxakrqeugpoa
+lnudcqbtyzhlpers
+nxduvwfrgzaailgl
+xniuwvxufzxjjrwz
+ljwithcqmgvntjdj
+awkftfagrfzywkhs
+uedtpzxyubeveuek
+bhcqdwidbjkqqhzl
+iyneqjdmlhowwzxx
+kvshzltcrrururty
+zgfpiwajegwezupo
+tkrvyanujjwmyyri
+ercsefuihcmoaiep
+ienjrxpmetinvbos
+jnwfutjbgenlipzq
+bgohjmrptfuamzbz
+rtsyamajrhxbcncw
+tfjdssnmztvbnscs
+bgaychdlmchngqlp
+kfjljiobynhwfkjo
+owtdxzcpqleftbvn
+ltjtimxwstvzwzjj
+wbrvjjjajuombokf
+zblpbpuaqbkvsxye
+gwgdtbpnlhyqspdi
+abipqjihjqfofmkx
+nlqymnuvjpvvgova
+avngotmhodpoufzn
+qmdyivtzitnrjuae
+xfwjmqtqdljuerxi
+csuellnlcyqaaamq
+slqyrcurcyuoxquo
+dcjmxyzbzpohzprl
+uqfnmjwniyqgsowb
+rbmxpqoblyxdocqc
+ebjclrdbqjhladem
+ainnfhxnsgwqnmyo
+eyytjjwhvodtzquf
+iabjgmbbhilrcyyp
+pqfnehkivuelyccc
+xgjbyhfgmtseiimt
+jwxyqhdbjiqqqeyy
+gxsbrncqkmvaryln
+vhjisxjkinaejytk
+seexagcdmaedpcvh
+lvudfgrcpjxzdpvd
+fxtegyrqjzhmqean
+dnoiseraqcoossmc
+nwrhmwwbykvwmgep
+udmzskejvizmtlce
+hbzvqhvudfdlegaa
+cghmlfqejbxewskv
+bntcmjqfwomtbwsb
+qezhowyopjdyhzng
+todzsocdkgfxanbz
+zgjkssrjlwxuhwbk
+eibzljqsieriyrzr
+wamxvzqyycrxotjp
+epzvfkispwqynadu
+dwlpfhtrafrxlyie
+qhgzujhgdruowoug
+girstvkahaemmxvh
+baitcrqmxhazyhbl
+xyanqcchbhkajdmc
+gfvjmmcgfhvgnfdq
+tdfdbslwncbnkzyz
+jojuselkpmnnbcbb
+hatdslkgxtqpmavj
+dvelfeddvgjcyxkj
+gnsofhkfepgwltse
+mdngnobasfpewlno
+qssnbcyjgmkyuoga
+glvcmmjytmprqwvn
+gwrixumjbcdffsdl
+lozravlzvfqtsuiq
+sicaflbqdxbmdlch
+inwfjkyyqbwpmqlq
+cuvszfotxywuzhzi
+igfxyoaacoarlvay
+ucjfhgdmnjvgvuni
+rvvkzjsytqgiposh
+jduinhjjntrmqroz
+yparkxbgsfnueyll
+lyeqqeisxzfsqzuj
+woncskbibjnumydm
+lltucklragtjmxtl
+ubiyvmyhlesfxotj
+uecjseeicldqrqww
+xxlxkbcthufnjbnm
+lhqijovvhlffpxga
+fzdgqpzijitlogjz
+efzzjqvwphomxdpd
+jvgzvuyzobeazssc
+hejfycgxywfjgbfw
+yhjjmvkqfbnbliks
+sffvfyywtlntsdsz
+dwmxqudvxqdenrur
+asnukgppdemxrzaz
+nwqfnumblwvdpphx
+kqsmkkspqvxzuket
+cpnraovljzqiquaz
+qrzgrdlyyzbyykhg
+opoahcbiydyhsmqe
+hjknnfdauidjeydr
+hczdjjlygoezadow
+rtflowzqycimllfv
+sfsrgrerzlnychhq
+bpahuvlblcolpjmj
+albgnjkgmcrlaicl
+pijyqdhfxpaxzdex
+eeymiddvcwkpbpux
+rqwkqoabywgggnln
+vckbollyhgbgmgwh
+ylzlgvnuvpynybkm
+hpmbxtpfosbsjixt
+ocebeihnhvkhjfqz
+tvctyxoujdgwayze
+efvhwxtuhapqxjen
+rusksgefyidldmpo
+nkmtjvddfmhirmzz
+whvtsuadwofzmvrt
+iiwjqvsdxudhdzzk
+gucirgxaxgcassyo
+rmhfasfzexeykwmr
+hynlxcvsbgosjbis
+huregszrcaocueen
+pifezpoolrnbdqtv
+unatnixzvdbqeyox
+xtawlpduxgacchfe
+bdvdbflqfphndduf
+xtdsnjnmzccfptyt
+nkhsdkhqtzqbphhg
+aqcubmfkczlaxiyb
+moziflxpsfubucmv
+srdgnnjtfehiimqx
+pwfalehdfyykrohf
+sysxssmvewyfjrve
+brsemdzosgqvvlxe
+bimbjoshuvflkiat
+hkgjasmljkpkwwku
+sbnmwjvodygobpqc
+bbbqycejueruihhd
+corawswvlvneipyc
+gcyhknmwsczcxedh
+kppakbffdhntmcqp
+ynulzwkfaemkcefp
+pyroowjekeurlbii
+iwksighrswdcnmxf
+glokrdmugreygnsg
+xkmvvumnfzckryop
+aesviofpufygschi
+csloawlirnegsssq
+fkqdqqmlzuxbkzbc
+uzlhzcfenxdfjdzp
+poaaidrktteusvyf
+zrlyfzmjzfvivcfr
+qwjulskbniitgqtx
+gjeszjksbfsuejki
+vczdejdbfixbduaq
+knjdrjthitjxluth
+jweydeginrnicirl
+bottrfgccqhyycsl
+eiquffofoadmbuhk
+lbqfutmzoksscswf
+xfmdvnvfcnzjprba
+uvugkjbkhlaoxmyx
+wadlgtpczgvcaqqv
+inzrszbtossflsxk
+dbzbtashaartczrj
+qbjiqpccefcfkvod
+hluujmokjywotvzy
+thwlliksfztcmwzh
+arahybspdaqdexrq
+nuojrmsgyipdvwyx
+hnajdwjwmzattvst
+sulcgaxezkprjbgu
+rjowuugwdpkjtypw
+oeugzwuhnrgiaqga
+wvxnyymwftfoswij
+pqxklzkjpcqscvde
+tuymjzknntekglqj
+odteewktugcwlhln
+exsptotlfecmgehc
+eeswfcijtvzgrqel
+vjhrkiwmunuiwqau
+zhlixepkeijoemne
+pavfsmwesuvebzdd
+jzovbklnngfdmyws
+nbajyohtzfeoiixz
+ciozmhrsjzrwxvhz
+gwucrxieqbaqfjuv
+uayrxrltnohexawc
+flmrbhwsfbcquffm
+gjyabmngkitawlxc
+rwwtggvaygfbovhg
+xquiegaisynictjq
+oudzwuhexrwwdbyy
+lengxmguyrwhrebb
+uklxpglldbgqsjls
+dbmvlfeyguydfsxq
+zspdwdqcrmtmdtsc
+mqfnzwbfqlauvrgc
+amcrkzptgacywvhv
+ndxmskrwrqysrndf
+mwjyhsufeqhwisju
+srlrukoaenyevykt
+tnpjtpwawrxbikct
+geczalxmgxejulcv
+tvkcbqdhmuwcxqci
+tiovluvwezwwgaox
+zrjhtbgajkjqzmfo
+vcrywduwsklepirs
+lofequdigsszuioy
+wxsdzomkjqymlzat
+iabaczqtrfbmypuy
+ibdlmudbajikcncr
+rqcvkzsbwmavdwnv
+ypxoyjelhllhbeog
+fdnszbkezyjbttbg
+uxnhrldastpdjkdz
+xfrjbehtxnlyzcka
+omjyfhbibqwgcpbv
+eguucnoxaoprszmp
+xfpypldgcmcllyzz
+aypnmgqjxjqceelv
+mgzharymejlafvgf
+tzowgwsubbaigdok
+ilsehjqpcjwmylxc
+pfmouwntfhfnmrwk
+csgokybgdqwnduwp
+eaxwvxvvwbrovypz
+nmluqvobbbmdiwwb
+lnkminvfjjzqbmio
+mjiiqzycqdhfietz
+towlrzriicyraevq
+obiloewdvbrsfwjo
+lmeooaajlthsfltw
+ichygipzpykkesrw
+gfysloxmqdsfskvt
+saqzntehjldvwtsx
+pqddoemaufpfcaew
+mjrxvbvwcreaybwe
+ngfbrwfqnxqosoai
+nesyewxreiqvhald
+kqhqdlquywotcyfy
+liliptyoqujensfi
+nsahsaxvaepzneqq
+zaickulfjajhctye
+gxjzahtgbgbabtht
+koxbuopaqhlsyhrp
+jhzejdjidqqtjnwe
+dekrkdvprfqpcqki
+linwlombdqtdeyop
+dvckqqbnigdcmwmx
+yaxygbjpzkvnnebv
+rlzkdkgaagmcpxah
+cfzuyxivtknirqvt
+obivkajhsjnrxxhn
+lmjhayymgpseuynn
+bbjyewkwadaipyju
+lmzyhwomfypoftuu
+gtzhqlgltvatxack
+jfflcfaqqkrrltgq
+txoummmnzfrlrmcg
+ohemsbfuqqpucups
+imsfvowcbieotlok
+tcnsnccdszxfcyde
+qkcdtkwuaquajazz
+arcfnhmdjezdbqku
+srnocgyqrlcvlhkb
+mppbzvfmcdirbyfw
+xiuarktilpldwgwd
+ypufwmhrvzqmexpc
+itpdnsfkwgrdujmj
+cmpxnodtsswkyxkr
+wayyxtjklfrmvbfp
+mfaxphcnjczhbbwy
+sjxhgwdnqcofbdra
+pnxmujuylqccjvjm
+ivamtjbvairwjqwl
+deijtmzgpfxrclss
+bzkqcaqagsynlaer
+tycefobvxcvwaulz
+ctbhnywezxkdsswf
+urrxxebxrthtjvib
+fpfelcigwqwdjucv
+ngfcyyqpqulwcphb
+rltkzsiipkpzlgpw
+qfdsymzwhqqdkykc
+balrhhxipoqzmihj
+rnwalxgigswxomga
+ghqnxeogckshphgr
+lyyaentdizaumnla
+exriodwfzosbeoib
+speswfggibijfejk
+yxmxgfhvmshqszrq
+hcqhngvahzgawjga
+qmhlsrfpesmeksur
+eviafjejygakodla
+kvcfeiqhynqadbzv
+fusvyhowslfzqttg
+girqmvwmcvntrwau
+yuavizroykfkdekz
+jmcwohvmzvowrhxf
+kzimlcpavapynfue
+wjudcdtrewfabppq
+yqpteuxqgbmqfgxh
+xdgiszbuhdognniu
+jsguxfwhpftlcjoh
+whakkvspssgjzxre
+ggvnvjurlyhhijgm
+krvbhjybnpemeptr
+pqedgfojyjybfbzr
+jzhcrsgmnkwwtpdo
+yyscxoxwofslncmp
+gzjhnxytmyntzths
+iteigbnqbtpvqumi
+zjevfzusnjukqpfw
+xippcyhkfuounxqk
+mcnhrcfonfdgpkyh
+pinkcyuhjkexbmzj
+lotxrswlxbxlxufs
+fmqajrtoabpckbnu
+wfkwsgmcffdgaqxg
+qfrsiwnohoyfbidr
+czfqbsbmiuyusaqs
+ieknnjeecucghpoo
+cevdgqnugupvmsge
+gjkajcyjnxdrtuvr
+udzhrargnujxiclq
+zqqrhhmjwermjssg
+ggdivtmgoqajydzz
+wnpfsgtxowkjiivl
+afbhqawjbotxnqpd
+xjpkifkhfjeqifdn
+oyfggzsstfhvticp
+kercaetahymeawxy
+khphblhcgmbupmzt
+iggoqtqpvaebtiol
+ofknifysuasshoya
+qxuewroccsbogrbv
+apsbnbkiopopytgu
+zyahfroovfjlythh
+bxhjwfgeuxlviydq
+uvbhdtvaypasaswa
+qamcjzrmesqgqdiz
+hjnjyzrxntiycyel
+wkcrwqwniczwdxgq
+hibxlvkqakusswkx
+mzjyuenepwdgrkty
+tvywsoqslfsulses
+jqwcwuuisrclircv
+xanwaoebfrzhurct
+ykriratovsvxxasf
+qyebvtqqxbjuuwuo
+telrvlwvriylnder
+acksrrptgnhkeiaa
+yemwfjhiqlzsvdxf
+banrornfkcymmkcc
+ytbhxvaeiigjpcgm
+crepyazgxquposkn
+xlqwdrytzwnxzwzv
+xtrbfbwopxscftps
+kwbytzukgseeyjla
+qtfdvavvjogybxjg
+ytbmvmrcxwfkgvzw
+nbscbdskdeocnfzr
+sqquwjbdxsxhcseg
+ewqxhigqcgszfsuw
+cvkyfcyfmubzwsee
+dcoawetekigxgygd
+ohgqnqhfimyuqhvi
+otisopzzpvnhctte
+bauieohjejamzien
+ewnnopzkujbvhwce
+aeyqlskpaehagdiv
+pncudvivwnnqspxy
+ytugesilgveokxcg
+zoidxeelqdjesxpr
+ducjccsuaygfchzj
+smhgllqqqcjfubfc
+nlbyyywergronmir
+prdawpbjhrzsbsvj
+nmgzhnjhlpcplmui
+eflaogtjghdjmxxz
+qolvpngucbkprrdc
+ixywxcienveltgho
+mwnpqtocagenkxut
+iskrfbwxonkguywx
+ouhtbvcaczqzmpua
+srewprgddfgmdbao
+dyufrltacelchlvu
+czmzcbrkecixuwzz
+dtbeojcztzauofuk
+prrgoehpqhngfgmw
+baolzvfrrevxsyke
+zqadgxshwiarkzwh
+vsackherluvurqqj
+surbpxdulvcvgjbd
+wqxytarcxzgxhvtx
+vbcubqvejcfsgrac
+zqnjfeapshjowzja
+hekvbhtainkvbynx
+knnugxoktxpvoxnh
+knoaalcefpgtvlwm
+qoakaunowmsuvkus
+ypkvlzcduzlezqcb
+ujhcagawtyepyogh
+wsilcrxncnffaxjf
+gbbycjuscquaycrk
+aduojapeaqwivnly
+ceafyxrakviagcjy
+nntajnghicgnrlst
+vdodpeherjmmvbje
+wyyhrnegblwvdobn
+xlfurpghkpbzhhif
+xyppnjiljvirmqjo
+kglzqahipnddanpi
+omjateouxikwxowr
+ocifnoopfglmndcx
+emudcukfbadyijev
+ooktviixetfddfmh
+wtvrhloyjewdeycg
+cgjncqykgutfjhvb
+nkwvpswppeffmwad
+hqbcmfhzkxmnrivg
+mdskbvzguxvieilr
+anjcvqpavhdloaqh
+erksespdevjylenq
+fadxwbmisazyegup
+iyuiffjmcaahowhj
+ygkdezmynmltodbv
+fytneukxqkjattvh
+woerxfadbfrvdcnz
+iwsljvkyfastccoa
+movylhjranlorofe
+drdmicdaiwukemep
+knfgtsmuhfcvvshg
+ibstpbevqmdlhajn
+tstwsswswrxlzrqs
+estyydmzothggudf
+jezogwvymvikszwa
+izmqcwdyggibliet
+nzpxbegurwnwrnca
+kzkojelnvkwfublh
+xqcssgozuxfqtiwi
+tcdoigumjrgvczfv
+ikcjyubjmylkwlwq
+kqfivwystpqzvhan
+bzukgvyoqewniivj
+iduapzclhhyfladn
+fbpyzxdfmkrtfaeg
+yzsmlbnftftgwadz
diff --git a/advent-day-6.input b/advent-day-6.input
new file mode 100644
index 0000000..c4357c6
--- /dev/null
+++ b/advent-day-6.input
@@ -0,0 +1,300 @@
+turn on 887,9 through 959,629
+turn on 454,398 through 844,448
+turn off 539,243 through 559,965
+turn off 370,819 through 676,868
+turn off 145,40 through 370,997
+turn off 301,3 through 808,453
+turn on 351,678 through 951,908
+toggle 720,196 through 897,994
+toggle 831,394 through 904,860
+toggle 753,664 through 970,926
+turn off 150,300 through 213,740
+turn on 141,242 through 932,871
+toggle 294,259 through 474,326
+toggle 678,333 through 752,957
+toggle 393,804 through 510,976
+turn off 6,964 through 411,976
+turn off 33,572 through 978,590
+turn on 579,693 through 650,978
+turn on 150,20 through 652,719
+turn off 782,143 through 808,802
+turn off 240,377 through 761,468
+turn off 899,828 through 958,967
+turn on 613,565 through 952,659
+turn on 295,36 through 964,978
+toggle 846,296 through 969,528
+turn off 211,254 through 529,491
+turn off 231,594 through 406,794
+turn off 169,791 through 758,942
+turn on 955,440 through 980,477
+toggle 944,498 through 995,928
+turn on 519,391 through 605,718
+toggle 521,303 through 617,366
+turn off 524,349 through 694,791
+toggle 391,87 through 499,792
+toggle 562,527 through 668,935
+turn off 68,358 through 857,453
+toggle 815,811 through 889,828
+turn off 666,61 through 768,87
+turn on 27,501 through 921,952
+turn on 953,102 through 983,471
+turn on 277,552 through 451,723
+turn off 64,253 through 655,960
+turn on 47,485 through 734,977
+turn off 59,119 through 699,734
+toggle 407,898 through 493,955
+toggle 912,966 through 949,991
+turn on 479,990 through 895,990
+toggle 390,589 through 869,766
+toggle 593,903 through 926,943
+toggle 358,439 through 870,528
+turn off 649,410 through 652,875
+turn on 629,834 through 712,895
+toggle 254,555 through 770,901
+toggle 641,832 through 947,850
+turn on 268,448 through 743,777
+turn off 512,123 through 625,874
+turn off 498,262 through 930,811
+turn off 835,158 through 886,242
+toggle 546,310 through 607,773
+turn on 501,505 through 896,909
+turn off 666,796 through 817,924
+toggle 987,789 through 993,809
+toggle 745,8 through 860,693
+toggle 181,983 through 731,988
+turn on 826,174 through 924,883
+turn on 239,228 through 843,993
+turn on 205,613 through 891,667
+toggle 867,873 through 984,896
+turn on 628,251 through 677,681
+toggle 276,956 through 631,964
+turn on 78,358 through 974,713
+turn on 521,360 through 773,597
+turn off 963,52 through 979,502
+turn on 117,151 through 934,622
+toggle 237,91 through 528,164
+turn on 944,269 through 975,453
+toggle 979,460 through 988,964
+turn off 440,254 through 681,507
+toggle 347,100 through 896,785
+turn off 329,592 through 369,985
+turn on 931,960 through 979,985
+toggle 703,3 through 776,36
+toggle 798,120 through 908,550
+turn off 186,605 through 914,709
+turn off 921,725 through 979,956
+toggle 167,34 through 735,249
+turn on 726,781 through 987,936
+toggle 720,336 through 847,756
+turn on 171,630 through 656,769
+turn off 417,276 through 751,500
+toggle 559,485 through 584,534
+turn on 568,629 through 690,873
+toggle 248,712 through 277,988
+toggle 345,594 through 812,723
+turn off 800,108 through 834,618
+turn off 967,439 through 986,869
+turn on 842,209 through 955,529
+turn on 132,653 through 357,696
+turn on 817,38 through 973,662
+turn off 569,816 through 721,861
+turn on 568,429 through 945,724
+turn on 77,458 through 844,685
+turn off 138,78 through 498,851
+turn on 136,21 through 252,986
+turn off 2,460 through 863,472
+turn on 172,81 through 839,332
+turn on 123,216 through 703,384
+turn off 879,644 through 944,887
+toggle 227,491 through 504,793
+toggle 580,418 through 741,479
+toggle 65,276 through 414,299
+toggle 482,486 through 838,931
+turn off 557,768 through 950,927
+turn off 615,617 through 955,864
+turn on 859,886 through 923,919
+turn on 391,330 through 499,971
+toggle 521,835 through 613,847
+turn on 822,787 through 989,847
+turn on 192,142 through 357,846
+turn off 564,945 through 985,945
+turn off 479,361 through 703,799
+toggle 56,481 through 489,978
+turn off 632,991 through 774,998
+toggle 723,526 through 945,792
+turn on 344,149 through 441,640
+toggle 568,927 through 624,952
+turn on 621,784 through 970,788
+toggle 665,783 through 795,981
+toggle 386,610 through 817,730
+toggle 440,399 through 734,417
+toggle 939,201 through 978,803
+turn off 395,883 through 554,929
+turn on 340,309 through 637,561
+turn off 875,147 through 946,481
+turn off 945,837 through 957,922
+turn off 429,982 through 691,991
+toggle 227,137 through 439,822
+toggle 4,848 through 7,932
+turn off 545,146 through 756,943
+turn on 763,863 through 937,994
+turn on 232,94 through 404,502
+turn off 742,254 through 930,512
+turn on 91,931 through 101,942
+toggle 585,106 through 651,425
+turn on 506,700 through 567,960
+turn off 548,44 through 718,352
+turn off 194,827 through 673,859
+turn off 6,645 through 509,764
+turn off 13,230 through 821,361
+turn on 734,629 through 919,631
+toggle 788,552 through 957,972
+toggle 244,747 through 849,773
+turn off 162,553 through 276,887
+turn off 569,577 through 587,604
+turn off 799,482 through 854,956
+turn on 744,535 through 909,802
+toggle 330,641 through 396,986
+turn off 927,458 through 966,564
+toggle 984,486 through 986,913
+toggle 519,682 through 632,708
+turn on 984,977 through 989,986
+toggle 766,423 through 934,495
+turn on 17,509 through 947,718
+turn on 413,783 through 631,903
+turn on 482,370 through 493,688
+turn on 433,859 through 628,938
+turn off 769,549 through 945,810
+turn on 178,853 through 539,941
+turn off 203,251 through 692,433
+turn off 525,638 through 955,794
+turn on 169,70 through 764,939
+toggle 59,352 through 896,404
+toggle 143,245 through 707,320
+turn off 103,35 through 160,949
+toggle 496,24 through 669,507
+turn off 581,847 through 847,903
+turn on 689,153 through 733,562
+turn on 821,487 through 839,699
+turn on 837,627 through 978,723
+toggle 96,748 through 973,753
+toggle 99,818 through 609,995
+turn on 731,193 through 756,509
+turn off 622,55 through 813,365
+turn on 456,490 through 576,548
+turn on 48,421 through 163,674
+turn off 853,861 through 924,964
+turn off 59,963 through 556,987
+turn on 458,710 through 688,847
+toggle 12,484 through 878,562
+turn off 241,964 through 799,983
+turn off 434,299 through 845,772
+toggle 896,725 through 956,847
+turn on 740,289 through 784,345
+turn off 395,840 through 822,845
+turn on 955,224 through 996,953
+turn off 710,186 through 957,722
+turn off 485,949 through 869,985
+turn on 848,209 through 975,376
+toggle 221,241 through 906,384
+turn on 588,49 through 927,496
+turn on 273,332 through 735,725
+turn on 505,962 through 895,962
+toggle 820,112 through 923,143
+turn on 919,792 through 978,982
+toggle 489,461 through 910,737
+turn off 202,642 through 638,940
+turn off 708,953 through 970,960
+toggle 437,291 through 546,381
+turn on 409,358 through 837,479
+turn off 756,279 through 870,943
+turn off 154,657 through 375,703
+turn off 524,622 through 995,779
+toggle 514,221 through 651,850
+toggle 808,464 through 886,646
+toggle 483,537 through 739,840
+toggle 654,769 through 831,825
+turn off 326,37 through 631,69
+turn off 590,570 through 926,656
+turn off 881,913 through 911,998
+turn on 996,102 through 998,616
+turn off 677,503 through 828,563
+turn on 860,251 through 877,441
+turn off 964,100 through 982,377
+toggle 888,403 through 961,597
+turn off 632,240 through 938,968
+toggle 731,176 through 932,413
+turn on 5,498 through 203,835
+turn on 819,352 through 929,855
+toggle 393,813 through 832,816
+toggle 725,689 through 967,888
+turn on 968,950 through 969,983
+turn off 152,628 through 582,896
+turn off 165,844 through 459,935
+turn off 882,741 through 974,786
+turn off 283,179 through 731,899
+toggle 197,366 through 682,445
+turn on 106,309 through 120,813
+toggle 950,387 through 967,782
+turn off 274,603 through 383,759
+turn off 155,665 through 284,787
+toggle 551,871 through 860,962
+turn off 30,826 through 598,892
+toggle 76,552 through 977,888
+turn on 938,180 through 994,997
+toggle 62,381 through 993,656
+toggle 625,861 through 921,941
+turn on 685,311 through 872,521
+turn on 124,934 through 530,962
+turn on 606,379 through 961,867
+turn off 792,735 through 946,783
+turn on 417,480 through 860,598
+toggle 178,91 through 481,887
+turn off 23,935 through 833,962
+toggle 317,14 through 793,425
+turn on 986,89 through 999,613
+turn off 359,201 through 560,554
+turn off 729,494 through 942,626
+turn on 204,143 through 876,610
+toggle 474,97 through 636,542
+turn off 902,924 through 976,973
+turn off 389,442 through 824,638
+turn off 622,863 through 798,863
+turn on 840,622 through 978,920
+toggle 567,374 through 925,439
+turn off 643,319 through 935,662
+toggle 185,42 through 294,810
+turn on 47,124 through 598,880
+toggle 828,303 through 979,770
+turn off 174,272 through 280,311
+turn off 540,50 through 880,212
+turn on 141,994 through 221,998
+turn on 476,695 through 483,901
+turn on 960,216 through 972,502
+toggle 752,335 through 957,733
+turn off 419,713 through 537,998
+toggle 772,846 through 994,888
+turn on 881,159 through 902,312
+turn off 537,651 through 641,816
+toggle 561,947 through 638,965
+turn on 368,458 through 437,612
+turn on 290,149 through 705,919
+turn on 711,918 through 974,945
+toggle 916,242 through 926,786
+toggle 522,272 through 773,314
+turn on 432,897 through 440,954
+turn off 132,169 through 775,380
+toggle 52,205 through 693,747
+toggle 926,309 through 976,669
+turn off 838,342 through 938,444
+turn on 144,431 through 260,951
+toggle 780,318 through 975,495
+turn off 185,412 through 796,541
+turn on 879,548 through 892,860
+turn on 294,132 through 460,338
+turn on 823,500 through 899,529
+turn off 225,603 through 483,920
+toggle 717,493 through 930,875
+toggle 534,948 through 599,968
+turn on 522,730 through 968,950
+turn off 102,229 through 674,529
diff --git a/advent-day-7.input b/advent-day-7.input
new file mode 100644
index 0000000..56cae92
--- /dev/null
+++ b/advent-day-7.input
@@ -0,0 +1,339 @@
+af AND ah -> ai
+NOT lk -> ll
+hz RSHIFT 1 -> is
+NOT go -> gp
+du OR dt -> dv
+x RSHIFT 5 -> aa
+at OR az -> ba
+eo LSHIFT 15 -> es
+ci OR ct -> cu
+b RSHIFT 5 -> f
+fm OR fn -> fo
+NOT ag -> ah
+v OR w -> x
+g AND i -> j
+an LSHIFT 15 -> ar
+1 AND cx -> cy
+jq AND jw -> jy
+iu RSHIFT 5 -> ix
+gl AND gm -> go
+NOT bw -> bx
+jp RSHIFT 3 -> jr
+hg AND hh -> hj
+bv AND bx -> by
+er OR es -> et
+kl OR kr -> ks
+et RSHIFT 1 -> fm
+e AND f -> h
+u LSHIFT 1 -> ao
+he RSHIFT 1 -> hx
+eg AND ei -> ej
+bo AND bu -> bw
+dz OR ef -> eg
+dy RSHIFT 3 -> ea
+gl OR gm -> gn
+da LSHIFT 1 -> du
+au OR av -> aw
+gj OR gu -> gv
+eu OR fa -> fb
+lg OR lm -> ln
+e OR f -> g
+NOT dm -> dn
+NOT l -> m
+aq OR ar -> as
+gj RSHIFT 5 -> gm
+hm AND ho -> hp
+ge LSHIFT 15 -> gi
+jp RSHIFT 1 -> ki
+hg OR hh -> hi
+lc LSHIFT 1 -> lw
+km OR kn -> ko
+eq LSHIFT 1 -> fk
+1 AND am -> an
+gj RSHIFT 1 -> hc
+aj AND al -> am
+gj AND gu -> gw
+ko AND kq -> kr
+ha OR gz -> hb
+bn OR by -> bz
+iv OR jb -> jc
+NOT ac -> ad
+bo OR bu -> bv
+d AND j -> l
+bk LSHIFT 1 -> ce
+de OR dk -> dl
+dd RSHIFT 1 -> dw
+hz AND ik -> im
+NOT jd -> je
+fo RSHIFT 2 -> fp
+hb LSHIFT 1 -> hv
+lf RSHIFT 2 -> lg
+gj RSHIFT 3 -> gl
+ki OR kj -> kk
+NOT ak -> al
+ld OR le -> lf
+ci RSHIFT 3 -> ck
+1 AND cc -> cd
+NOT kx -> ky
+fp OR fv -> fw
+ev AND ew -> ey
+dt LSHIFT 15 -> dx
+NOT ax -> ay
+bp AND bq -> bs
+NOT ii -> ij
+ci AND ct -> cv
+iq OR ip -> ir
+x RSHIFT 2 -> y
+fq OR fr -> fs
+bn RSHIFT 5 -> bq
+0 -> c
+14146 -> b
+d OR j -> k
+z OR aa -> ab
+gf OR ge -> gg
+df OR dg -> dh
+NOT hj -> hk
+NOT di -> dj
+fj LSHIFT 15 -> fn
+lf RSHIFT 1 -> ly
+b AND n -> p
+jq OR jw -> jx
+gn AND gp -> gq
+x RSHIFT 1 -> aq
+ex AND ez -> fa
+NOT fc -> fd
+bj OR bi -> bk
+as RSHIFT 5 -> av
+hu LSHIFT 15 -> hy
+NOT gs -> gt
+fs AND fu -> fv
+dh AND dj -> dk
+bz AND cb -> cc
+dy RSHIFT 1 -> er
+hc OR hd -> he
+fo OR fz -> ga
+t OR s -> u
+b RSHIFT 2 -> d
+NOT jy -> jz
+hz RSHIFT 2 -> ia
+kk AND kv -> kx
+ga AND gc -> gd
+fl LSHIFT 1 -> gf
+bn AND by -> ca
+NOT hr -> hs
+NOT bs -> bt
+lf RSHIFT 3 -> lh
+au AND av -> ax
+1 AND gd -> ge
+jr OR js -> jt
+fw AND fy -> fz
+NOT iz -> ja
+c LSHIFT 1 -> t
+dy RSHIFT 5 -> eb
+bp OR bq -> br
+NOT h -> i
+1 AND ds -> dt
+ab AND ad -> ae
+ap LSHIFT 1 -> bj
+br AND bt -> bu
+NOT ca -> cb
+NOT el -> em
+s LSHIFT 15 -> w
+gk OR gq -> gr
+ff AND fh -> fi
+kf LSHIFT 15 -> kj
+fp AND fv -> fx
+lh OR li -> lj
+bn RSHIFT 3 -> bp
+jp OR ka -> kb
+lw OR lv -> lx
+iy AND ja -> jb
+dy OR ej -> ek
+1 AND bh -> bi
+NOT kt -> ku
+ao OR an -> ap
+ia AND ig -> ii
+NOT ey -> ez
+bn RSHIFT 1 -> cg
+fk OR fj -> fl
+ce OR cd -> cf
+eu AND fa -> fc
+kg OR kf -> kh
+jr AND js -> ju
+iu RSHIFT 3 -> iw
+df AND dg -> di
+dl AND dn -> do
+la LSHIFT 15 -> le
+fo RSHIFT 1 -> gh
+NOT gw -> gx
+NOT gb -> gc
+ir LSHIFT 1 -> jl
+x AND ai -> ak
+he RSHIFT 5 -> hh
+1 AND lu -> lv
+NOT ft -> fu
+gh OR gi -> gj
+lf RSHIFT 5 -> li
+x RSHIFT 3 -> z
+b RSHIFT 3 -> e
+he RSHIFT 2 -> hf
+NOT fx -> fy
+jt AND jv -> jw
+hx OR hy -> hz
+jp AND ka -> kc
+fb AND fd -> fe
+hz OR ik -> il
+ci RSHIFT 1 -> db
+fo AND fz -> gb
+fq AND fr -> ft
+gj RSHIFT 2 -> gk
+cg OR ch -> ci
+cd LSHIFT 15 -> ch
+jm LSHIFT 1 -> kg
+ih AND ij -> ik
+fo RSHIFT 3 -> fq
+fo RSHIFT 5 -> fr
+1 AND fi -> fj
+1 AND kz -> la
+iu AND jf -> jh
+cq AND cs -> ct
+dv LSHIFT 1 -> ep
+hf OR hl -> hm
+km AND kn -> kp
+de AND dk -> dm
+dd RSHIFT 5 -> dg
+NOT lo -> lp
+NOT ju -> jv
+NOT fg -> fh
+cm AND co -> cp
+ea AND eb -> ed
+dd RSHIFT 3 -> df
+gr AND gt -> gu
+ep OR eo -> eq
+cj AND cp -> cr
+lf OR lq -> lr
+gg LSHIFT 1 -> ha
+et RSHIFT 2 -> eu
+NOT jh -> ji
+ek AND em -> en
+jk LSHIFT 15 -> jo
+ia OR ig -> ih
+gv AND gx -> gy
+et AND fe -> fg
+lh AND li -> lk
+1 AND io -> ip
+kb AND kd -> ke
+kk RSHIFT 5 -> kn
+id AND if -> ig
+NOT ls -> lt
+dw OR dx -> dy
+dd AND do -> dq
+lf AND lq -> ls
+NOT kc -> kd
+dy AND ej -> el
+1 AND ke -> kf
+et OR fe -> ff
+hz RSHIFT 5 -> ic
+dd OR do -> dp
+cj OR cp -> cq
+NOT dq -> dr
+kk RSHIFT 1 -> ld
+jg AND ji -> jj
+he OR hp -> hq
+hi AND hk -> hl
+dp AND dr -> ds
+dz AND ef -> eh
+hz RSHIFT 3 -> ib
+db OR dc -> dd
+hw LSHIFT 1 -> iq
+he AND hp -> hr
+NOT cr -> cs
+lg AND lm -> lo
+hv OR hu -> hw
+il AND in -> io
+NOT eh -> ei
+gz LSHIFT 15 -> hd
+gk AND gq -> gs
+1 AND en -> eo
+NOT kp -> kq
+et RSHIFT 5 -> ew
+lj AND ll -> lm
+he RSHIFT 3 -> hg
+et RSHIFT 3 -> ev
+as AND bd -> bf
+cu AND cw -> cx
+jx AND jz -> ka
+b OR n -> o
+be AND bg -> bh
+1 AND ht -> hu
+1 AND gy -> gz
+NOT hn -> ho
+ck OR cl -> cm
+ec AND ee -> ef
+lv LSHIFT 15 -> lz
+ks AND ku -> kv
+NOT ie -> if
+hf AND hl -> hn
+1 AND r -> s
+ib AND ic -> ie
+hq AND hs -> ht
+y AND ae -> ag
+NOT ed -> ee
+bi LSHIFT 15 -> bm
+dy RSHIFT 2 -> dz
+ci RSHIFT 2 -> cj
+NOT bf -> bg
+NOT im -> in
+ev OR ew -> ex
+ib OR ic -> id
+bn RSHIFT 2 -> bo
+dd RSHIFT 2 -> de
+bl OR bm -> bn
+as RSHIFT 1 -> bl
+ea OR eb -> ec
+ln AND lp -> lq
+kk RSHIFT 3 -> km
+is OR it -> iu
+iu RSHIFT 2 -> iv
+as OR bd -> be
+ip LSHIFT 15 -> it
+iw OR ix -> iy
+kk RSHIFT 2 -> kl
+NOT bb -> bc
+ci RSHIFT 5 -> cl
+ly OR lz -> ma
+z AND aa -> ac
+iu RSHIFT 1 -> jn
+cy LSHIFT 15 -> dc
+cf LSHIFT 1 -> cz
+as RSHIFT 3 -> au
+cz OR cy -> da
+kw AND ky -> kz
+lx -> a
+iw AND ix -> iz
+lr AND lt -> lu
+jp RSHIFT 5 -> js
+aw AND ay -> az
+jc AND je -> jf
+lb OR la -> lc
+NOT cn -> co
+kh LSHIFT 1 -> lb
+1 AND jj -> jk
+y OR ae -> af
+ck AND cl -> cn
+kk OR kv -> kw
+NOT cv -> cw
+kl AND kr -> kt
+iu OR jf -> jg
+at AND az -> bb
+jp RSHIFT 2 -> jq
+iv AND jb -> jd
+jn OR jo -> jp
+x OR ai -> aj
+ba AND bc -> bd
+jl OR jk -> jm
+b RSHIFT 1 -> v
+o AND q -> r
+NOT p -> q
+k AND m -> n
+as RSHIFT 2 -> at
diff --git a/advent-day-8.input b/advent-day-8.input
new file mode 100644
index 0000000..94538e7
--- /dev/null
+++ b/advent-day-8.input
@@ -0,0 +1,300 @@
+"qxfcsmh"
+"ffsfyxbyuhqkpwatkjgudo"
+"byc\x9dyxuafof\\\xa6uf\\axfozomj\\olh\x6a"
+"jtqvz"
+"uzezxa\"jgbmojtwyfbfguz"
+"vqsremfk\x8fxiknektafj"
+"wzntebpxnnt\"vqndz\"i\x47vvjqo\""
+"higvez\"k\"riewqk"
+"dlkrbhbrlfrp\\damiauyucwhty"
+"d\""
+"qlz"
+"ku"
+"yy\"\"uoao\"uripabop"
+"saduyrntuswlnlkuppdro\\sicxosted"
+"tj"
+"zzphopswlwdhebwkxeurvizdv"
+"xfoheirjoakrpofles\"nfu"
+"q\xb7oh\"p\xce\"n"
+"qeendp\"ercwgywdjeylxcv"
+"dcmem"
+"\"i\x13r\"l"
+"ikso\xdcbvqnbrjduh\"uqudzki\xderwk"
+"wfdsn"
+"pwynglklryhtsqbno"
+"hcoj\x63iccz\"v\"ttr"
+"zf\x23\\hlj\\kkce\\d\\asy\"yyfestwcdxyfj"
+"xs"
+"m\"tvltapxdvtrxiy"
+"bmud"
+"k\"a"
+"b\"oas"
+"\"yexnjjupoqsxyqnquy\"uzfdvetqrc"
+"vdw\xe3olxfgujaj"
+"qomcxdnd\"\\cfoe\""
+"fpul"
+"m\"avamefphkpv"
+"vvdnb\\x\\uhnxfw\"dpubfkxfmeuhnxisd"
+"hey\\"
+"ldaeigghlfey"
+"eure\"hoy\xa5iezjp\\tm"
+"yygb\"twbj\\r\"\x10gmxuhmp\""
+"weirebp\x39mqonbtmfmd"
+"ltuz\\hs\"e"
+"ysvmpc"
+"g\x8amjtt\"megl\"omsaihifwa"
+"yimmm"
+"iiyqfalh"
+"cwknlaaf"
+"q\x37feg\xc6s\"xx"
+"uayrgeurgyp\\oi"
+"xhug\"pt\"axugllbdiggzhvy"
+"kdaarqmsjfx\xc3d"
+"\"vkwla"
+"d\""
+"tmroz\"bvfinxoe\\mum\"wmm"
+"\"n\"bbswxne\\p\\yr\"qhwpdd"
+"skzlkietklkqovjhvj\xfe"
+"pbg\\pab\"bubqaf\"obzcwxwywbs\\dhtq"
+"xxjidvqh\"lx\\wu\"ij"
+"daef\x5fe\x5b\\kbeeb\x13qnydtboof"
+"ogvazaqy\"j\x73"
+"y"
+"n\"tibetedldy\\gsamm\"nwu"
+"wldkvgdtqulwkad"
+"dpmxnj"
+"twybw\"cdvf\"mjdajurokbce"
+"ru\"\\lasij\"i"
+"roc\\vra\\lhrm"
+"pbkt\x60booz\"fjlkc"
+"j\x4dytvjwrzt"
+"\\uiwjkniumxcs"
+"cbhm\"nexccior\"v\"j\"nazxilmfp\x47"
+"qdxngevzrlgoq"
+"\"lrzxftytpobsdfyrtdqpjbpuwmm\x9e"
+"mdag\x0asnck\xc2ggj\"slb\"fjy"
+"wyqkhjuazdtcgkcxvjkpnjdae"
+"aixfk\xc0iom\x21vueob"
+"dkiiakyjpkffqlluhaetires"
+"ysspv\"lysgkvnmwbbsy"
+"gy\"ryexcjjxdm\"xswssgtr"
+"s"
+"ddxv"
+"qwt\"\x27puilb\"pslmbrsxhrz"
+"qdg\xc9e\\qwtknlvkol\x54oqvmchn\\"
+"lvo"
+"b"
+"fk\"aa\"\"yenwch\\\\on"
+"srig\x63hpwaavs\\\x80qzk\"xa\"\xe6u\\wr"
+"yxjxuj\"ghyhhxfj\"\xa6qvatre"
+"yoktqxjxkzrklkoeroil"
+"\"jfmik\""
+"smgseztzdwldikbqrh\""
+"jftahgctf\"hoqy"
+"tcnhicr\"znpgckt\"ble"
+"vqktnkodh\"lo\"a\\bkmdjqqnsqr"
+"ztnirfzqq"
+"s"
+"xx"
+"iqj\"y\\hqgzflwrdsusasekyrxbp\\ad"
+"\\xzjhlaiynkioz\"\"bxepzimvgwt"
+"s\x36rbw"
+"mniieztwrisvdx"
+"atyfxioy\x2b\\"
+"irde\x85\x5cvbah\\jekw\"ia"
+"bdmftlhkwrprmpat\"prfaocvp"
+"w\\k"
+"umbpausy"
+"zfauhpsangy"
+"p\"zqyw"
+"wtztypyqvnnxzvlvipnq\"zu"
+"deicgwq\\oqvajpbov\\or\"kgplwu"
+"mbzlfgpi\\\\zqcidjpzqdzxityxa"
+"lfkxvhma"
+"\xf2yduqzqr\"\\fak\"p\"n"
+"mpajacfuxotonpadvng"
+"anb\\telzvcdu\\a\xf2flfq"
+"lrs\"ebethwpmuuc\"\x86ygr"
+"qmvdbhtumzc\"ci"
+"meet"
+"yopg\x0fdxdq\"h\\ugsu\xffmolxjv"
+"uhy"
+"fzgidrtzycsireghazscvmwcfmw\\t"
+"cqohkhpgvpru"
+"bihyigtnvmevx\"xx"
+"xz"
+"zofomwotzuxsjk\"q\"mc\"js\"dnmalhxd"
+"\\ktnddux\\fqvt\"ibnjntjcbn"
+"ia"
+"htjadnefwetyp\xd5kbrwfycbyy"
+"\"\\hkuxqddnao"
+"meqqsz\x83luecpgaem"
+"cvks\x87frvxo\"svqivqsdpgwhukmju"
+"sgmxiai\\o\"riufxwjfigr\xdf"
+"fgywdfecqufccpcdn"
+"faghjoq\x28abxnpxj"
+"zuppgzcfb\"dctvp\"elup\"zxkopx"
+"xqs\x45xxdqcihbwghmzoa"
+"anbnlp\\cgcvm\"hc"
+"xf\"fgrngwzys"
+"nrxsjduedcy\x24"
+"\x71sxl\"gj\"sds\"ulcruguz\\t\\ssvjcwhi"
+"jhj\"msch"
+"qpovolktfwyiuyicbfeeju\x01"
+"nkyxmb\"qyqultgt\"nmvzvvnxnb"
+"ycsrkbstgzqb\"uv\\cisn"
+"s"
+"ueptjnn\"\"sh"
+"lp\"z\"d\"mxtxiy"
+"yzjtvockdnvbubqabjourf\"k\"uoxwle"
+"\x82\"wqm\""
+"\xb5cwtuks\x5fpgh"
+"wd"
+"tbvf"
+"ttbmzdgn"
+"vfpiyfdejyrlbgcdtwzbnm"
+"uc"
+"otdcmhpjagqix"
+"\\\xb1qso\"s"
+"scowax"
+"behpstjdh\xccqlgnqjyz\"eesn"
+"r\xe1cbnjwzveoomkzlo\\kxlfouhm"
+"jgrl"
+"kzqs\\r"
+"ctscb\x7fthwkdyko\"\x62pkf\"d\xe6knmhurg"
+"tc\"kw\x3ftt"
+"bxb\x5ccl"
+"jyrmfbphsldwpq"
+"jylpvysl\"\"juducjg"
+"en\\m\"kxpq\"wpb\\\""
+"madouht\"bmdwvnyqvpnawiphgac\""
+"vuxpk\"ltucrw"
+"aae\x60arr"
+"ttitnne\"kilkrgssnr\xfdurzh"
+"oalw"
+"pc\"\"gktkdykzbdpkwigucqni\"nxiqx"
+"dbrsaj"
+"bgzsowyxcbrvhtvekhsh\"qgd"
+"kudfemvk\"\"\"hkbrbil\"chkqoa"
+"zjzgj\\ekbhyfzufy"
+"\\acos\"fqekuxqzxbmkbnn\x1ejzwrm"
+"elxahvudn\"txtmomotgw"
+"\x2eoxmwdhelpr\"cgi\xf7pzvb"
+"eapheklx"
+"hfvma\"mietvc\"tszbbm\"czex"
+"h\"iiockj\\\xc1et"
+"d\"rmjjftm"
+"qlvhdcbqtyrhlc\\"
+"yy\"rsucjtulm\"coryri\"eqjlbmk"
+"tv"
+"r\"bfuht\\jjgujp\""
+"kukxvuauamtdosngdjlkauylttaokaj"
+"srgost\"\"rbkcqtlccu\x65ohjptstrjkzy"
+"yxwxl\\yjilwwxffrjjuazmzjs"
+"dxlw\\fkstu\"hjrtiafhyuoh\"sewabne"
+"\x88sj\"v"
+"rfzprz\xec\"oxqclu\"krzefp\\q"
+"cfmhdbjuhrcymgxpylllyvpni"
+"ucrmjvmimmcq\x88\xd9\"lz"
+"lujtt\""
+"gvbqoixn\"pmledpjmo\"flydnwkfxllf"
+"dvxqlbshhmelsk\x8big\"l"
+"mx\x54lma\x8bbguxejg"
+"\x66jdati\xeceieo"
+"\"iyyupixei\x54ff"
+"xohzf\"rbxsoksxamiu"
+"vlhthspeshzbppa\x4drhqnohjop\"\"mfjd"
+"f\"tvxxla\"vurian\"\"idjq\x3aptm\xc3olep"
+"gzqz"
+"kbq\\wogye\\altvi\\hbvmodny"
+"j\xd8"
+"ofjozdhkblvndl"
+"hbitoupimbawimxlxqze"
+"ypeleimnme"
+"xfwdrzsc\\oxqamawyizvi\\y"
+"enoikppx\xa1ixe\"yo\"gumye"
+"fb"
+"vzf"
+"zxidr"
+"cu\x31beirsywtskq"
+"lxpjbvqzztafwezd"
+"\\jyxeuo\x18bv"
+"b\"vawc\"p\\\\giern\"b"
+"odizunx\"\"t\\yicdn\"x\"sdiz"
+"\"\"tebrtsi"
+"ctyzsxv\xa6pegfkwsi\"tgyltaakytccb"
+"htxwbofchvmzbppycccliyik\xe5a"
+"ggsslefamsklezqkrd"
+"rcep\"fnimwvvdx\"l"
+"zyrzlqmd\x12egvqs\\llqyie"
+"\x07gsqyrr\\rcyhyspsvn"
+"butg\""
+"gb"
+"gywkoxf\"jsg\\wtopxvumirqxlwz"
+"rj\"ir\"wldwveair\x2es\"dhjrdehbqnzl"
+"ru\"elktnsbxufk\\ejufjfjlevt\\lrzd"
+"\"widsvok"
+"oy\"\x81nuesvw"
+"ay"
+"syticfac\x1cfjsivwlmy\"pumsqlqqzx"
+"m"
+"rjjkfh\x78cf\x2brgceg\"jmdyas\"\\xlv\xb6p"
+"tmuvo\"\x3ffdqdovjmdmkgpstotojkv\"as"
+"jd\\ojvynhxllfzzxvbn\"wrpphcvx"
+"pz"
+"\"twr"
+"n\\hdzmxe\"mzjjeadlz"
+"fb\"rprxuagvahjnri"
+"rfmexmjjgh\\xrnmyvnatrvfruflaqjnd"
+"obbbde\"co\"qr\"qpiwjgqahqm\\jjp\""
+"vpbq\"\"y\"czk\\b\x52ed\"lnzepobp"
+"syzeajzfarplydipny\"y\"\xe8ad"
+"mpyodwb"
+"\x47rakphlqqptd"
+"wa\"oj\"aiy"
+"a"
+"ropozx"
+"q\x51nbtlwa"
+"etukvgx\\jqxlkq"
+"\"tp\"rah\"pg\"s\"bpdtes\\tkasdhqd"
+"dn\"qqpkikadowssb\xcah\"dzpsf\\ect\"jdh"
+"pxunovbbrrn\\vullyn\"bno\"\"\"myfxlp\""
+"qaixyazuryvkmoulhcqaotegfj\\mpzm"
+"bvfrbicutzbjwn\\oml\"cf\"d\"ezcpv\"j"
+"rmbrdtneudemigdhelmb"
+"aq\\aurmbhy"
+"wujqvzw"
+"gf\"tssmvm\"gm\"hu\x9a\xb7yjawsa"
+"hrhqqxow\xe2gsydtdspcfqy\"zw\\ou"
+"ianwwf\\yko\\tdujhhqdi"
+"xylz\"zpvpab"
+"lwuopbeeegp"
+"aoop\x49jhhcexdmdtun"
+"\\\\mouqqcsgmz"
+"tltuvwhveau\x43b\"ymxjlcgiymcynwt"
+"gsugerumpyuhtjljbhrdyoj"
+"lnjm\xb8wg\"ajh"
+"zmspue\"nfttdon\\b\"eww"
+"\"w\x67jwaq\x7ernmyvs\\rmdsuwydsd\"th"
+"ogtgvtlmcvgllyv"
+"z\"fqi\"rvddoehrciyl"
+"yustxxtot\"muec\"xvfdbzunzvveq"
+"mqslw"
+"txqnyvzmibqgjs\xb6xy\x86nfalfyx"
+"kzhehlmkholov"
+"plpmywcnirrjutjguosh\\"
+"pydbnqofv\"dn\\m"
+"aegqof"
+"eambmxt\\dxagoogl\\zapfwwlmk"
+"afbmqitxxqhddlozuxcpjxgh"
+"vgts"
+"bfdpqtoxzzhmzcilehnflna"
+"s\"idpz"
+"\xcfhgly\"nlmztwybx\"ecezmsxaqw"
+"aackfgndqcqiy"
+"\x22unqdlsrvgzfaohoffgxzfpir\"s"
+"abh\"ydv\"kbpdhrerl"
+"bdzpg"
+"ekwgkywtmzp"
+"wtoodejqmrrgslhvnk\"pi\"ldnogpth"
+"njro\x68qgbx\xe4af\"\\suan"
diff --git a/advent-day-9.input b/advent-day-9.input
new file mode 100644
index 0000000..97a6b63
--- /dev/null
+++ b/advent-day-9.input
@@ -0,0 +1,28 @@
+Faerun to Tristram = 65
+Faerun to Tambi = 129
+Faerun to Norrath = 144
+Faerun to Snowdin = 71
+Faerun to Straylight = 137
+Faerun to AlphaCentauri = 3
+Faerun to Arbre = 149
+Tristram to Tambi = 63
+Tristram to Norrath = 4
+Tristram to Snowdin = 105
+Tristram to Straylight = 125
+Tristram to AlphaCentauri = 55
+Tristram to Arbre = 14
+Tambi to Norrath = 68
+Tambi to Snowdin = 52
+Tambi to Straylight = 65
+Tambi to AlphaCentauri = 22
+Tambi to Arbre = 143
+Norrath to Snowdin = 8
+Norrath to Straylight = 23
+Norrath to AlphaCentauri = 136
+Norrath to Arbre = 115
+Snowdin to Straylight = 101
+Snowdin to AlphaCentauri = 84
+Snowdin to Arbre = 96
+Straylight to AlphaCentauri = 107
+Straylight to Arbre = 14
+AlphaCentauri to Arbre = 46
diff --git a/advent.hs b/advent.hs
new file mode 100644
index 0000000..0fe8404
--- /dev/null
+++ b/advent.hs
@@ -0,0 +1,888 @@
+
+import System.IO.Unsafe (unsafePerformIO)
+import Data.List (sort,nub,isInfixOf,permutations,sortBy,group,groupBy,transpose)
+import Data.List.Split (splitWhen)
+import qualified Data.ByteString.Lazy.Char8 as B
+import Data.Digest.Pure.MD5 (md5)
+import Data.Char (isDigit)
+import qualified Data.Set as S
+import qualified Data.Map.Strict as M
+import qualified Data.Word as W
+import qualified Data.Vector as V
+import Data.Bits (complement, (.&.), (.|.), shiftL, shiftR)
+import Control.Monad.State.Strict
+import Control.Parallel.Strategies
+import qualified Data.HashMap.Strict as HM
+import Data.Aeson
+import Data.Maybe (fromJust)
+import qualified Data.Text as T
+import Debug.Trace (trace)
+
+
+
+printday :: (Show a, Show b) => Int -> a -> b -> [String]
+printday dayn v1 v2 = ["Day " ++ (show dayn), show v1, show v2]
+
+-- Day 1
+
+day1_input :: String
+day1_input = takeWhile (/= '\n') $ unsafePerformIO (readFile "advent-day-1.input")
+
+day1_1 :: String -> Int
+day1_1 [] = 0
+day1_1 (h:t) = (if h == '(' then 1 else -1) + (day1_1 t)
+
+day1_2 :: Int
+day1_2 = (length (takeWhile (>= (0 :: Int)) (day1_2_l day1_input 0))) + 1
+ where
+ day1_2_l :: String -> Int -> [Int]
+ day1_2_l [] _ = []
+ day1_2_l (h:t) l = loc : (day1_2_l t loc)
+ where
+ loc = (if h == '(' then 1 else -1) + l
+
+printday_1 :: [String]
+printday_1 = printday 1 (day1_1 day1_input) day1_2
+
+-- Day 2
+
+day2_input :: [(Int,Int,Int)]
+day2_input = map s_tuple s_sorted
+ where
+ s_input :: [String]
+ s_input = lines $ unsafePerformIO (readFile "advent-day-2.input")
+ s_entries :: [[String]]
+ s_entries = map (splitWhen (=='x')) s_input
+ s_numbers :: [[Int]]
+ s_numbers = map (map read) s_entries
+ s_sorted :: [[Int]]
+ s_sorted = map sort s_numbers
+ s_tuple :: [Int] -> (Int,Int,Int)
+ s_tuple (a:b:c:_) = (a,b,c)
+ s_tuple _ = undefined
+
+day2_1 :: Int
+day2_1 = sum (map papersize day2_input)
+ where
+ papersize :: (Int,Int,Int) -> Int
+ papersize (a,b,c) = (2*a*b) + (2*a*c) + (2*b*c) + (a*b)
+
+day2_2 :: Int
+day2_2 = sum (map ribbonlength day2_input)
+ where
+ ribbonlength :: (Int,Int,Int) -> Int
+ ribbonlength (a,b,c) = (a+a+b+b) + (a*b*c)
+
+printday_2 :: [String]
+printday_2 = printday 2 day2_1 day2_2
+
+-- Day 3
+
+day3_input :: String
+day3_input = takeWhile (/= '\n') $ unsafePerformIO (readFile "advent-day-3.input")
+
+day3_visits :: String -> [(Int,Int)]
+day3_visits = scanl visit (0 :: Int,0 :: Int)
+ where
+ visit :: (Int,Int) -> Char -> (Int,Int)
+ visit (x,y) '^' = (x,y+1)
+ visit (x,y) 'v' = (x,y-1)
+ visit (x,y) '<' = (x-1,y)
+ visit (x,y) '>' = (x+1,y)
+ visit _ _ = undefined
+
+
+
+day3_1 :: Int
+day3_1 = length $ nub (day3_visits day3_input)
+
+day3_2 :: Int
+day3_2 = length $ nub all_houses
+ where
+ santa_instructions :: String -> String
+ santa_instructions (a:_:t) = a : (santa_instructions t)
+ santa_instructions _ = []
+ robo_instructions :: String -> String
+ robo_instructions (_:b:t) = b : (robo_instructions t)
+ robo_instructions _ = []
+ santa_houses :: [(Int,Int)]
+ santa_houses = day3_visits (santa_instructions day3_input)
+ robo_houses :: [(Int,Int)]
+ robo_houses = day3_visits (robo_instructions day3_input)
+ all_houses = santa_houses ++ robo_houses
+
+printday_3 :: [String]
+printday_3 = printday 3 day3_1 day3_2
+
+-- Day 4
+
+day4_input :: B.ByteString
+day4_input = B.pack $ takeWhile (/= '\n') $ unsafePerformIO (readFile "advent-day-4.input")
+
+day4_1 :: Int
+day4_1 = length $ takeWhile (not . hashgood) hashes
+ where
+ hashgood :: String -> Bool
+ hashgood (a:b:c:d:e:_) = (a == '0') && (b == '0') && (c == '0') && (d == '0') && (e == '0')
+ hashgood _ = False
+ hashes :: [String]
+ hashes = map hash [0..]
+ hash :: Int -> String
+ hash n = show $ md5 (B.append day4_input numbs)
+ where
+ numbs :: B.ByteString
+ numbs = B.pack $ show n
+
+day4_2 :: Int
+day4_2 = length $ takeWhile (not . hashgood) hashes
+ where
+ hashgood :: String -> Bool
+ hashgood (a:b:c:d:e:f:_) = (a == '0') && (b == '0') && (c == '0') && (d == '0') && (e == '0') && (f == '0')
+ hashgood _ = False
+ hashes :: [String]
+ hashes = map hash [0..]
+ hash :: Int -> String
+ hash n = show $ md5 (B.append day4_input numbs)
+ where
+ numbs :: B.ByteString
+ numbs = B.pack $ show n
+
+printday_4 :: [String]
+printday_4 = printday 4 day4_1 day4_2
+
+-- Day 5
+
+day5_input :: [String]
+day5_input = lines $ unsafePerformIO (readFile "advent-day-5.input")
+
+day5_1 :: Int
+day5_1 = length $ filter nice_1 day5_input
+ where
+ nice_1 :: String -> Bool
+ nice_1 s = (vowelcount_3 s) && (doubleletter s) && (not $ has_naughty s)
+ vowels :: String
+ vowels = "aeiou"
+ vowelcount_3 :: String -> Bool
+ vowelcount_3 = not . (< 3) . length . (filter (`elem` vowels))
+ doubleletter :: String -> Bool
+ doubleletter (a:b:t) = (a == b) || (doubleletter (b:t))
+ doubleletter _ = False
+ naughty_pairs :: [String]
+ naughty_pairs = ["ab","cd","pq","xy"]
+ has_naughty :: String -> Bool
+ has_naughty s' = (any id) $ (map (`isInfixOf` s') naughty_pairs)
+
+
+day5_2 :: Int
+day5_2 = length $ filter nice_2 day5_input
+ where
+ nice_2 :: String -> Bool
+ nice_2 s = (doublepair s) && (repeat_letter s)
+ doublepair :: String -> Bool
+ doublepair (a:b:t) = ((a:[b]) `isInfixOf` t) || (doublepair (b:t))
+ doublepair _ = False
+ repeat_letter :: String -> Bool
+ repeat_letter (a:b:c:t) = (a == c) || (repeat_letter (b:c:t))
+ repeat_letter _ = False
+
+printday_5 :: [String]
+printday_5 = printday 5 day5_1 day5_2
+
+-- Day 6
+
+data Day6InsnCode = TurnOn | Toggle | TurnOff deriving (Eq,Show)
+data Day6Insn = Day6Insn Day6InsnCode [(Int,Int)] deriving (Show)
+
+day6_input :: [Day6Insn]
+day6_input = map insn textlines
+ where
+ textlines :: [String]
+ textlines = lines $ unsafePerformIO (readFile "advent-day-6.input")
+ textinsn :: String -> String
+ textinsn = takeWhile (not . isDigit)
+ insncode :: String -> Day6InsnCode
+ insncode s
+ | s == "turn on " = TurnOn
+ | s == "turn off " = TurnOff
+ | otherwise = Toggle
+ textcoord1 :: String -> String
+ textcoord1 = takeWhile (/= ' ') . dropWhile (not . isDigit)
+ textcoord2 :: String -> String
+ textcoord2 = tail . dropWhile (/= ' ') . dropWhile (/= 'h')
+ coord :: String -> (Int,Int)
+ coord s = (read textx, read texty)
+ where
+ textx = takeWhile (/= ',') s
+ texty = tail . dropWhile (/= ',') $ s
+ coordset :: (Int,Int) -> (Int,Int) -> [(Int,Int)]
+ coordset (x1,y1) (x2,y2) = coordlist
+ where
+ coordlist = [(x,y) | x <- [x1..x2], y <- [y1..y2]]
+ insn :: String -> Day6Insn
+ insn s = Day6Insn ((insncode . textinsn) s) (coordset ((coord . textcoord1) s) ((coord . textcoord2) s))
+
+
+day6_1 :: Int
+day6_1 = length . S.toList $ result
+ where
+ followinsn :: S.Set (Int,Int) -> Day6Insn -> S.Set (Int,Int)
+ followinsn cur (Day6Insn code mid')
+ | code == TurnOn = S.union cur mid
+ | code == TurnOff = S.difference cur mid
+ | otherwise = S.union (S.difference cur mid) (S.difference mid cur)
+ where
+ mid = S.fromList mid'
+ result = foldl followinsn (S.fromList []) day6_input
+
+-- ttotd, compile this with optimisation or it'll fail awfully slowly indeed
+-- and you want threads enabled so gc can happen in parallel.
+
+day6_2 :: Int
+day6_2 = sum $ map snd $ M.toList result
+ where
+ result :: M.Map (Int,Int) Int
+ result = foldl followinsn (M.fromList []) day6_input
+ followinsn :: M.Map (Int,Int) Int -> Day6Insn -> M.Map (Int,Int) Int
+ followinsn cur (Day6Insn code mid)
+ | code == TurnOn = foldl inc cur mid
+ | code == TurnOff = foldl dec cur mid
+ | otherwise = foldl tog cur mid
+ inc m coord = M.insert coord v m
+ where
+ v' = maybe 0 id (M.lookup coord m)
+ v = v' + 1
+ dec m coord = M.insert coord v m
+ where
+ v' = maybe 0 id (M.lookup coord m)
+ v = if v' == 0 then 0 else (v' - 1)
+ tog m coord = M.insert coord v m
+ where
+ v' = maybe 0 id (M.lookup coord m)
+ v = v' + 2
+
+printday_6 :: [String]
+printday_6 = printday 6 day6_1 day6_2
+
+-- Day 7
+
+data Day7WireOrValue = Wire String | Value W.Word16 deriving (Show)
+data Day7Op = OpSet | OpAnd | OpOr | OpLShift | OpRShift | OpNot deriving (Eq, Show)
+data Day7Rule = Day7Rule Day7Op Day7WireOrValue Day7WireOrValue deriving (Show)
+
+day7_input :: M.Map String Day7Rule
+day7_input = M.fromList $ map rulefromline textlines
+ where
+ textlines :: [String]
+ textlines = lines $ unsafePerformIO (readFile "advent-day-7.input")
+ rulefromline :: String -> (String,Day7Rule)
+ rulefromline s = case op of
+ OpSet -> (target, Day7Rule op (wv 0) (wv 0))
+ OpNot -> (target, Day7Rule op (wv 1) (wv 1))
+ _ -> (target, Day7Rule op (wv 0) (wv 2))
+ where
+ lineelems = words s
+ target = last lineelems
+ op
+ | length lineelems == 3 = OpSet
+ | length lineelems == 4 = OpNot
+ | otherwise = op'
+ where
+ opstr = lineelems !! 1
+ op'
+ | opstr == "AND" = OpAnd
+ | opstr == "OR" = OpOr
+ | opstr == "LSHIFT" = OpLShift
+ | opstr == "RSHIFT" = OpRShift
+ | otherwise = undefined
+ wv n = if isnum then Value num else Wire wordn
+ where
+ wordn = lineelems !! n
+ num = (read wordn) :: W.Word16
+ isnum = (head wordn) `elem` "0123456789"
+
+
+day7_runrule :: String -> State (M.Map String W.Word16) W.Word16
+day7_runrule s = do
+ m <- get
+ if (M.member s m)
+ then return (m M.! s)
+ else do
+ v <- runrule' (day7_input M.! s)
+ m' <- get
+ let m'' = M.insert s v m'
+ put m''
+ return v
+ where
+ valueof :: Day7WireOrValue -> State (M.Map String W.Word16) W.Word16
+ valueof (Wire q) = day7_runrule q
+ valueof (Value v) = return v
+ runrule' :: Day7Rule -> State (M.Map String W.Word16) W.Word16
+ runrule' (Day7Rule op left right)
+ | op == OpSet = lvalue
+ | op == OpNot = lvalue >>= return . complement
+ | op == OpAnd = (liftM2 (.&.)) lvalue rvalue
+ | op == OpOr = (liftM2 (.|.)) lvalue rvalue
+ | op == OpLShift = (liftM2 shiftL) lvalue (rvalue >>= return . fromIntegral)
+ | op == OpRShift = (liftM2 shiftR) lvalue (rvalue >>= return . fromIntegral)
+ | otherwise = undefined
+ where
+ lvalue = valueof left
+ rvalue = valueof right
+
+
+day7_1 :: W.Word16
+day7_1 = evalState (day7_runrule "a") (M.empty)
+
+day7_2 :: W.Word16
+day7_2 = evalState (day7_runrule "a") (M.fromList [("b",956 :: W.Word16)])
+
+printday_7 :: [String]
+printday_7 = printday 7 day7_1 day7_2
+
+-- Day 8
+
+day8_input :: [String]
+day8_input = lines $ unsafePerformIO (readFile "advent-day-8.input")
+
+day8_1 :: Int
+day8_1 = codesize - memsize
+ where
+ codesize = sum . (map length) $ day8_input
+ memsize = sum . (map (memsize' . stripq)) $ day8_input
+ stripq = tail . init
+ memsize' (a:b:t)
+ | a == '\\' && b == '\\' = 1 + memsize' t
+ | a == '\\' && b == '"' = 1 + memsize' t
+ | a == '\\' && b == 'x' = 1 + memsize' (tail . tail $ t)
+ | b == '\\' = 1 + memsize' (b:t)
+ | otherwise = 2 + memsize' t
+ memsize' (_:[]) = 1
+ memsize' [] = 0
+
+day8_2 :: Int
+day8_2 = encsize - codesize
+ where
+ codesize = sum . (map length) $ day8_input
+ encsize = sum . (map encsize') $ day8_input
+ encsize' (a:t)
+ | a == '\\' = 2 + encsize' t
+ | a == '"' = 2 + encsize' t
+ | otherwise = 1 + encsize' t
+ encsize' [] = 2
+
+printday_8 :: [String]
+printday_8 = printday 8 day8_1 day8_2
+
+-- Day 9
+
+day9_input :: [((String,String),Int)]
+day9_input = map mapper rawinput
+ where
+ rawinput = lines $ unsafePerformIO (readFile "advent-day-9.input")
+ mapper s = ((p1,p2),d)
+ where
+ w = words s
+ p1 = w !! 0
+ p2 = w !! 2
+ d = read $ (w !! 4)
+
+day9_places :: [String]
+day9_places = S.toList pset
+ where
+ pset1 = S.fromList (map (fst.fst) day9_input)
+ pset2 = S.fromList (map (snd.fst) day9_input)
+ pset = S.union pset1 pset2
+
+day9_distances :: M.Map (String,String) Int
+day9_distances = M.fromList pmap
+ where
+ pmap1 = day9_input
+ pmap2 = map flipplaces day9_input
+ where
+ flipplaces ((p1,p2),d) = ((p2,p1),d)
+ pmap = pmap1 ++ pmap2
+
+day9_routes :: [[String]]
+day9_routes = filter hasRoute (permutations day9_places)
+ where
+ hasRoute :: [String] -> Bool
+ hasRoute (a:b:t)
+ | M.member (a,b) day9_distances = hasRoute (b:t)
+ | otherwise = False
+ hasRoute (_:[]) = True
+ hasRoute [] = False
+
+day9_routelen :: [String] -> Int
+day9_routelen (a:b:t) = day9_routelen (b:t) + (day9_distances M.! (a,b))
+day9_routelen _ = 0
+
+day9_1 :: Int
+day9_1 = day9_routelen (head sorted)
+ where
+ sorted = sortBy routecmp day9_routes
+ routecmp :: [String] -> [String] -> Ordering
+ routecmp a b = (day9_routelen a) `compare` (day9_routelen b)
+
+day9_2 :: Int
+day9_2 = day9_routelen (last sorted)
+ where
+ sorted = sortBy routecmp day9_routes
+ routecmp :: [String] -> [String] -> Ordering
+ routecmp a b = (day9_routelen a) `compare` (day9_routelen b)
+
+printday_9 :: [String]
+printday_9 = printday 9 day9_1 day9_2
+
+-- Day 10
+
+day10_input :: String
+day10_input = head . lines $ unsafePerformIO (readFile "advent-day-10.input")
+
+day10_readstep :: String -> String
+day10_readstep s = readout
+ where
+ dgs = group s
+ readout = concatMap readout' dgs
+ readout' :: String -> String
+ readout' dg = (show . length $ dg) ++ ((head dg):[])
+
+day10_1 :: Int
+day10_1 = length result
+ where
+ result :: String
+ result = foldl (\s _ -> day10_readstep s) day10_input ([1..40] :: [Int])
+
+day10_2 :: Int
+day10_2 = length result
+ where
+ result :: String
+ result = foldl (\s _ -> day10_readstep s) day10_input ([1..50] :: [Int])
+
+printday_10 :: [String]
+printday_10 = printday 10 day10_1 day10_2
+
+-- Day 11
+
+day11_input :: String
+day11_input = head . lines $ unsafePerformIO (readFile "advent-day-11.input")
+
+day11_incword :: String -> String
+day11_incword = reverse . nextstr . reverse
+ where
+ nextch :: Char -> Char
+ nextch a
+ | a == 'z' = 'a'
+ | a == 'h' = 'j'
+ | a == 'n' = 'p'
+ | a == 'k' = 'm'
+ | otherwise = succ a
+ nextstr :: String -> String
+ nextstr (a:t)
+ | na == 'a' = 'a' : (nextstr t)
+ | otherwise = na : t
+ where
+ na = nextch a
+ nextstr [] = []
+
+day11_wordok1 :: String -> Bool
+day11_wordok1 s
+ | 'i' `elem` s = False
+ | 'o' `elem` s = False
+ | 'l' `elem` s = False
+ | otherwise = (hastriple s) && (haspairs s)
+ where
+ hastriple (a:b:c:t)
+ | (c == (succ b)) && (b == (succ a)) = True
+ | otherwise = hastriple (b:c:t)
+ hastriple _ = False
+ haspairs (a:b:t)
+ | a == b = haspair t
+ | otherwise = haspairs (b:t)
+ where
+ haspair (a:b:t)
+ | a == b = True
+ | otherwise = haspair (b:t)
+ haspair _ = False
+ haspairs _ = False
+
+day11_nextpw :: String -> String
+day11_nextpw in' = head . (filter day11_wordok1) $ (possibles in')
+ where
+ possibles s = ns : (possibles ns)
+ where
+ ns = day11_incword s
+
+day11_1 :: String
+day11_1 = day11_nextpw day11_input
+
+
+day11_2 :: String
+day11_2 = day11_nextpw day11_1
+
+printday_11 :: [String]
+printday_11 = printday 11 day11_1 day11_2
+
+-- Day 12
+
+day12_input :: Maybe Object
+day12_input = decode $ unsafePerformIO (B.readFile "advent-day-12.input")
+
+day12_1 :: Int
+day12_1 = sumVal $ Object (fromJust day12_input)
+ where
+ sumVal :: Value -> Int
+ sumVal (Array a) = sum . (map sumVal) $ V.toList a
+ sumVal (Object o) = sum . (map sumVal) $ HM.elems o
+ sumVal (Number n) = floor $ read (show n)
+ sumVal _ = 0
+
+day12_2 :: Int
+day12_2 = sumVal $ Object (fromJust day12_input)
+ where
+ sumVal :: Value -> Int
+ sumVal (Array a) = sum . (map sumVal) $ V.toList a
+ sumVal (Object o)
+ | (String (T.pack "red")) `elem` (HM.elems o) = 0
+ | otherwise = sum . (map sumVal) $ HM.elems o
+ sumVal (Number n) = floor $ read (show n)
+ sumVal _ = 0
+
+
+printday_12 :: [String]
+printday_12 = printday 12 day12_1 day12_2
+
+-- Day 13
+
+day13_input :: M.Map String (M.Map String Int)
+day13_input = M.fromList entries
+ where
+ textlines = lines $ unsafePerformIO (readFile "advent-day-13.input")
+ entries :: [(String,M.Map String Int)]
+ entries = map (\(a,b) -> (a,M.fromList b)) entries'
+ entries' :: [(String,[(String,Int)])]
+ entries' = map splitoff rawentries'
+ splitoff :: [(String,String,Int)] -> (String,[(String,Int)])
+ splitoff xs = (fst' . head $ xs, map (\(_,a,b) -> (a,b)) xs)
+ fst' (a,_,_) = a
+ rawentries' :: [[(String,String,Int)]]
+ rawentries' = groupBy cmpfst rawentries
+ cmpfst (a,_,_) (b,_,_) = a == b
+ rawentries :: [(String,String,Int)]
+ rawentries = map linetoentry textlines
+ linetoentry :: String -> (String,String,Int)
+ linetoentry s = (from,to,net)
+ where
+ s' = words s
+ from = s' !! 0
+ to = init (s' !! 10)
+ net = sign * (read $ s' !! 3)
+ sign
+ | (s' !! 2) == "gain" = 1
+ | otherwise = -1
+
+day13_people :: [String]
+day13_people = M.keys day13_input
+
+day13_1 :: Int
+day13_1 = last $ sort . (map layoutcost) $ layouts
+ where
+ layouts = permutations day13_people
+ layoutcost l@(f:_) = layoutcost' f l
+ layoutcost' f (a:r@(b:_)) = (paircost' a b) + layoutcost' f r
+ layoutcost' f (b:[]) = paircost' f b
+ paircost' a b = (a' M.! b) + (b' M.! a)
+ where
+ a' = day13_input M.! a
+ b' = day13_input M.! b
+
+
+day13_2 :: Int
+day13_2 = last $ sort . (map layoutcost) $ layouts
+ where
+ layouts = permutations ("Player":day13_people)
+ layoutcost l@(f:_) = layoutcost' f l
+ layoutcost' f (a:r@(b:_)) = (paircost' a b) + layoutcost' f r
+ layoutcost' f (b:[]) = paircost' f b
+ paircost' a b = (a' M.! b) + (b' M.! a)
+ where
+ a' = day13_input' M.! a
+ b' = day13_input' M.! b
+ day13_input' :: M.Map String (M.Map String Int)
+ day13_input' = M.fromList (day13_extra:(map day13_change day13_ser))
+ where
+ day13_ser = M.toList day13_input
+ day13_extra = ("Player", M.fromList $ map (\s -> (s, 0)) $ day13_people)
+ day13_change (s,ma) = (s,M.insert "Player" 0 ma)
+
+printday_13 :: [String]
+printday_13 = printday 13 day13_1 day13_2
+
+-- Day 14
+
+day14_input :: [(String,Int,Int,Int)]
+day14_input = map extract textlines
+ where
+ textlines = lines $ unsafePerformIO (readFile "advent-day-14.input")
+ extract s' = (s !! 0, read (s !! 3), read (s !! 6), read (s !! 13))
+ where
+ s = words s'
+
+deerpos :: (String,Int,Int,Int) -> Int -> Int
+deerpos (_,speed,for,rest) t' = deerpos' 0 t'
+ where
+ deerpos' cur t
+ | t == 0 = cur
+ | t <= for = cur + (speed * t)
+ | otherwise = deerpos'' (cur + (speed * for)) (t - for)
+ deerpos'' cur t
+ | t == 0 = cur
+ | t <= rest = cur
+ | otherwise = deerpos' cur (t - rest)
+
+day14_1 :: Int
+day14_1 = last . sort $ map deerpos' day14_input
+ where
+ deerpos' d = deerpos d 2503
+
+day14_2 :: Int
+day14_2 = last . sort $ scorers'
+ where
+ scoresat n = sortBy (\(_,b) (_,d) -> d `compare` b) $ map (\d -> (d,deerpos d n)) day14_input
+ topscoreat = snd . head . scoresat
+ scorersat n = map (\(name,_,_,_) -> name) leadingdeer
+ where
+ leadingdeer = map fst $ takeWhile (\(_,s) -> s == topscoreat n) $ scoresat n
+ scorers' = map (length) . group . sort $ concatMap scorersat [1..2503]
+
+printday_14 :: [String]
+printday_14 = printday 14 day14_1 day14_2
+
+-- Day 15
+
+day15_input :: [(String,Int,Int,Int,Int,Int)]
+day15_input = map mapl rawtextlines
+ where
+ rawtextlines = lines $ unsafePerformIO (readFile "advent-day-15.input")
+ name = takeWhile (/= ':')
+ capa s = read $ takeWhile (/= ',') $ (words s) !! 2
+ dura s = read $ takeWhile (/= ',') $ (words s) !! 4
+ flav s = read $ takeWhile (/= ',') $ (words s) !! 6
+ texr s = read $ takeWhile (/= ',') $ (words s) !! 8
+ cals s = read $ (words s) !! 10
+ mapl s = (name s, capa s, dura s, flav s, texr s, cals s)
+
+day15_spoons :: [[Int]]
+day15_spoons = possibles [] (length day15_input)
+ where
+ possibles pfx left
+ | left == 1 = [ pfx ++ [lim] ]
+ | otherwise = concatMap (uncurry possibles) [ (res',left - 1) | res' <- res ]
+ where
+ tot = sum pfx
+ lim
+ | tot < 100 = 100 - tot
+ | otherwise = 0
+ res = [ pfx ++ [v] | v <- [0..lim] ]
+
+day15_recipescore :: [Int] -> Int
+day15_recipescore = satprod . transpose . rawscores
+ where
+ rawscores :: [Int] -> [[Int]]
+ rawscores recipe = map ingrscore $ zip recipe day15_input
+ ingrscore :: (Int,(String,Int,Int,Int,Int,Int)) -> [Int]
+ ingrscore (sval,(_,c,d,f,t,_)) = [sval * c, sval * d, sval * f, sval * t]
+ satprod :: [[Int]] -> Int
+ satprod = product . (map (\v -> if (v < 0) then 0 else v)) . (map sum)
+
+day15_calories :: [Int] -> Int
+day15_calories = calcount
+ where
+ calcount recipe = sum . (map caltot) $ zip recipe day15_input
+ caltot (sval,(_,_,_,_,_,cal)) = sval * cal
+
+day15_1 :: Int
+day15_1 = last . sort $ allscores
+ where
+ allscores = map day15_recipescore day15_spoons
+
+day15_2 :: Int
+day15_2 = last . sort $ okayscores
+ where
+ okayscores = map day15_recipescore okayspoons
+ okayspoons = filter (\a -> (day15_calories a) == 500) day15_spoons
+
+printday_15 :: [String]
+printday_15 = printday 15 day15_1 day15_2
+
+-- Day 16
+
+day16_input :: M.Map String (M.Map String Int)
+day16_input = M.fromList $ map facts rawlines
+ where
+ rawlines = lines $ unsafePerformIO (readFile "advent-day-16.input")
+ suenr :: [String] -> String
+ suenr ws = takeWhile (/= ':') (ws !! 1)
+ fact ws n = (key,read val)
+ where
+ key = takeWhile (/= ':') (ws !! (2 * n))
+ val = takeWhile (/= ',') (ws !! ((2 * n) + 1))
+ facts' ws = [fact ws n | n <- [1,2,3]]
+ facts s = (suenr ws, M.fromList (facts' ws))
+ where
+ ws = words s
+
+day16_facts1 :: M.Map String Int
+day16_facts1 = M.fromList [ ("children", 3)
+ , ("cats", 7)
+ , ("samoyeds", 2)
+ , ("pomeranians", 3)
+ , ("akitas", 0)
+ , ("vizslas", 0)
+ , ("goldfish", 5)
+ , ("trees", 3)
+ , ("cars", 2)
+ , ("perfumes", 1)
+ ]
+
+day16_suematch1 :: M.Map String Int -> M.Map String Int -> Bool
+day16_suematch1 sue facts = all id matches
+ where
+ knownkeys = M.keys sue
+ suematch k = (facts M.! k) == (sue M.! k)
+ matches = map suematch knownkeys
+
+day16_1 :: String
+day16_1 = fst . head $ matchingsues
+ where
+ sues = M.toList day16_input
+ suematches (_,facts) = day16_suematch1 facts day16_facts1
+ matchingsues = filter suematches sues
+
+day16_suematch2 :: M.Map String Int -> M.Map String Int -> Bool
+day16_suematch2 sue facts = all id matches
+ where
+ knownkeys = M.keys sue
+ suematch k = factcompare k (facts M.! k) (sue M.! k)
+ matches = map suematch knownkeys
+ factcompare k val sueval
+ | (k == "cats") = val < sueval
+ | (k == "trees") = val < sueval
+ | (k == "pomeranians") = sueval < val
+ | (k == "goldfish") = sueval < val
+ | otherwise = val == sueval
+
+day16_2 :: String
+day16_2 = fst . head $ matchingsues
+ where
+ sues = M.toList day16_input
+ suematches (_,facts) = day16_suematch2 facts day16_facts1
+ matchingsues = filter suematches sues
+
+printday_16 :: [String]
+printday_16 = printday 16 day16_1 day16_2
+
+-- Day 17
+
+day17_input :: [Int]
+day17_input = (map read) . lines $ unsafePerformIO (readFile "advent-day-17.input")
+
+day17_possible_combos :: [[Int]]
+day17_possible_combos = filterM (\_ -> [True,False]) day17_input
+
+day17_1 :: Int
+day17_1 = length $ filter (== 150) combosizes
+ where
+ combosizes = map sum day17_possible_combos
+
+day17_2 :: Int
+day17_2 = length allsmall
+ where
+ combosizes = map (\x -> (sum x, length x)) day17_possible_combos
+ okaycombos = filter (\(s,_) -> s == 150) combosizes
+ smallest = minimum . (map snd) $ okaycombos
+ allsmall = filter (\(_,s) -> s == smallest) okaycombos
+
+printday_17 :: [String]
+printday_17 = printday 17 day17_1 day17_2
+
+-- Day 18
+
+day18_input :: S.Set (Int,Int)
+day18_input = S.fromList . (concatMap linetotoks) $ numblines
+ where
+ rawlines = lines $ unsafePerformIO (readFile "advent-day-18.input")
+ numblines = zip rawlines [1..]
+ linetotoks (l,ln) = map (\(_,v) -> (ln,v)) filled
+ where
+ ln' = zip l [1..]
+ filled = filter (\(a,_) -> a == '#') ln'
+
+day18_rule1 :: S.Set (Int,Int) -> Int -> Int -> Bool
+day18_rule1 grid x y
+ | current && (around == 2) = True
+ | current && (around == 3) = True
+ | (not current) && (around == 3) = True
+ | otherwise = False
+ where
+ ingrid v = v `S.member` grid
+ current = ingrid (x,y)
+ around' = [(x-1,y-1),(x-1,y),(x-1,y+1)
+ ,(x,y-1),(x,y+1)
+ ,(x+1,y-1),(x+1,y),(x+1,y+1)]
+ around = length $ filter id $ map ingrid around'
+
+day18_runstep1 :: S.Set (Int,Int) -> S.Set (Int,Int)
+day18_runstep1 curgrid = S.fromList . (filter inclcoord) $ allcoords
+ where
+ allcoords = [(x,y) | x <- [1..100], y <- [1..100]]
+ inclcoord (x,y) = day18_rule1 curgrid x y
+
+day18_1 :: Int
+day18_1 = length $ S.toList grid
+ where
+ grid = foldl (\s _ -> day18_runstep1 s) day18_input ([1..100] :: [Int])
+
+day18_corners :: S.Set (Int,Int)
+day18_corners = S.fromList [(1,1),(1,100),(100,1),(100,100)]
+
+day18_runstep2 :: S.Set (Int,Int) -> S.Set (Int,Int)
+day18_runstep2 curgrid = (day18_runstep1 curgrid) `S.union` day18_corners
+
+day18_2 :: Int
+day18_2 = length $ S.toList grid
+ where
+ grid = foldl (\s _ -> day18_runstep2 s) (day18_input `S.union` day18_corners) ([1..100] :: [Int])
+
+printday_18 :: [String]
+printday_18 = printday 18 day18_1 day18_2
+
+-- Outputs
+
+alldays :: [String]
+alldays =
+ printday_1 ++
+ printday_2 ++
+ printday_3 ++
+ printday_4 ++
+ printday_5 ++
+ printday_6 ++
+ printday_7 ++
+ printday_8 ++
+ printday_9 ++
+ printday_10 ++
+ printday_11 ++
+ printday_12 ++
+ printday_13 ++
+ printday_14 ++
+ printday_15 ++
+ printday_16 ++
+ printday_17 ++
+ printday_18
+
+alldayspar :: [String]
+alldayspar = alldays `using` parList rdeepseq
+
+allmain :: IO ()
+allmain = forM_ alldayspar putStrLn
+
+main = allmain