diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000..13dc3ac
Binary files /dev/null and b/.DS_Store differ
diff --git a/.gitignore b/.gitignore
index c2c6aeb..a8b9e43 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
.gradle
-.idea
+.idea/
.kotlin/
build
-src/**/*.txt
local.properties
+
+src/resources/*-output.txt
\ No newline at end of file
diff --git a/.idea/file.template.settings.xml b/.idea/file.template.settings.xml
deleted file mode 100644
index 5e3f789..0000000
--- a/.idea/file.template.settings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/fileTemplates/Advent of Code.kt b/.idea/fileTemplates/Advent of Code.kt
deleted file mode 100644
index dcc0478..0000000
--- a/.idea/fileTemplates/Advent of Code.kt
+++ /dev/null
@@ -1,16 +0,0 @@
-#set( $Code = "bar" )
-fun main() {
- fun part1(input: List): Int {
- return input.size
- }
-
- fun part2(input: List): Int {
- return input.size
- }
-
- check(part1(listOf("...")) == 1)
-
- val input = readInput("Day$Day")
- part1(input).println()
- part2(input).println()
-}
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..78b87d6
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,34 @@
+//plugins {
+// kotlin("jvm") version "2.1.0"
+//}
+//
+//sourceSets {
+// main {
+// kotlin.srcDir("src")
+// }
+//}
+//
+//tasks {
+// wrapper {
+// gradleVersion = "8.11.1"
+// }
+//}
+plugins {
+ id "org.jetbrains.kotlin.jvm" version "2.1.0"
+}
+
+sourceSets {
+ main {
+ kotlin {
+ srcDir "src"
+ }
+ }
+}
+
+tasks.wrapper {
+ gradleVersion = "8.11.1"
+}
+
+dependencies {
+ implementation("io.github.microutils:kotlin-logging-jvm:$kotlin_logging_version")
+}
diff --git a/build.gradle.kts b/build.gradle.kts
deleted file mode 100644
index e999efb..0000000
--- a/build.gradle.kts
+++ /dev/null
@@ -1,15 +0,0 @@
-plugins {
- kotlin("jvm") version "2.1.0"
-}
-
-sourceSets {
- main {
- kotlin.srcDir("src")
- }
-}
-
-tasks {
- wrapper {
- gradleVersion = "8.11.1"
- }
-}
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..8777c61
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1 @@
+kotlin_logging_version = 3.0.5
diff --git a/settings.gradle.kts b/settings.gradle
similarity index 100%
rename from settings.gradle.kts
rename to settings.gradle
diff --git a/src/.DS_Store b/src/.DS_Store
new file mode 100644
index 0000000..20e899a
Binary files /dev/null and b/src/.DS_Store differ
diff --git a/src/Application.kt b/src/Application.kt
new file mode 100644
index 0000000..48da0ec
--- /dev/null
+++ b/src/Application.kt
@@ -0,0 +1,46 @@
+interface Application {
+ fun run(fileName: String): Pair
+}
+
+fun main(args: Array) {
+ val day = 18
+ runApp(day, true)
+ runApp(day, false)
+}
+
+fun runApp(day: Int, isTest: Boolean = false) {
+ val app: Application = chooseClassFromDay(day)
+ when (isTest) {
+ true -> app.run("day${day.toString().padStart(2, '0')}test").printRes(day, true)
+ false -> app.run("day${day.toString().padStart(2, '0')}").printRes(day, false)
+
+ }
+}
+
+fun chooseClassFromDay(day: Int): Application = when(day) {
+ 9 -> Day09()
+ 10 -> Day10()
+ 11 -> Day11()
+ 12 -> Day12()
+ 13 -> Day13()
+ 14 -> Day14()
+ 15 -> Day15()
+ 16 -> Day16()
+ 17 -> Day17()
+ 18 -> Day18()
+ 19 -> Day19()
+ 20 -> Day20()
+ 21 -> Day21()
+ 22 -> Day22()
+ 23 -> Day23()
+ 24 -> Day24()
+ 25 -> Day25()
+ else -> throw IllegalArgumentException("Unknown day: $day")
+}
+
+fun Pair.printRes(day: Int, isTest: Boolean = false) {
+ val dayStr =
+ if (isTest) "day${day.toString().padStart(2, '0')}-test" else "day-${day.toString().padStart(2, '0')}"
+ println("${dayStr}-1: $first")
+ println("${dayStr}-2: $second")
+}
\ No newline at end of file
diff --git a/src/Day00.kt b/src/Day00.kt
new file mode 100644
index 0000000..d1bb47c
--- /dev/null
+++ b/src/Day00.kt
@@ -0,0 +1,21 @@
+fun main() {
+ fun part1(input: List): Int {
+ return input.size
+ }
+
+ fun part2(input: List): Int {
+ return input.size
+ }
+
+ // Test if implementation meets criteria from the description, like:
+ check(part1(listOf("test_input")) == 1)
+
+ // Or read a large test input from the `src/Day01_test.txt` file:
+ val testInput = readInput("Day01_test")
+ check(part1(testInput) == 1)
+
+ // Read the input from the `src/Day01.txt` file.
+ val input = readInput("Day01")
+ part1(input).println()
+ part2(input).println()
+}
diff --git a/src/Day01.kt b/src/Day01.kt
index d1bb47c..67537b1 100644
--- a/src/Day01.kt
+++ b/src/Day01.kt
@@ -1,21 +1,2015 @@
-fun main() {
- fun part1(input: List): Int {
- return input.size
- }
+import kotlin.math.abs
- fun part2(input: List): Int {
- return input.size
+fun main() {
+ val list1 = listOf(
+ 27484,
+ 67560,
+ 43926,
+ 86974,
+ 71747,
+ 28088,
+ 34772,
+ 29824,
+ 29947,
+ 98288,
+ 65056,
+ 51274,
+ 77249,
+ 47027,
+ 38391,
+ 70732,
+ 48005,
+ 78366,
+ 61139,
+ 73910,
+ 20206,
+ 22102,
+ 88580,
+ 54397,
+ 49998,
+ 61967,
+ 12345,
+ 41314,
+ 21798,
+ 98407,
+ 86141,
+ 73311,
+ 81862,
+ 95566,
+ 87351,
+ 15848,
+ 51788,
+ 35997,
+ 47658,
+ 81744,
+ 47851,
+ 43111,
+ 11414,
+ 40636,
+ 27695,
+ 81110,
+ 44831,
+ 58200,
+ 88294,
+ 16039,
+ 59282,
+ 69211,
+ 52748,
+ 52668,
+ 43520,
+ 28943,
+ 24548,
+ 67129,
+ 53243,
+ 65561,
+ 82182,
+ 49274,
+ 15952,
+ 60418,
+ 27775,
+ 73493,
+ 52098,
+ 27121,
+ 81056,
+ 28121,
+ 30348,
+ 56433,
+ 25161,
+ 83995,
+ 57450,
+ 52600,
+ 77850,
+ 37216,
+ 98526,
+ 90655,
+ 45217,
+ 69053,
+ 13539,
+ 89360,
+ 84311,
+ 87153,
+ 24300,
+ 23519,
+ 28852,
+ 53355,
+ 42582,
+ 26552,
+ 75913,
+ 53485,
+ 34601,
+ 76249,
+ 94920,
+ 72323,
+ 69403,
+ 95672,
+ 26935,
+ 87512,
+ 61615,
+ 74695,
+ 20200,
+ 19304,
+ 68077,
+ 10582,
+ 27335,
+ 37584,
+ 73196,
+ 16502,
+ 91474,
+ 54822,
+ 71321,
+ 41518,
+ 87096,
+ 21202,
+ 93142,
+ 38047,
+ 24517,
+ 44312,
+ 33144,
+ 77684,
+ 80588,
+ 67107,
+ 54896,
+ 51770,
+ 45857,
+ 46481,
+ 47496,
+ 28125,
+ 14980,
+ 51789,
+ 12986,
+ 25765,
+ 74251,
+ 78770,
+ 55011,
+ 29165,
+ 17728,
+ 33981,
+ 36823,
+ 39673,
+ 91903,
+ 19472,
+ 26800,
+ 37852,
+ 14040,
+ 55052,
+ 65668,
+ 89327,
+ 76888,
+ 70948,
+ 12472,
+ 14831,
+ 22665,
+ 22214,
+ 89577,
+ 81023,
+ 84429,
+ 75394,
+ 42076,
+ 68351,
+ 62000,
+ 17132,
+ 41051,
+ 76577,
+ 72700,
+ 21580,
+ 20635,
+ 62682,
+ 96847,
+ 79918,
+ 80975,
+ 72024,
+ 29236,
+ 82592,
+ 40379,
+ 22464,
+ 53246,
+ 92362,
+ 67933,
+ 83285,
+ 32355,
+ 72419,
+ 54766,
+ 44778,
+ 97706,
+ 14239,
+ 61196,
+ 49491,
+ 14607,
+ 54850,
+ 71449,
+ 27968,
+ 33242,
+ 44321,
+ 97596,
+ 82906,
+ 14319,
+ 46189,
+ 49649,
+ 24148,
+ 34109,
+ 81217,
+ 25414,
+ 75794,
+ 15200,
+ 95299,
+ 39732,
+ 87884,
+ 15317,
+ 21193,
+ 15090,
+ 21390,
+ 21698,
+ 56575,
+ 84593,
+ 83880,
+ 36664,
+ 42212,
+ 27053,
+ 84601,
+ 77818,
+ 44608,
+ 56932,
+ 93674,
+ 79048,
+ 88828,
+ 11883,
+ 36014,
+ 12590,
+ 76559,
+ 39043,
+ 82003,
+ 20407,
+ 10048,
+ 31281,
+ 28063,
+ 45813,
+ 18006,
+ 95040,
+ 62587,
+ 28094,
+ 29580,
+ 72853,
+ 39380,
+ 50190,
+ 86034,
+ 26295,
+ 22364,
+ 73757,
+ 45106,
+ 91186,
+ 30056,
+ 91866,
+ 89436,
+ 73210,
+ 62546,
+ 40469,
+ 55116,
+ 11849,
+ 77677,
+ 61244,
+ 26136,
+ 81481,
+ 72429,
+ 76056,
+ 35895,
+ 68089,
+ 18171,
+ 63514,
+ 97499,
+ 75403,
+ 36977,
+ 96237,
+ 29452,
+ 98034,
+ 42417,
+ 57358,
+ 60023,
+ 72118,
+ 85974,
+ 80417,
+ 13977,
+ 71082,
+ 44648,
+ 72171,
+ 70404,
+ 54381,
+ 72013,
+ 51192,
+ 14717,
+ 23855,
+ 48675,
+ 83605,
+ 31420,
+ 83753,
+ 10437,
+ 58483,
+ 69788,
+ 81921,
+ 56676,
+ 42129,
+ 21405,
+ 54273,
+ 63042,
+ 11660,
+ 64263,
+ 11027,
+ 47012,
+ 94401,
+ 27499,
+ 70973,
+ 47772,
+ 35646,
+ 16154,
+ 91790,
+ 50094,
+ 80579,
+ 49745,
+ 18137,
+ 79817,
+ 18437,
+ 46949,
+ 60816,
+ 35903,
+ 17915,
+ 57636,
+ 97265,
+ 54184,
+ 72211,
+ 50122,
+ 98895,
+ 83261,
+ 61814,
+ 41074,
+ 25545,
+ 69677,
+ 32198,
+ 90218,
+ 32063,
+ 26348,
+ 23459,
+ 19924,
+ 12755,
+ 75332,
+ 20426,
+ 33510,
+ 32520,
+ 50821,
+ 45619,
+ 30651,
+ 23288,
+ 26097,
+ 35967,
+ 13374,
+ 35414,
+ 67278,
+ 34100,
+ 26440,
+ 55848,
+ 60238,
+ 11578,
+ 53675,
+ 95139,
+ 53655,
+ 75061,
+ 25717,
+ 96718,
+ 60846,
+ 31991,
+ 41677,
+ 81456,
+ 62569,
+ 14572,
+ 47381,
+ 84958,
+ 85437,
+ 12693,
+ 56021,
+ 55744,
+ 68582,
+ 15330,
+ 94099,
+ 89771,
+ 52313,
+ 56489,
+ 50298,
+ 74104,
+ 29286,
+ 24482,
+ 82812,
+ 13182,
+ 15225,
+ 78417,
+ 83094,
+ 26751,
+ 92253,
+ 34340,
+ 73732,
+ 91045,
+ 52416,
+ 13671,
+ 33612,
+ 56971,
+ 40346,
+ 72844,
+ 94947,
+ 86520,
+ 75495,
+ 87108,
+ 61901,
+ 85022,
+ 51692,
+ 97087,
+ 17780,
+ 78024,
+ 82627,
+ 86867,
+ 14770,
+ 99690,
+ 37970,
+ 38091,
+ 93808,
+ 19623,
+ 62514,
+ 39354,
+ 18731,
+ 20182,
+ 96893,
+ 93703,
+ 32281,
+ 44738,
+ 34416,
+ 99168,
+ 60552,
+ 62143,
+ 34660,
+ 11505,
+ 24137,
+ 69957,
+ 32792,
+ 55146,
+ 24998,
+ 45008,
+ 55840,
+ 56271,
+ 51951,
+ 23366,
+ 94193,
+ 67623,
+ 35037,
+ 13330,
+ 31163,
+ 87613,
+ 40427,
+ 90416,
+ 81180,
+ 82377,
+ 64803,
+ 62137,
+ 28226,
+ 12419,
+ 14256,
+ 74284,
+ 63856,
+ 12114,
+ 23305,
+ 99115,
+ 38426,
+ 87398,
+ 92158,
+ 39006,
+ 17021,
+ 11701,
+ 31448,
+ 78513,
+ 85920,
+ 93843,
+ 30287,
+ 78384,
+ 41990,
+ 11317,
+ 30841,
+ 10135,
+ 85875,
+ 65006,
+ 19493,
+ 29916,
+ 12137,
+ 13493,
+ 36868,
+ 19718,
+ 73983,
+ 79278,
+ 70849,
+ 43543,
+ 69664,
+ 36211,
+ 69076,
+ 50555,
+ 16277,
+ 86854,
+ 18173,
+ 15367,
+ 87778,
+ 85537,
+ 29202,
+ 65597,
+ 94036,
+ 40995,
+ 57002,
+ 31037,
+ 62138,
+ 23493,
+ 32543,
+ 13649,
+ 45082,
+ 39931,
+ 54328,
+ 90435,
+ 98509,
+ 40846,
+ 12273,
+ 70078,
+ 69792,
+ 71552,
+ 43202,
+ 23140,
+ 26364,
+ 34210,
+ 47040,
+ 29563,
+ 35773,
+ 52323,
+ 37176,
+ 97815,
+ 43884,
+ 94682,
+ 82836,
+ 89878,
+ 39807,
+ 42368,
+ 13016,
+ 89249,
+ 65121,
+ 20487,
+ 24970,
+ 30802,
+ 65040,
+ 28328,
+ 52220,
+ 26818,
+ 65282,
+ 78164,
+ 46968,
+ 78981,
+ 18980,
+ 30648,
+ 51633,
+ 31442,
+ 63174,
+ 44998,
+ 60294,
+ 33509,
+ 28215,
+ 76076,
+ 64908,
+ 17601,
+ 33308,
+ 79813,
+ 89994,
+ 35315,
+ 67669,
+ 73099,
+ 25168,
+ 71490,
+ 58441,
+ 28299,
+ 64607,
+ 34983,
+ 96817,
+ 13045,
+ 71656,
+ 26886,
+ 60587,
+ 75130,
+ 86187,
+ 85198,
+ 33243,
+ 43027,
+ 38691,
+ 49403,
+ 45353,
+ 18425,
+ 18026,
+ 39076,
+ 28212,
+ 18907,
+ 71135,
+ 13958,
+ 53937,
+ 12712,
+ 63297,
+ 50764,
+ 95321,
+ 97757,
+ 72342,
+ 62894,
+ 71239,
+ 77659,
+ 63198,
+ 84364,
+ 61075,
+ 51222,
+ 24995,
+ 16599,
+ 86925,
+ 99048,
+ 13542,
+ 12591,
+ 25905,
+ 32208,
+ 22133,
+ 41575,
+ 59604,
+ 16836,
+ 31682,
+ 69364,
+ 82188,
+ 41914,
+ 45576,
+ 25079,
+ 81537,
+ 46462,
+ 66551,
+ 26591,
+ 77328,
+ 33985,
+ 33418,
+ 91080,
+ 61568,
+ 57867,
+ 84472,
+ 12654,
+ 70565,
+ 42550,
+ 51259,
+ 13169,
+ 65905,
+ 15805,
+ 90109,
+ 76980,
+ 57913,
+ 72381,
+ 70281,
+ 78134,
+ 37955,
+ 93173,
+ 74086,
+ 58167,
+ 40765,
+ 23790,
+ 33592,
+ 78454,
+ 15430,
+ 67945,
+ 64241,
+ 83702,
+ 46375,
+ 26342,
+ 34863,
+ 19482,
+ 34284,
+ 38000,
+ 98157,
+ 15930,
+ 64693,
+ 12550,
+ 51953,
+ 77269,
+ 13652,
+ 86840,
+ 52314,
+ 98333,
+ 40687,
+ 35046,
+ 59975,
+ 72833,
+ 14044,
+ 71828,
+ 40577,
+ 51481,
+ 80118,
+ 55714,
+ 24410,
+ 99412,
+ 35437,
+ 48548,
+ 84964,
+ 75235,
+ 21303,
+ 83551,
+ 52760,
+ 85000,
+ 56259,
+ 42764,
+ 11312,
+ 24461,
+ 27237,
+ 58802,
+ 55301,
+ 74259,
+ 56046,
+ 19866,
+ 73679,
+ 33891,
+ 45639,
+ 54195,
+ 95097,
+ 57914,
+ 59298,
+ 89370,
+ 76504,
+ 56108,
+ 29130,
+ 33712,
+ 25154,
+ 96503,
+ 98909,
+ 40872,
+ 82776,
+ 63510,
+ 26533,
+ 56079,
+ 39398,
+ 47768,
+ 20341,
+ 99994,
+ 10110,
+ 57700,
+ 30209,
+ 94995,
+ 44918,
+ 66796,
+ 51995,
+ 77354,
+ 93013,
+ 54620,
+ 92444,
+ 93849,
+ 49161,
+ 28949,
+ 37715,
+ 23904,
+ 73156,
+ 42384,
+ 17773,
+ 58155,
+ 54490,
+ 56486,
+ 97223,
+ 32955,
+ 25281,
+ 15737,
+ 35697,
+ 18244,
+ 42515,
+ 40947,
+ 93475,
+ 14131,
+ 67547,
+ 95089,
+ 43557,
+ 11037,
+ 34322,
+ 22250,
+ 71266,
+ 89572,
+ 90169,
+ 17372,
+ 65790,
+ 27576,
+ 37101,
+ 73468,
+ 39721,
+ 65682,
+ 47073,
+ 90895,
+ 43637,
+ 78516,
+ 21073,
+ 92011,
+ 46069,
+ 26851,
+ 47448,
+ 65439,
+ 29023,
+ 51855,
+ 65553,
+ 80536,
+ 16678,
+ 90651,
+ 19633,
+ 93746,
+ 70591,
+ 94422,
+ 33657,
+ 52974,
+ 13630,
+ 69196,
+ 79490,
+ 32250,
+ 66530,
+ 32790,
+ 17127,
+ 92015,
+ 28249,
+ 65102,
+ 91455,
+ 64033,
+ 24017,
+ 45651,
+ 60117,
+ 96785,
+ 50649,
+ 15436,
+ 65914,
+ 36166,
+ 78692,
+ 91558,
+ 49051,
+ 66543,
+ 95701,
+ 38010,
+ 45785,
+ 64305,
+ 47125,
+ 66807,
+ 53798,
+ 39771,
+ 31704,
+ 62165,
+ 65163,
+ 29324,
+ 60646,
+ 91668,
+ 70470,
+ 49620,
+ 73173,
+ 50390,
+ 89026,
+ 81234,
+ 45456,
+ 39896,
+ 56209,
+ 48104,
+ 62372,
+ 39333,
+ 79867,
+ 95279,
+ 52605,
+ 75787,
+ 84796,
+ 38805,
+ 45963,
+ 27579,
+ 90333,
+ 32386,
+ 14026,
+ 19291,
+ 77541,
+ 99587,
+ 31439,
+ 42133,
+ 44755,
+ 85828,
+ 42114,
+ 59161,
+ 43113,
+ 19801,
+ 99100,
+ 65884,
+ 54308,
+ 65747,
+ 29500,
+ 41826,
+ 85615,
+ 70557,
+ 95815,
+ 87262,
+ 83658,
+ 81087,
+ 90172,
+ 89905,
+ 76914,
+ 97931,
+ 33944,
+ 12857,
+ 31425,
+ 47737,
+ 54370,
+ 30972,
+ 95939,
+ 65658,
+ 56393,
+ 19853,
+ 88897,
+ 82340,
+ 84119,
+ 56333,
+ 63170,
+ 46323,
+ 25888,
+ 93367,
+ 63331,
+ 16400,
+ 54046,
+ 47922,
+ 32747,
+ 29791,
+ 71231,
+ 57799,
+ 89922,
+ 58351,
+ 49144,
+ 44735,
+ 48818,
+ 73875,
+ 88792,
+ 95437,
+ 16461,
+ 47343,
+ 12386,
+ 91444,
+ 89445,
+ 24720,
+ 76245,
+ 53193,
+ 81174,
+ 62085,
+ 63488,
+ 25099,
+ 45860,
+ 59677,
+ 85517,
+ 38418,
+ 95501,
+ 21940,
+ 88869,
+ 15733,
+ 28860,
+ 65805,
+ 92611,
+ 73443,
+ 68225,
+ 59098,
+ 94473,
+ 45560,
+ 14714,
+ 72384,
+ 16713,
+ 59990,
+ 10894,
+ 32150,
+ 91101,
+ 87562,
+ 86572,
+ 15065,
+ 83303,
+ 96607,
+ 36622,
+ 52276,
+ 99240,
+ 46404,
+ 62733,
+ 67070,
+ 36323,
+ 14422,
+ 76755,
+ 76212,
+ 68464,
+ 69048,
+ 78830,
+ 92884,
+ 73029,
+ 73783,
+ 20321,
+ 23224,
+ 16276,
+ 10461,
+ 17913,
+ 28947,
+ 23436,
+ 18265,
+ 72046,
+ 61316,
+ 70861
+ ).sorted()
+ val list2 = listOf(
+ 55634,
+ 75018,
+ 95501,
+ 55714,
+ 78366,
+ 62509,
+ 15990,
+ 96324,
+ 57910,
+ 14717,
+ 92495,
+ 95004,
+ 83538,
+ 63476,
+ 61559,
+ 87324,
+ 31948,
+ 18349,
+ 70973,
+ 47466,
+ 14717,
+ 96393,
+ 13914,
+ 95954,
+ 14239,
+ 34634,
+ 14607,
+ 78200,
+ 23855,
+ 80316,
+ 19452,
+ 49491,
+ 87593,
+ 96160,
+ 52582,
+ 49491,
+ 65164,
+ 33641,
+ 55714,
+ 95501,
+ 18884,
+ 83702,
+ 70973,
+ 52220,
+ 93149,
+ 96694,
+ 48192,
+ 15065,
+ 41889,
+ 63631,
+ 62165,
+ 62894,
+ 27053,
+ 47769,
+ 76755,
+ 80470,
+ 55714,
+ 34601,
+ 55790,
+ 78366,
+ 95501,
+ 74658,
+ 33194,
+ 12345,
+ 46593,
+ 43900,
+ 95501,
+ 31096,
+ 12550,
+ 83702,
+ 52220,
+ 39771,
+ 81388,
+ 60545,
+ 58448,
+ 91287,
+ 36836,
+ 41677,
+ 41677,
+ 95125,
+ 42384,
+ 36037,
+ 17117,
+ 26136,
+ 49087,
+ 25849,
+ 76566,
+ 84695,
+ 42384,
+ 42384,
+ 47375,
+ 14607,
+ 44442,
+ 31831,
+ 42384,
+ 90670,
+ 28575,
+ 55714,
+ 83702,
+ 99168,
+ 30972,
+ 41677,
+ 46189,
+ 65158,
+ 84691,
+ 14239,
+ 52722,
+ 52930,
+ 49491,
+ 63132,
+ 54501,
+ 26753,
+ 69512,
+ 56271,
+ 89918,
+ 27775,
+ 95501,
+ 18798,
+ 56489,
+ 52220,
+ 96289,
+ 85343,
+ 41677,
+ 45037,
+ 14717,
+ 15065,
+ 28328,
+ 49491,
+ 46189,
+ 98951,
+ 99168,
+ 33812,
+ 41468,
+ 36618,
+ 27053,
+ 53516,
+ 12345,
+ 55714,
+ 12550,
+ 61671,
+ 27121,
+ 25499,
+ 91585,
+ 86789,
+ 32719,
+ 75443,
+ 98823,
+ 56489,
+ 10534,
+ 81862,
+ 21798,
+ 53241,
+ 55541,
+ 94956,
+ 29025,
+ 18426,
+ 35540,
+ 83730,
+ 78366,
+ 15782,
+ 46189,
+ 30972,
+ 37915,
+ 56261,
+ 83702,
+ 55865,
+ 15065,
+ 14898,
+ 62031,
+ 17436,
+ 61587,
+ 99808,
+ 51695,
+ 86863,
+ 14717,
+ 49491,
+ 66208,
+ 52603,
+ 26136,
+ 78366,
+ 78366,
+ 15065,
+ 96790,
+ 20525,
+ 46189,
+ 26136,
+ 27053,
+ 79069,
+ 14239,
+ 30166,
+ 80805,
+ 52600,
+ 56489,
+ 52600,
+ 56271,
+ 72844,
+ 79185,
+ 58952,
+ 10417,
+ 39771,
+ 76755,
+ 41677,
+ 30451,
+ 27053,
+ 27542,
+ 26136,
+ 30869,
+ 52220,
+ 34601,
+ 40426,
+ 95501,
+ 56489,
+ 14607,
+ 45220,
+ 54970,
+ 47973,
+ 96819,
+ 39771,
+ 52529,
+ 67718,
+ 17626,
+ 29641,
+ 62894,
+ 68684,
+ 89330,
+ 80231,
+ 44013,
+ 27002,
+ 58758,
+ 14239,
+ 94737,
+ 64083,
+ 56489,
+ 14717,
+ 14308,
+ 50086,
+ 11695,
+ 97014,
+ 56489,
+ 14607,
+ 20651,
+ 26237,
+ 39721,
+ 12345,
+ 39855,
+ 62165,
+ 56271,
+ 70973,
+ 84946,
+ 27121,
+ 33303,
+ 89399,
+ 35446,
+ 39771,
+ 49491,
+ 16061,
+ 44972,
+ 70973,
+ 98851,
+ 21798,
+ 71876,
+ 39771,
+ 25343,
+ 26646,
+ 28328,
+ 47460,
+ 96095,
+ 95501,
+ 43102,
+ 81862,
+ 70973,
+ 10254,
+ 47079,
+ 46286,
+ 42053,
+ 66988,
+ 27121,
+ 14239,
+ 62087,
+ 42384,
+ 96303,
+ 70973,
+ 21798,
+ 52179,
+ 48291,
+ 95222,
+ 81166,
+ 78723,
+ 22884,
+ 39721,
+ 22466,
+ 98147,
+ 41677,
+ 27121,
+ 76432,
+ 52568,
+ 56271,
+ 39046,
+ 82417,
+ 85385,
+ 41819,
+ 22488,
+ 76901,
+ 16456,
+ 70973,
+ 72092,
+ 69258,
+ 15363,
+ 33440,
+ 78366,
+ 45210,
+ 95501,
+ 24684,
+ 52220,
+ 77153,
+ 65651,
+ 22660,
+ 21798,
+ 46189,
+ 39771,
+ 12550,
+ 11236,
+ 39771,
+ 28328,
+ 34601,
+ 86449,
+ 14607,
+ 78067,
+ 83702,
+ 65003,
+ 11452,
+ 36155,
+ 25782,
+ 47994,
+ 41013,
+ 20279,
+ 34534,
+ 36291,
+ 85422,
+ 52406,
+ 70431,
+ 81862,
+ 64251,
+ 10652,
+ 14607,
+ 34601,
+ 49937,
+ 60524,
+ 52220,
+ 30972,
+ 12550,
+ 55735,
+ 34202,
+ 23203,
+ 68443,
+ 47344,
+ 99640,
+ 95501,
+ 42860,
+ 72844,
+ 78366,
+ 86108,
+ 60623,
+ 81862,
+ 44985,
+ 90447,
+ 81862,
+ 62281,
+ 94900,
+ 73969,
+ 42384,
+ 30964,
+ 28328,
+ 24873,
+ 52220,
+ 17266,
+ 74256,
+ 75269,
+ 52000,
+ 55316,
+ 33934,
+ 32349,
+ 36104,
+ 35349,
+ 58662,
+ 74304,
+ 38629,
+ 91593,
+ 36751,
+ 14607,
+ 30972,
+ 95154,
+ 52890,
+ 73820,
+ 48739,
+ 56489,
+ 14559,
+ 75319,
+ 52220,
+ 92873,
+ 21675,
+ 99240,
+ 78366,
+ 21810,
+ 28234,
+ 63254,
+ 78620,
+ 14469,
+ 42239,
+ 15446,
+ 52600,
+ 35748,
+ 76509,
+ 15436,
+ 76755,
+ 23336,
+ 12550,
+ 59480,
+ 78380,
+ 27053,
+ 57333,
+ 76094,
+ 91971,
+ 95357,
+ 81688,
+ 49007,
+ 75999,
+ 70973,
+ 66691,
+ 23385,
+ 14768,
+ 48182,
+ 90234,
+ 27775,
+ 57322,
+ 58353,
+ 14717,
+ 14239,
+ 34601,
+ 63426,
+ 83250,
+ 98026,
+ 63990,
+ 53572,
+ 25974,
+ 11925,
+ 72844,
+ 25161,
+ 73804,
+ 78366,
+ 79173,
+ 85825,
+ 15313,
+ 64946,
+ 52600,
+ 28328,
+ 70973,
+ 47478,
+ 95501,
+ 46847,
+ 30972,
+ 15065,
+ 76755,
+ 40028,
+ 81544,
+ 56271,
+ 56489,
+ 49491,
+ 42384,
+ 80995,
+ 65077,
+ 21798,
+ 52600,
+ 56086,
+ 62303,
+ 34601,
+ 27121,
+ 12345,
+ 48079,
+ 55714,
+ 56271,
+ 92370,
+ 23855,
+ 56271,
+ 33003,
+ 14239,
+ 21798,
+ 25747,
+ 60774,
+ 56489,
+ 52220,
+ 74754,
+ 14239,
+ 52600,
+ 41677,
+ 27775,
+ 20613,
+ 27053,
+ 49191,
+ 81862,
+ 80089,
+ 82040,
+ 34022,
+ 85672,
+ 14607,
+ 35936,
+ 11444,
+ 81574,
+ 55714,
+ 48397,
+ 74632,
+ 70973,
+ 29041,
+ 72844,
+ 96364,
+ 77922,
+ 35039,
+ 89711,
+ 14616,
+ 62165,
+ 65090,
+ 86139,
+ 46008,
+ 44592,
+ 62165,
+ 72080,
+ 27412,
+ 72844,
+ 42384,
+ 76147,
+ 21798,
+ 65427,
+ 99168,
+ 70973,
+ 70973,
+ 12443,
+ 51861,
+ 51073,
+ 30972,
+ 61678,
+ 91679,
+ 72844,
+ 24424,
+ 26674,
+ 70973,
+ 79932,
+ 37967,
+ 52600,
+ 99240,
+ 42384,
+ 56489,
+ 86672,
+ 62894,
+ 32030,
+ 52770,
+ 14717,
+ 11443,
+ 93881,
+ 80725,
+ 60551,
+ 49335,
+ 72639,
+ 62165,
+ 50347,
+ 39721,
+ 34601,
+ 52600,
+ 65043,
+ 78196,
+ 72844,
+ 36315,
+ 86175,
+ 43976,
+ 14239,
+ 42384,
+ 42384,
+ 92031,
+ 12345,
+ 10167,
+ 86468,
+ 60466,
+ 48514,
+ 11600,
+ 99168,
+ 49648,
+ 90046,
+ 28328,
+ 23855,
+ 15065,
+ 55320,
+ 76755,
+ 35621,
+ 56271,
+ 62908,
+ 32551,
+ 26068,
+ 49491,
+ 65599,
+ 14316,
+ 85487,
+ 54021,
+ 42384,
+ 12513,
+ 52594,
+ 19297,
+ 32234,
+ 31236,
+ 94041,
+ 21838,
+ 37352,
+ 14717,
+ 78366,
+ 96018,
+ 97837,
+ 19753,
+ 62165,
+ 70973,
+ 44001,
+ 41677,
+ 21798,
+ 64924,
+ 43682,
+ 34601,
+ 70973,
+ 34954,
+ 23030,
+ 28240,
+ 56374,
+ 95558,
+ 81033,
+ 30518,
+ 70973,
+ 62165,
+ 15065,
+ 64408,
+ 28328,
+ 34601,
+ 66708,
+ 27053,
+ 39771,
+ 34601,
+ 34601,
+ 82492,
+ 42887,
+ 74914,
+ 28817,
+ 85938,
+ 40779,
+ 78366,
+ 32921,
+ 59335,
+ 99168,
+ 12345,
+ 34718,
+ 82815,
+ 76636,
+ 30945,
+ 34601,
+ 37240,
+ 81295,
+ 33484,
+ 67805,
+ 49073,
+ 80068,
+ 18371,
+ 17145,
+ 80589,
+ 90417,
+ 94168,
+ 39721,
+ 93602,
+ 21798,
+ 46958,
+ 41677,
+ 95501,
+ 35957,
+ 37717,
+ 49491,
+ 52600,
+ 52600,
+ 89557,
+ 21798,
+ 61755,
+ 15065,
+ 26806,
+ 98399,
+ 81977,
+ 56489,
+ 65010,
+ 62507,
+ 24038,
+ 34601,
+ 34601,
+ 40279,
+ 76591,
+ 21709,
+ 52220,
+ 59302,
+ 94355,
+ 38777,
+ 75281,
+ 25359,
+ 47933,
+ 61504,
+ 28328,
+ 23895,
+ 12345,
+ 27053,
+ 49491,
+ 27053,
+ 46255,
+ 56271,
+ 96584,
+ 52220,
+ 14607,
+ 33277,
+ 75075,
+ 72844,
+ 70345,
+ 56271,
+ 23454,
+ 30972,
+ 29726,
+ 51050,
+ 21638,
+ 78721,
+ 27053,
+ 52600,
+ 55714,
+ 39018,
+ 95501,
+ 52220,
+ 43009,
+ 25161,
+ 34743,
+ 41677,
+ 42554,
+ 28328,
+ 29475,
+ 63539,
+ 66314,
+ 52220,
+ 30972,
+ 18563,
+ 51083,
+ 49491,
+ 81231,
+ 27053,
+ 77076,
+ 11025,
+ 14607,
+ 97003,
+ 95582,
+ 37280,
+ 27053,
+ 56489,
+ 95501,
+ 31922,
+ 62165,
+ 83547,
+ 64695,
+ 41677,
+ 95501,
+ 42384,
+ 28233,
+ 32491,
+ 61928,
+ 87569,
+ 21823,
+ 15065,
+ 14886,
+ 32452,
+ 27775,
+ 56489,
+ 27728,
+ 26309,
+ 53226,
+ 15776,
+ 98902,
+ 70973,
+ 87812,
+ 84461,
+ 14607,
+ 34601,
+ 83702,
+ 90585,
+ 52600,
+ 67883,
+ 78366,
+ 30972,
+ 18187,
+ 60451,
+ 28328,
+ 62894,
+ 18396,
+ 30730,
+ 52072,
+ 71619,
+ 52600,
+ 52220,
+ 41677,
+ 25161,
+ 65615,
+ 56489,
+ 70973,
+ 34601,
+ 80330,
+ 52600,
+ 96655,
+ 77648,
+ 25161,
+ 51573,
+ 94233,
+ 56271,
+ 81862,
+ 60802,
+ 54374,
+ 34741,
+ 62894,
+ 55714,
+ 52600,
+ 20887,
+ 28328,
+ 56271,
+ 14607,
+ 86054,
+ 27053,
+ 95501,
+ 22503,
+ 69007,
+ 56271,
+ 67504,
+ 15065,
+ 73240,
+ 55714,
+ 85539,
+ 18771,
+ 95501,
+ 84004,
+ 66585,
+ 64152,
+ 26097,
+ 71764,
+ 30702,
+ 37200,
+ 52600,
+ 29029,
+ 39771,
+ 65672,
+ 15065,
+ 14247,
+ 18620,
+ 36512,
+ 99202,
+ 82629,
+ 62894,
+ 27600,
+ 95501,
+ 40539,
+ 99003,
+ 56271,
+ 72035,
+ 47366,
+ 28328,
+ 88930,
+ 49491,
+ 27053,
+ 11986,
+ 34906,
+ 76755,
+ 99055,
+ 43550,
+ 72844,
+ 70973,
+ 55340,
+ 95942,
+ 16863,
+ 99168,
+ 46189,
+ 40119,
+ 91883,
+ 52600,
+ 59337,
+ 42384,
+ 14239,
+ 26731,
+ 22856,
+ 78366,
+ 25161,
+ 62894,
+ 28328,
+ 45495,
+ 70230,
+ 88861,
+ 95501,
+ 15065,
+ 83702,
+ 99725,
+ 27736,
+ 78366,
+ 13437,
+ 18052,
+ 52600,
+ 88914,
+ 52220,
+ 93458,
+ 14144,
+ 13271,
+ 65648,
+ 76222,
+ 34601,
+ 49301,
+ 76755,
+ 41677,
+ 41823,
+ 46298,
+ 11280,
+ 44705,
+ 60268,
+ 56271,
+ 97212,
+ 76755,
+ 21741,
+ 42384,
+ 52220,
+ 16019,
+ 15436,
+ 46189,
+ 27121,
+ 49491,
+ 56271,
+ 56489,
+ 24568,
+ 39771,
+ 31753,
+ 76932,
+ 37078,
+ 12345,
+ 27053,
+ 67447,
+ 52600,
+ 78366,
+ 31757,
+ 42384,
+ 34473,
+ 46189,
+ 27053,
+ 52654,
+ 98942,
+ 24726,
+ 98584,
+ 11941,
+ 45484,
+ 21798,
+ 78366,
+ 30972,
+ 30972,
+ 77281,
+ 74187,
+ 49491,
+ 34601,
+ 47592,
+ 41677,
+ 14239,
+ 69119,
+ 76150,
+ 12345,
+ 92795,
+ 14607,
+ 57058,
+ 19835,
+ 56887,
+ 49491,
+ 76755,
+ 25566,
+ 99330,
+ 52220,
+ 83417,
+ 28328,
+ 76755,
+ 29889,
+ 52600,
+ 77863,
+ 62165,
+ 21798,
+ 89470,
+ 52220,
+ 72758,
+ 30562,
+ 27053,
+ 54765,
+ 28328,
+ 36193,
+ 18463,
+ 27143,
+ 56489,
+ 42384,
+ 30416,
+ 42384,
+ 52220
+ ).sorted()
+ var res1 = 0
+ list1.zip(list2).forEach { it ->
+ res1 += abs(it.second - it.first)
}
-
- // Test if implementation meets criteria from the description, like:
- check(part1(listOf("test_input")) == 1)
-
- // Or read a large test input from the `src/Day01_test.txt` file:
- val testInput = readInput("Day01_test")
- check(part1(testInput) == 1)
-
- // Read the input from the `src/Day01.txt` file.
- val input = readInput("Day01")
- part1(input).println()
- part2(input).println()
-}
+ "day1-1 $res1".println()
+ val res2 = list1.fold(0, { acc, it -> acc + it * list2.filter { it2 -> it2 == it }.size })
+ "day1-2: $res2".println()
+}
\ No newline at end of file
diff --git a/src/Day02.kt b/src/Day02.kt
new file mode 100644
index 0000000..29d6306
--- /dev/null
+++ b/src/Day02.kt
@@ -0,0 +1,37 @@
+fun main() {
+ val input =
+ readInput("day02").map { it.split(" ").toList().map { it.toInt() } }
+
+ val safeList = input.map {
+ isSafe(it)
+ }
+ val res1 = safeList.filter { it }.size
+ "day2-1: $res1".println()
+ val lessSafeList = input.map {
+ isSafe(it) || bruteForceCheckSafe(it)
+ }
+ val res2 = lessSafeList.filter { it }.size
+ "day2-2: $res2".println()
+}
+
+fun isSafe(input: List): Boolean {
+ val isIncreasing: Boolean = input[0] <= input[1]
+ input.forEachIndexed { index, _ ->
+ if (index >= input.size - 1) return true
+ if (isIncreasing) {
+ if (input[index + 1] - input[index] < 1 || input[index + 1] - input[index] > 3) return false
+ } else {
+ if (input[index] - input[index + 1] < 1 || input[index] - input[index + 1] > 3) return false
+ }
+ }
+ return true
+}
+
+fun bruteForceCheckSafe(input: List): Boolean {
+ for (i in input.indices) {
+ val sublist = input.toMutableList()
+ sublist.removeAt(i)
+ if (isSafe(sublist)) return true
+ }
+ return false
+}
\ No newline at end of file
diff --git a/src/Day03.kt b/src/Day03.kt
new file mode 100644
index 0000000..e6ba097
--- /dev/null
+++ b/src/Day03.kt
@@ -0,0 +1,26 @@
+fun main() {
+ val inputs = readInput("day03tj")
+ val input = inputs.fold("") { acc, str -> acc.plus(str) }
+ val res1 = extractNumberPairs(input)
+ .fold(0) { acc2, pair -> acc2 + pair.first * pair.second }
+ println("day3-1: $res1")
+
+ val input2 = input.split("""do()""").drop(1).map { it.split("""don't()""", limit = 2).first() }
+ input2.forEach(::println)
+ val res2 = input2.fold(0) {
+ acc, input -> acc + extractNumberPairs(input)
+ .fold(0) { acc2, pair -> acc2 + pair.first * pair.second }
+ }
+ println("day3-2: $res2")
+}
+
+fun extractNumberPairs(input: String): List> {
+ // Regex to capture numbers from mul(xxx,xxx)
+ val pattern = Regex("""mul\((\d{1,3}),(\d{1,3})\)""")
+ return pattern.findAll(input).map { matchResult ->
+ // Extract the two captured groups and convert them to integers
+ val first = matchResult.groupValues[1].toInt()
+ val second = matchResult.groupValues[2].toInt()
+ Pair(first, second)
+ }.toList()
+}
\ No newline at end of file
diff --git a/src/Day04.kt b/src/Day04.kt
new file mode 100644
index 0000000..d6b9226
--- /dev/null
+++ b/src/Day04.kt
@@ -0,0 +1,204 @@
+fun main() {
+ val inputs = readInput("day04")
+ var res = findXmasHorizontal(inputs)
+ res += findXmasHorizontal(transposeMatrix(inputs))
+ res += findXmasHorizontal(getDiagonalMatrix(inputs))
+ println(res)
+
+ val res2 = findXmasAllDirections(inputs)
+ println(res2)
+
+ val res3 = findAllMas(inputs)
+ println(res3)
+}
+
+fun findXmasAllDirections(inputs: List): Int {
+ var i = 0
+ var res = 0
+ while (i < inputs.size) {
+ var j = 0
+ while (j < inputs.size) {
+ if (inputs[i][j] == 'X') {
+ try {
+ if (isXmas(inputs[i][j], inputs[i][j + 1], inputs[i][j + 2], inputs[i][j + 3])) {
+ res++
+ }
+ } catch (e: IndexOutOfBoundsException) {
+
+ }
+ try {
+ if (isXmas(inputs[i][j], inputs[i][j - 1], inputs[i][j - 2], inputs[i][j - 3])) {
+ res++
+ }
+ } catch (e: IndexOutOfBoundsException) {
+
+ }
+ try {
+ if (isXmas(inputs[i][j], inputs[i + 1][j], inputs[i + 2][j], inputs[i + 3][j])) {
+ res++
+ }
+ } catch (e: IndexOutOfBoundsException) {
+
+ }
+ try {
+ if (isXmas(inputs[i][j], inputs[i - 1][j], inputs[i - 2][j], inputs[i - 3][j])) {
+ res++
+ }
+ } catch (e: IndexOutOfBoundsException) {
+
+ }
+ try {
+ if (isXmas(inputs[i][j], inputs[i + 1][j + 1], inputs[i + 2][j + 2], inputs[i + 3][j + 3])) {
+ res++
+ }
+ } catch (e: IndexOutOfBoundsException) {
+
+ }
+ try {
+ if (isXmas(inputs[i][j], inputs[i - 1][j + 1], inputs[i - 2][j + 2], inputs[i - 3][j + 3])) {
+ res++
+ }
+ } catch (e: IndexOutOfBoundsException) {
+
+ }
+ try {
+ if (isXmas(inputs[i][j], inputs[i + 1][j - 1], inputs[i + 2][j - 2], inputs[i + 3][j - 3])) {
+ res++
+ }
+ } catch (e: IndexOutOfBoundsException) {
+
+ }
+ try {
+ if (isXmas(inputs[i][j], inputs[i - 1][j - 1], inputs[i - 2][j - 2], inputs[i - 3][j - 3])) {
+ res++
+ }
+ } catch (e: IndexOutOfBoundsException) {
+
+ }
+ }
+ j++
+ }
+ i++
+ }
+ return res
+}
+
+fun isXmas(char1: Char, char2: Char, char3: Char, char4: Char): Boolean {
+ return char1 == 'X' && char2 == 'M' && char3 == 'A' && char4 == 'S'
+}
+
+fun findAllMas(inputs: List): Int {
+ var i = 0
+ var res = 0
+ while (i < inputs.size) {
+ var j = 0
+ while (j < inputs.size) {
+ if (inputs[i][j] == 'A') {
+ try {
+ if (isMas(inputs[i - 1][j - 1], inputs[i + 1][j + 1], inputs[i - 1][j + 1], inputs[i + 1][j - 1])) {
+ res++
+ }
+ } catch (e: IndexOutOfBoundsException) {
+
+ }
+ }
+ j++
+ }
+ i++
+ }
+ return res
+
+}
+
+fun isMas(char1: Char, char2: Char, char3: Char, char4: Char): Boolean {
+ if (char1 == 'M' && char2 == 'S' || char1 == 'S' && char2 == 'M') {
+ if (char3 == 'M' && char4 == 'S' || char3 == 'S' && char4 == 'M') {
+ return true
+ }
+ }
+ return false
+}
+
+fun findXmasHorizontal(inputs: List): Int {
+ var res = 0
+ inputs.forEach { input ->
+ for (index in 0 until input.length - 3) {
+ if (index < input.length - 4) {
+ if (input.substring(index, index + 4) == "XMAS" || input.substring(index, index + 4) == "SAMX") {
+ res++
+ }
+ }
+ }
+ }
+ return res
+}
+
+fun transposeMatrix(input: List): List {
+ val output = mutableListOf()
+ for (i in 0 until input.size) {
+ val stringBuilder = StringBuilder()
+ for (j in input[i].indices) {
+ stringBuilder.append(input[j][i])
+ }
+ output.add(stringBuilder.toString())
+ }
+ return output
+}
+
+fun getDiagonalMatrix(input: List): List {
+ val output = mutableListOf()
+ var iterations = 0
+ while (iterations < input.size) {
+ var i = 0
+ var j = iterations
+ val strBuilder = StringBuilder()
+ while (j > 0) {
+ strBuilder.append(input[i][j])
+ i++
+ j--
+ }
+ output.add(strBuilder.toString())
+ iterations++
+ }
+ iterations = input.size - 2
+ while (iterations >= 0) {
+ var i = input.size - 1 - iterations
+ var j = iterations
+ val strBuilder = StringBuilder()
+ while (i < input.size) {
+ strBuilder.append(input[i][j])
+ i++
+ j--
+ }
+ output.add(strBuilder.toString())
+ iterations--
+ }
+ iterations = input.size - 1
+ while (iterations >= 0) {
+ var i = iterations
+ var j = 0
+ val strBuilder = StringBuilder()
+ while (i < input.size) {
+ strBuilder.append(input[i][j])
+ i++
+ j++
+ }
+ output.add(strBuilder.toString())
+ iterations--
+ }
+ iterations = 1
+ while (iterations < input.size) {
+ var i = 0
+ var j = iterations
+
+ val strBuilder = StringBuilder()
+ while (j < input.size) {
+ strBuilder.append(input[i][j])
+ i++
+ j++
+ }
+ output.add(strBuilder.toString())
+ iterations++
+ }
+ return output
+}
\ No newline at end of file
diff --git a/src/Day05.kt b/src/Day05.kt
new file mode 100644
index 0000000..ca0eab2
--- /dev/null
+++ b/src/Day05.kt
@@ -0,0 +1,63 @@
+class Node(
+ val value: Int,
+ val parent: List = listOf()
+)
+
+fun main() {
+ val rulesInput = readInput("day05p1").map {
+ Pair(it.split('|')[0].toInt(), it.split('|')[1].toInt())
+ }
+ val pagesInput = readInput("day05p2").map {
+ it.split(',').map { it.toInt() }
+ }
+ val rulesNodeMap = mutableMapOf()
+ rulesInput.forEach {
+ val parentNode = rulesNodeMap[it.first] ?: Node(it.first)
+ val childNode =
+ Node(it.second, (rulesNodeMap[it.second] ?: Node(it.second, mutableListOf())).parent.plus(parentNode))
+ rulesNodeMap[it.first] = parentNode
+ rulesNodeMap[it.second] = childNode
+ }
+ val validPages = pagesInput.filter { isValidPage(it, rulesNodeMap) }
+ val res1 = validPages.fold(0) { acc, page -> acc + page[page.size / 2] }
+ println(res1)
+ val invalidPages = pagesInput.filterNot { isValidPage(it, rulesNodeMap) }
+ val reorderedPagges = invalidPages.map { reorderPage(it, rulesNodeMap) }
+ val res2 = reorderedPagges.fold(0) { acc, page -> acc + page[page.size / 2] }
+ res2.println()
+}
+
+fun isValidPage(input: List, map: Map): Boolean {
+ input.forEachIndexed { index, num ->
+ val node = map[num]
+ if (node != null) {
+ for (i in index + 1 until input.size - 1) {
+ if (node.parent.map { it.value }.contains(input[i])) return false
+ }
+ }
+ }
+ return true
+}
+
+fun reorderPage(input: List, map: Map): List {
+ val outputList = input.filter{map[it] == null}.toMutableList()
+ var numsToReorder = input.filter { map[it] != null }
+ while (numsToReorder.isNotEmpty()) {
+ val numsToRemove = numsWithoutParentNode(numsToReorder, map)
+ outputList.addAll(numsToRemove)
+ numsToReorder = numsToReorder.filterNot { numsToRemove.contains(it) }
+ }
+ return outputList.toList()
+}
+
+fun numsWithoutParentNode(input: List, map: Map): List {
+ return input.filterNot {
+ var hasParent = false
+ map[it]!!.parent.forEach { parent ->
+ if(input.contains(parent.value)) {
+ hasParent = true
+ }
+ }
+ hasParent
+ }
+}
diff --git a/src/Day06.kt b/src/Day06.kt
new file mode 100644
index 0000000..e4686b6
--- /dev/null
+++ b/src/Day06.kt
@@ -0,0 +1,242 @@
+fun main() {
+ var res = 1
+ var basePosition = Pair(0, 0)
+ val directionDict = listOf(Pair(-1, 0), Pair(0, 1), Pair(1, 0), Pair(0, -1))
+ var baseDirectionIndex = 0
+ var notStuck = true
+ val input = readInput("day06")
+ val inputMap = input.mapIndexed { index, it ->
+ it.mapIndexed { index2, c ->
+ when (c) {
+ '.' -> 0
+ '#' -> 1
+ else -> {
+ basePosition = Pair(index, index2)
+ baseDirectionIndex = getDirection(c)
+ 0
+ }
+ }
+ }
+ }
+ var directionIndex = baseDirectionIndex
+ var position = basePosition
+ val outputMap = input.map {
+ it.map { c ->
+ when (c) {
+ '.' -> mutableListOf(false, false, false, false)
+ '#' -> mutableListOf(false, false, false, false)
+ else -> mutableListOf(
+ directionIndex == 0,
+ directionIndex == 1,
+ directionIndex == 2,
+ directionIndex == 3
+ )
+ }
+ }.toMutableList()
+ }.toMutableList()
+ var maybeStuck = false
+ while (notStuck) {
+// println("current position: $position, direction: ${directionDict[directionIndex]}")
+ if (outputMap[position.first][position.second] == mutableListOf(false, false, false, false)) {
+ res++
+ }
+ outputMap[position.first][position.second][directionIndex] = true
+ val nextPositionCoords = Pair(
+ position.first + directionDict[directionIndex].first,
+ position.second + directionDict[directionIndex].second
+ )
+ if (nextPositionCoords.first < 0 || nextPositionCoords.second < 0 || nextPositionCoords.first > inputMap.lastIndex || nextPositionCoords.second > inputMap[0].lastIndex) {
+ notStuck = false
+ } else {
+ val nextPosition = inputMap[nextPositionCoords.first][nextPositionCoords.second]
+ if (nextPosition == 1) {
+ directionIndex = getNextDirection(directionIndex)
+ if (maybeStuck) {
+ notStuck = false
+ } else {
+ maybeStuck = true
+ }
+ } else {
+ maybeStuck = false
+ position = nextPositionCoords
+ }
+ }
+ }
+ println("day06-1: $res")
+
+ val res2 = part2(inputMap, outputMap, basePosition, baseDirectionIndex)
+ println("day06-2: $res2")
+}
+
+fun dummy() {
+// position = basePosition
+// directionIndex = baseDirectionIndex
+// val distinctObs = mutableListOf>()
+// notStuck = true
+// maybeStuck = false
+// val newOutputMap =
+// outputMap.map { it.map { lst -> lst.map { _ -> false }.toMutableList() }.toMutableList() }.toMutableList()
+// while (notStuck) {
+// val nextPositionCoords = Pair(
+// position.first + directionDict[directionIndex].first,
+// position.second + directionDict[directionIndex].second
+// )
+// if (nextPositionCoords.first < 0 || nextPositionCoords.second < 0 || nextPositionCoords.first > inputMap.lastIndex || nextPositionCoords.second > inputMap[0].lastIndex) {
+// notStuck = false
+// } else {
+// newOutputMap[position.first][position.second][directionIndex] = true
+// val nextPosition = inputMap[nextPositionCoords.first][nextPositionCoords.second]
+// if (nextPosition == 1) {
+// directionIndex = getNextDirection(directionIndex)
+//// if (maybeStuck) {
+//// notStuck = false
+//// } else {
+//// maybeStuck = true
+//// }
+// } else {
+// maybeStuck = false
+// if (newOutputMap[nextPositionCoords.first][nextPositionCoords.second][directionIndex] || newOutputMap[position.first][position.second][getNextDirection(
+// directionIndex
+// )]
+// ) {
+//// if (!distinctObs.contains(Pair(nextPositionCoords.first, nextPositionCoords.second))) {
+// distinctObs.add(Pair(nextPositionCoords.first, nextPositionCoords.second))
+//// }
+// } else {
+// if (findWithoutNewObstacle(
+// position,
+// getNextDirection(directionIndex),
+// inputMap,
+// newOutputMap
+// )
+// ) {
+// val newPair = Pair(
+// position.first + directionDict[getNextDirection(directionIndex)].first,
+// position.second + directionDict[getNextDirection(directionIndex)].second
+// )
+// distinctObs.add(newPair)
+// }
+// }
+// position = nextPositionCoords
+// }
+// }
+// }
+//
+// println("day06-2: ${distinctObs.size}")
+// println("distinct: ${distinctObs.distinct().size}")
+}
+
+fun getDirection(c: Char): Int = when (c) {
+ '^' -> 0
+ '>' -> 1
+ 'v' -> 2
+ '<' -> 3
+ else -> -1
+}
+
+fun getNextDirection(curr: Int): Int = (curr + 1) % 4
+
+
+fun findWithoutNewObstacle(
+ pos: Pair,
+ dir: Int,
+ inputMap: List>,
+ outputMap: List>>
+): Boolean {
+ val newOutputMap = outputMap.map { it.map { lst -> lst.map { bool -> bool }.toMutableList() }.toMutableList() }
+ .toMutableList()
+ val directionDict = listOf(Pair(-1, 0), Pair(0, 1), Pair(1, 0), Pair(0, -1))
+ var position = pos
+ var directionIndex = dir
+ var maybeStuck = false
+ var notStuck = true
+ while (notStuck) {
+ val nextPositionCoords = Pair(
+ position.first + directionDict[directionIndex].first,
+ position.second + directionDict[directionIndex].second
+ )
+ if (nextPositionCoords.first < 0 || nextPositionCoords.second < 0 || nextPositionCoords.first > inputMap.lastIndex || nextPositionCoords.second > inputMap[0].lastIndex) {
+ notStuck = false
+ } else {
+ newOutputMap[position.first][position.second][directionIndex] = true
+ val nextPosition = inputMap[nextPositionCoords.first][nextPositionCoords.second]
+ if (nextPosition == 1) {
+ directionIndex = getNextDirection(directionIndex)
+// if (maybeStuck) {
+// notStuck = false
+// } else {
+// maybeStuck = true
+// }
+ } else {
+ maybeStuck = false
+ if (newOutputMap[nextPositionCoords.first][nextPositionCoords.second][directionIndex]) {
+ return true
+ }
+ position = nextPositionCoords
+ }
+ }
+ }
+ return false
+}
+
+fun part2(inputMap: List>, outputMap: MutableList>>, position: Pair, directionIndex: Int): Int {
+// val input = inputMap.map { it.toMutableList() }.toMutableList()
+ var res = 0
+ for (i in inputMap.indices) {
+ for (j in inputMap[i].indices) {
+ if (inputMap[i][j] == 1) continue
+ var toCheck = false
+ try {
+ if (outputMap[i - 1][j][2]) toCheck = true
+ } catch (e: IndexOutOfBoundsException) {
+ }
+ try {
+ if (outputMap[i][j - 1][1]) toCheck = true
+ } catch (e: IndexOutOfBoundsException) {
+ }
+ try {
+ if (outputMap[i + 1][j][0]) toCheck = true
+ } catch (e: IndexOutOfBoundsException) {
+ }
+ try {
+ if (outputMap[i][j + 1][3]) toCheck = true
+ } catch (e: IndexOutOfBoundsException) {
+ }
+ if (toCheck) {
+ if (checkLoop(inputMap, Pair(i, j), position, directionIndex)) res++
+ }
+ }
+ }
+ return res
+}
+
+fun checkLoop(inputMap: List>, pair: Pair, pos: Pair, dir: Int): Boolean {
+ val input = inputMap.map { it.toMutableList() }.toMutableList()
+ input[pair.first][pair.second] = 1
+ val outputMap = inputMap.map { it.map {_ -> mutableListOf(false, false, false, false)}.toMutableList()}.toMutableList()
+ val directionDict = listOf(Pair(-1, 0), Pair(0, 1), Pair(1, 0), Pair(0, -1))
+ var directionIndex = dir
+ var position = pos
+ var notStuck = true
+ while (notStuck) {
+ outputMap[position.first][position.second][directionIndex] = true
+ val nextPositionCoords = Pair(
+ position.first + directionDict[directionIndex].first,
+ position.second + directionDict[directionIndex].second
+ )
+ try {
+ val nextPosition = input[nextPositionCoords.first][nextPositionCoords.second]
+ if (nextPosition == 1) {
+ directionIndex = getNextDirection(directionIndex)
+ } else {
+ if (outputMap[nextPositionCoords.first][nextPositionCoords.second][directionIndex]) {
+ return true
+ }
+ position = nextPositionCoords
+ }
+ } catch (e: IndexOutOfBoundsException) {
+ return false
+ }
+ }
+ return false
+}
diff --git a/src/Day07.kt b/src/Day07.kt
new file mode 100644
index 0000000..4790799
--- /dev/null
+++ b/src/Day07.kt
@@ -0,0 +1,52 @@
+fun main() {
+ val input = readInput("day07")
+ val inputMap = input.map {
+ it.split(": ")[0].toLong() to it.split(": ")[1].split(' ').map { it.toLong() }
+ }
+ val res1 = part1(inputMap)
+ println("day07-1: $res1")
+ val res2 = part2(inputMap)
+ println("day07-2: $res2")
+}
+
+private fun part1(input: List>>): Long {
+ var res = input.map {
+ if (computeAddMult(it.second, it.second[0], it.first, 1)) it.first else 0
+ }.sum()
+ return res
+}
+
+private fun computeAddMult(input: List, curr: Long, target: Long, idx: Int): Boolean {
+ if (idx >= input.size) return curr == target
+ return computeAddMult(input, curr + input[idx], target, idx + 1) || computeAddMult(
+ input,
+ curr * input[idx],
+ target,
+ idx + 1
+ )
+}
+
+private fun part2(input: List>>): Long {
+ var res = input.map {
+ if (compute(it.second, it.second[0], it.first, 1)) it.first else 0
+ }.sum()
+ return res
+}
+
+private fun compute(input: List, curr: Long, target: Long, idx: Int): Boolean {
+ if (idx >= input.size) return curr == target
+ if (curr > target) return false
+
+ return compute(input, curr + input[idx], target, idx + 1) || compute(
+ input,
+ curr * input[idx],
+ target,
+ idx + 1
+ ) || compute(input, computeConcat(curr, input[idx]), target, idx + 1)
+}
+
+private fun computeConcat(num1: Long, num2: Long): Long {
+ if (num1 == 0L) return num2
+ if (num2 == 0L) return num1
+ return num1.toString().plus(num2.toString()).toLong()
+}
\ No newline at end of file
diff --git a/src/Day08.kt b/src/Day08.kt
new file mode 100644
index 0000000..f781f0c
--- /dev/null
+++ b/src/Day08.kt
@@ -0,0 +1,85 @@
+fun main() {
+ val input = readInput("day08")
+ val res1 = part1(input)
+ println("day08-1: $res1")
+ val res2 = part2(input)
+ println("day08-2: $res2")
+}
+private fun part1(input: List): Int {
+ val charMap = mutableMapOf>>()
+ input.forEachIndexed { index, s ->
+ s.forEachIndexed { idx, c ->
+ if (c != '.') {
+ charMap[c] = charMap.getOrDefault(c, emptyList()).plus(Pair(index, idx))
+ }
+ }
+ }
+ val resList = mutableListOf>()
+ charMap.forEach { (c, list) ->
+ var i = 0
+ while (i < list.size - 1) {
+ var j = i + 1
+ while (j < list.size) {
+ val pair1 = Pair(2 * list[i].first - list[j].first, 2 * list[i].second - list[j].second)
+ val pair2 = Pair(2 * list[j].first - list[i].first, 2 * list[j].second - list[i].second)
+ if (pair1.validateCoords(input.lastIndex, input[0].lastIndex)) resList.add(pair1)
+ if (pair2.validateCoords(input.lastIndex, input[0].lastIndex)) resList.add(pair2)
+ j++
+ }
+ i++
+ }
+ }
+ return resList.distinct().size
+}
+
+private fun part2(input: List): Int {
+ val charMap = mutableMapOf>>()
+ input.forEachIndexed { index, s ->
+ s.forEachIndexed { idx, c ->
+ if (c != '.') {
+ charMap[c] = charMap.getOrDefault(c, emptyList()).plus(Pair(index, idx))
+ }
+ }
+ }
+ val resList = mutableListOf>()
+ charMap.forEach { (c, list) ->
+ var i = 0
+ while (i < list.size - 1) {
+ var j = i + 1
+ while (j < list.size) {
+// Check 2 directions in loop
+ val diff1 = Pair(list[j].first - list[i].first, list[j].second - list[i].second)
+ var continueChecking = true
+ var iterations = 0
+ while (continueChecking) {
+ val pair = Pair(list[i].first - diff1.first * iterations, list[i].second - diff1.second * iterations)
+ if (pair.validateCoords(input.lastIndex, input[0].lastIndex)) {
+ resList.add(pair)
+ iterations++
+ } else {
+ continueChecking = false
+ }
+ }
+ iterations = 0
+ continueChecking = true
+ var diff2 = Pair(list[i].first - list[j].first, list[i].second - list[j].second)
+ while (continueChecking) {
+ val pair = Pair(list[j].first - diff2.first * iterations, list[j].second - diff2.second * iterations)
+ if (pair.validateCoords(input.lastIndex, input[0].lastIndex)) {
+ resList.add(pair)
+ iterations++
+ } else {
+ continueChecking = false
+ }
+ }
+ j++
+ }
+ i++
+ }
+ }
+ return resList.distinct().size
+}
+
+private fun Pair.validateCoords(xLim: Int, yLim: Int): Boolean {
+ return !(this.first < 0 || this.second < 0 || this.first > xLim || this.second > yLim)
+}
\ No newline at end of file
diff --git a/src/Day09.kt b/src/Day09.kt
new file mode 100644
index 0000000..49fb3b9
--- /dev/null
+++ b/src/Day09.kt
@@ -0,0 +1,127 @@
+class Day09 : Application {
+ override fun run(fileName: String): Pair {
+ val input = readInput(fileName)[0]
+ val res1 = this.part1(input)
+ val res2 = this.part2(input)
+ return res1 to res2
+ }
+
+ private fun part1(input: String): Long {
+ val initialStr = computeStr(input)
+// println("Initial string: $initialStr")
+ val finalStr = rearrange(initialStr)
+// println("Final string: $finalStr")
+ val checkSum = computeChecksum(finalStr)
+ return checkSum
+ }
+
+ private fun part2(input: String): Long {
+ val initialList = computeListOfPairs(input)
+// "Initial List: $initialList".println()
+ val rearrangedList = rearrangeList(initialList)
+// "Rearranged List: $rearrangedList".println()
+ val finalList = getListOfNums(rearrangedList)
+// "Final List: $finalList".println()
+ val checkSum = computeChecksum(finalList)
+ return checkSum
+ }
+
+ private fun computeStr(input: String): List {
+ val resList = mutableListOf()
+ var digit = 0
+ input.forEachIndexed { index, c ->
+ val numOfDigits = c.digitToInt()
+ if (index % 2 == 0) {
+ for (i in 0 until numOfDigits) {
+ resList.add(digit)
+ }
+// digit = (digit + 1) % 10
+ digit++
+ } else {
+ for (i in 0 until numOfDigits) {
+ resList.add(-1)
+ }
+ }
+ }
+ return resList
+ }
+
+ private fun rearrange(input: List): List {
+ var lastIdx = input.lastIndex
+ var firstIdx = 0
+ val resList = mutableListOf()
+ while (lastIdx >= firstIdx) {
+ if (input[firstIdx] == -1) {
+ while (input[lastIdx] == -1) {
+ if (lastIdx <= firstIdx) break
+ lastIdx--
+ }
+ resList.add(input[lastIdx--])
+ } else {
+ resList.add(input[firstIdx])
+ }
+ firstIdx++
+ }
+ return resList
+ }
+
+ private fun computeChecksum(input: List): Long {
+ var sum = 0L
+ input.forEachIndexed { index, c ->
+ if (c != -1) sum += index * c.toLong()
+ }
+ return sum
+ }
+
+// return list of pairs of int to int, first is number of digits, second is id
+ private fun computeListOfPairs(input: String): MutableList> {
+ val resList = mutableListOf>()
+ var digit = 0
+ input.forEachIndexed { index, c ->
+ if (index % 2 == 0) {
+ resList.add(Pair(c.digitToInt(), digit++))
+ } else resList.add(Pair(c.digitToInt(), -1))
+ }
+ return resList
+ }
+
+ private fun rearrangeList(input: MutableList>): List> {
+ var lastIdx = input.lastIndex
+ while (lastIdx >= 0) {
+ if (input[lastIdx].second != -1) {
+ var firstIdx = 0
+ while (firstIdx < lastIdx) {
+ if (input[firstIdx].second == -1) {
+ if (input[firstIdx].first >= input[lastIdx].first) {
+ val temp = input[lastIdx]
+ input[lastIdx] = Pair(temp.first, -1)
+ input[firstIdx] = Pair(input[firstIdx].first - temp.first, -1)
+ input.add(firstIdx, temp)
+ lastIdx++
+ break
+ }
+ }
+ firstIdx++
+ }
+ }
+ lastIdx--
+ }
+ return input
+ }
+
+ private fun getListOfNums(input: List>): List {
+ val resList = mutableListOf()
+ input.forEach {
+ if (it.second == -1) {
+ for (i in 0 until it.first) {
+ resList.add(0)
+ }
+ } else {
+ for (i in 0 until it.first) {
+ resList.add(it.second)
+ }
+ }
+ }
+ return resList
+ }
+}
\ No newline at end of file
diff --git a/src/Day10.kt b/src/Day10.kt
new file mode 100644
index 0000000..85fefe8
--- /dev/null
+++ b/src/Day10.kt
@@ -0,0 +1,67 @@
+class Day10 : Application {
+ val directions = listOf(Pair(-1, 0), Pair(0, 1), Pair(1, 0), Pair(0, -1))
+ override fun run(fileName: String): Pair {
+ val input = readInput(fileName).map { it.map { c -> c.digitToInt() } }
+ val res1 = this.part1(input)
+ val res2 = this.part2(input)
+ return res1 to res2
+ }
+
+ private fun part1(input: List>): Long = compute(input, true).map { it.value.size }.sum().toLong()
+
+ private fun part2(input: List>): Long {
+ val resMap = compute(input, false)
+ return resMap.map { it.value.size }.sum().toLong()
+ }
+
+ private fun compute(
+ input: List>,
+ distinct: Boolean
+ ): MutableMap, List>> {
+ val resMap = mutableMapOf, List>>()
+ for (i in input.indices) {
+ for (j in input[i].indices) {
+ if (input[i][j] == 0) {
+ resMap[Pair(i, j)] =
+ if (distinct) computeTrail(input, Pair(i, j), 0).distinct() else computeTrail(
+ input,
+ Pair(i, j),
+ 0
+ )
+ }
+ }
+ }
+ return resMap
+ }
+
+ private fun computeTrail(
+ input: List>,
+ coord: Pair,
+ currTarget: Int
+ ): List> {
+ try {
+ if (input[coord.first][coord.second] == currTarget) {
+ return if (currTarget == 9) {
+ listOf(coord)
+ } else {
+ computeTrail(input, getNewDir(coord, 0), currTarget + 1).plus(
+ computeTrail(
+ input,
+ getNewDir(coord, 1),
+ currTarget + 1
+ )
+ ).plus(computeTrail(input, getNewDir(coord, 2), currTarget + 1))
+ .plus(computeTrail(input, getNewDir(coord, 3), currTarget + 1))
+ }
+ } else {
+ return listOf()
+ }
+ } catch (e: IndexOutOfBoundsException) {
+ return listOf()
+ }
+ }
+
+
+ private fun getNewDir(coord: Pair, dir: Int): Pair =
+ Pair(coord.first + directions[dir].first, coord.second + directions[dir].second)
+}
\ No newline at end of file
diff --git a/src/Day11.kt b/src/Day11.kt
new file mode 100644
index 0000000..816bafb
--- /dev/null
+++ b/src/Day11.kt
@@ -0,0 +1,87 @@
+import kotlin.math.abs
+import kotlin.math.log10
+
+class Day11 : Application {
+ override fun run(fileName: String): Pair {
+ val input = readInput(fileName)[0].split(' ').map { it.toLong() }
+ input.println()
+ val res1 = this.part1(input)
+ val res2 = this.part2(input)
+ return res1 to res2
+ }
+
+ private fun part1(input: List): Long {
+ var resMap = mutableMapOf()
+ input.forEach {
+ resMap[it] = 1
+ }
+ var resList = input.toMutableList()
+ for (i in 0 until 25) {
+ resList = computePart1(resList)
+ }
+ for (i in 0 until 25) {
+ resMap = computeAlternate(resMap)
+ }
+ resMap.map{it.value}.sum().println()
+ return resList.size.toLong()
+ }
+
+ private fun computePart1(input: MutableList): MutableList {
+ var idx = 0
+ var length = input.size
+ while (idx < length) {
+ if (input[idx].isEvenDigits()) {
+ val pair = splitNum(input[idx])
+ input.add(idx++, pair.first)
+ input[idx] = pair.second
+ length++
+ } else {
+ if (input[idx] == 0L) input[idx] = 1
+ else input[idx] = input[idx] * 2024
+ }
+ idx++
+ }
+ return input
+ }
+
+ private fun computeAlternate(input: MutableMap): MutableMap {
+ val newMap = mutableMapOf()
+ input.forEach { it ->
+ if (it.key.isEvenDigits()) {
+ val pair = splitNum(it.key)
+ newMap[pair.first] = newMap.getOrDefault(pair.first, 0L) + it.value
+ newMap[pair.second] = newMap.getOrDefault(pair.second, 0L) + it.value
+ } else {
+ if (it.key == 0L) {
+ newMap[1] = newMap.getOrDefault(1, 0L) + it.value
+ } else {
+ newMap[it.key * 2024] = newMap.getOrDefault(it.key * 2024, 0L) + it.value
+ }
+ }
+ }
+ return newMap
+ }
+
+ private fun part2(input: List): Long {
+ var resMap = mutableMapOf()
+ input.forEach {
+ resMap[it] = 1
+ }
+ for (i in 0 until 75) {
+ resMap = computeAlternate(resMap)
+ }
+ return resMap.map { it.value }.sum()
+ }
+
+ private fun Long.isEvenDigits(): Boolean = length() % 2 == 0
+
+ private fun Long.length() = when (this) {
+ 0L -> 1
+ else -> log10(abs(toDouble())).toInt() + 1
+ }
+
+ private fun splitNum(input: Long): Pair = Pair(
+ input.toString().substring(0, input.length() / 2).toLong(),
+ input.toString().substring(input.length() / 2).toLong()
+ )
+}
\ No newline at end of file
diff --git a/src/Day12.kt b/src/Day12.kt
new file mode 100644
index 0000000..67778d4
--- /dev/null
+++ b/src/Day12.kt
@@ -0,0 +1,174 @@
+class Day12 : Application {
+ private var inputMap = mutableListOf>()
+ override fun run(fileName: String): Pair {
+ val input = readInput(fileName)
+ inputMap = input.map { it.toMutableList() }.toMutableList()
+ inputMap.println()
+
+ val res1 = this.part1()
+ inputMap = input.map { it.toMutableList() }.toMutableList()
+ val res2 = this.part2()
+ return res1 to res2
+ }
+
+ private fun part1(): Long {
+ var res = 0L
+ for (i in inputMap.indices) {
+ for (j in inputMap.indices) {
+ if (inputMap[i][j] != '.') {
+ val output = compute(inputMap[i][j], Pair(i, j))
+ res += output.first * output.second
+ cleanUpMap()
+ }
+ }
+ }
+ return res
+ }
+
+ private fun compute(target: Char, coord: Pair): Pair {
+ if (coord.first > inputMap.lastIndex || coord.first < 0 || coord.second > inputMap[0].lastIndex || coord.second < 0) return 0 to 1
+ when (inputMap[coord.first][coord.second]) {
+ '-' -> return 0 to 0
+ target -> {
+ inputMap[coord.first][coord.second] = '-'
+ return listOf(
+ compute(target, Pair(coord.first - 1, coord.second)),
+ compute(target, Pair(coord.first, coord.second + 1)),
+ compute(target, Pair(coord.first + 1, coord.second)),
+ compute(target, Pair(coord.first, coord.second - 1))
+ ).fold(Pair(1, 0)) { acc, pair -> Pair(acc.first + pair.first, acc.second + pair.second) }
+ }
+
+ else -> return 0 to 1
+ }
+ }
+
+ private fun cleanUpMap() {
+ inputMap = inputMap.map {
+ it.map { c ->
+ when (c) {
+ '-' -> '.'
+ else -> c
+ }
+ }.toMutableList()
+ }.toMutableList()
+ }
+
+
+ private fun part2(): Long {
+// idea from reddit -> count corners instead, corner count == side count
+ var res = 0L
+ for (i in inputMap.indices) {
+ for (j in inputMap[0].indices) {
+ if (inputMap[i][j] != '.') {
+ val target = inputMap[i][j]
+ val output = computeWithCorners(inputMap[i][j], Pair(i, j))
+ res += output.first * output.second
+ cleanUpMap()
+ }
+ }
+ }
+ return res
+ }
+
+
+ private fun computeWithCorners(target: Char, coord: Pair): Pair {
+ if (coord.first > inputMap.lastIndex || coord.first < 0 || coord.second > inputMap[0].lastIndex || coord.second < 0) return 0 to 0
+ when (inputMap[coord.first][coord.second]) {
+ '-' -> return 0 to 0
+ target -> {
+ inputMap[coord.first][coord.second] = '-'
+ return listOf(
+ computeWithCorners(target, Pair(coord.first - 1, coord.second)),
+ computeWithCorners(target, Pair(coord.first, coord.second + 1)),
+ computeWithCorners(target, Pair(coord.first + 1, coord.second)),
+ computeWithCorners(target, Pair(coord.first, coord.second - 1))
+ ).fold(Pair(1, computeCorners(target, coord))) { acc, pair ->
+ Pair(
+ acc.first + pair.first,
+ acc.second + pair.second
+ )
+ }
+ }
+
+ else -> return 0 to 0
+ }
+ }
+
+ private fun computeCorners(target: Char, coord: Pair): Int {
+ var corners = 0
+ var xDiff = false
+ var yDiff = false
+
+ if (coord.first == 0) xDiff = true
+ else if (inputMap[coord.first - 1][coord.second] != '-' && inputMap[coord.first - 1][coord.second] != target) xDiff =
+ true
+ if (coord.second == inputMap[0].lastIndex) yDiff = true
+ else if (inputMap[coord.first][coord.second + 1] != '-' && inputMap[coord.first][coord.second + 1] != target) yDiff =
+ true
+ if (xDiff == yDiff) {
+ if (xDiff) corners++
+ else {
+ try {
+ if (inputMap[coord.first - 1][coord.second + 1] != target && inputMap[coord.first - 1][coord.second + 1] != '-') corners++
+ } catch (e: IndexOutOfBoundsException) {
+ }
+ }
+ }
+
+ xDiff = false
+ yDiff = false
+ if (coord.second == inputMap[0].lastIndex) xDiff = true
+ else if (inputMap[coord.first][coord.second + 1] != '-' && inputMap[coord.first][coord.second + 1] != target) xDiff =
+ true
+ if (coord.first == inputMap.lastIndex) yDiff = true
+ else if (inputMap[coord.first + 1][coord.second] != '-' && inputMap[coord.first + 1][coord.second] != target) yDiff =
+ true
+ if (xDiff == yDiff) {
+ if (xDiff) corners++
+ else {
+ try {
+ if (inputMap[coord.first + 1][coord.second + 1] != target && inputMap[coord.first + 1][coord.second + 1] != '-') corners++
+ } catch (e: IndexOutOfBoundsException) {
+ }
+ }
+ }
+
+ xDiff = false
+ yDiff = false
+ if (coord.first == inputMap.lastIndex) xDiff = true
+ else if (inputMap[coord.first + 1][coord.second] != '-' && inputMap[coord.first + 1][coord.second] != target) xDiff =
+ true
+ if (coord.second == 0) yDiff = true
+ else if (inputMap[coord.first][coord.second - 1] != '-' && inputMap[coord.first][coord.second - 1] != target) yDiff =
+ true
+ if (xDiff == yDiff) {
+ if (xDiff) corners++
+ else {
+ try {
+ if (inputMap[coord.first + 1][coord.second - 1] != target && inputMap[coord.first + 1][coord.second - 1] != '-') corners++
+ } catch (e: IndexOutOfBoundsException) {
+ }
+ }
+ }
+
+ xDiff = false
+ yDiff = false
+ if (coord.second == 0) xDiff = true
+ else if (inputMap[coord.first][coord.second - 1] != '-' && inputMap[coord.first][coord.second - 1] != target) xDiff =
+ true
+ if (coord.first == 0) yDiff = true
+ else if (inputMap[coord.first - 1][coord.second] != '-' && inputMap[coord.first - 1][coord.second] != target) yDiff =
+ true
+ if (xDiff == yDiff) {
+ if (xDiff) corners++
+ else {
+ try {
+ if (inputMap[coord.first - 1][coord.second - 1] != target && inputMap[coord.first - 1][coord.second - 1] != '-') corners++
+ } catch (e: IndexOutOfBoundsException) {
+ }
+ }
+ }
+ return corners
+ }
+}
\ No newline at end of file
diff --git a/src/Day13.kt b/src/Day13.kt
new file mode 100644
index 0000000..a8f1621
--- /dev/null
+++ b/src/Day13.kt
@@ -0,0 +1,110 @@
+import kotlin.math.min
+
+data class ClawMachine(
+ val ax: Int,
+ val ay: Int,
+ val bx: Int,
+ val by: Int,
+ val px: Long,
+ val py: Long
+) {
+ override fun toString(): String {
+ return "ax: $ax, ay: $ay, bx: $bx, by: $by, px: $px, py: $py"
+ }
+}
+
+class Day13 : Application {
+ override fun run(fileName: String): Pair {
+ val input = readInput(fileName).filterNot { it == "" }
+ val clawMachineInput =
+ input.filter { it.startsWith("Button A") }.zip(input.filter { it.startsWith("Button B") })
+ .zip(input.filter { it.startsWith("Prize") }).map {
+ ClawMachine(
+ ax = it.first.first.split(",")[0].split("+")[1].toInt(),
+ ay = it.first.first.split(",")[1].split("+")[1].toInt(),
+ bx = it.first.second.split(",")[0].split("+")[1].toInt(),
+ by = it.first.second.split(",")[1].split("+")[1].toInt(),
+ px = it.second.split(",")[0].split("=")[1].toLong(),
+ py = it.second.split(",")[1].split("=")[1].toLong(),
+ )
+ }
+// clawMachineInput.forEach(::println)
+ val res1 = this.part1(clawMachineInput)
+ "-----------".println()
+ val res2 = this.part2(clawMachineInput)
+ return res1 to res2
+ }
+
+ private fun part1(input: List): Long {
+ var res = 0L
+ input.forEachIndexed { index, it ->
+ val singleRes = computeMinCost(it, index)
+ if (singleRes > 0) res += singleRes
+ }
+ return res
+ }
+
+ private fun computeMinCost(input: ClawMachine, index: Int): Long {
+ var cost = -1L
+ var res = Pair(0L, 0L)
+ for (i in 0L until input.px / input.ax + 1) {
+ if (input.px < (input.ax * i) || input.py < (input.ay * i)) break
+ if ((input.px - (input.ax * i)) % input.bx == 0L && (input.py - (input.ay * i)) % input.by == 0L
+ && (input.px - (input.ax * i)) / input.bx == (input.py - (input.ay * i)) / input.by
+ ) {
+
+ val newCost = computeCost(i, (input.px - (input.ax * i)) / input.bx)
+ if (cost != -1L) {
+ if (cost > newCost) {
+ res = Pair(i, (input.px - (input.ax * i)) / input.bx)
+ }
+ cost = min(cost, newCost)
+ } else {
+ cost = newCost
+ res = Pair(i, (input.px - (input.ax * i)) / input.bx)
+ }
+ }
+ }
+ "$index-$res".println()
+ return cost
+ }
+
+ private fun computeCost(a: Long, b: Long) = a * 3 + b
+
+ private fun computeWithFormula(input: ClawMachine, index: Int): Long {
+ if ((input.ax * input.by - input.ay * input.bx) == 0) return -1
+ val computedValues = Pair(
+ (input.px * input.by - input.bx * input.py) / (input.ax * input.by - input.ay * input.bx),
+ (input.ax * input.py - input.ay * input.px) / (input.ax * input.by - input.ay * input.bx)
+ )
+ if (computedValues.first < 0 || computedValues.second < 0) return -1
+// if (computedValues.first > 100 || computedValues.second > 100) return -1
+ if (computedValues.first * input.ax + computedValues.second * input.bx != input.px ||
+ computedValues.first * input.ay + computedValues.second * input.by != input.py) return -1
+ "$index-$computedValues".println()
+ return computeCost(
+ a = computedValues.first,
+ b = computedValues.second,
+ )
+ }
+
+ private fun part2(input: List): Long {
+// return input.fold(0L) {acc, i -> acc + computeWithFormula(i)}
+ var res = 0L
+ input.forEachIndexed { index, it ->
+ val singleRes = computeWithFormula(
+ ClawMachine(
+ ax = it.ax,
+ ay = it.ay,
+ bx = it.bx,
+ by = it.by,
+ px = it.px + 10000000000000,
+ py = it.py + 10000000000000
+ ), index)
+// val singleRes = computeWithFormula(it, index)
+ if (singleRes > 0) res += singleRes
+ }
+ return res
+ }
+
+}
\ No newline at end of file
diff --git a/src/Day14.kt b/src/Day14.kt
new file mode 100644
index 0000000..500db83
--- /dev/null
+++ b/src/Day14.kt
@@ -0,0 +1,128 @@
+import java.io.BufferedWriter
+import java.io.File
+
+class Day14 : Application {
+ var bufferedWriter: BufferedWriter? = null
+ var xlim = 0
+ var ylim = 0
+ var initialPositions = mutableListOf>()
+ var moves = mutableListOf>()
+ override fun run(fileName: String): Pair {
+ if (fileName == "day14test") {
+ xlim = 7
+ ylim = 11
+ } else {
+ xlim = 103
+ ylim = 101
+ }
+ bufferedWriter = File("src/resources/$fileName-output.txt").bufferedWriter()
+ val input = readInput(fileName)
+ val inputPos = input.map {
+ Pair(
+ it.split(" ")[0].split("=")[1].split(",")[1].toInt(),
+ it.split(" ")[0].split("=")[1].split(",")[0].toInt()
+ )
+ }
+ initialPositions = inputPos.toMutableList()
+ val inputMoves = input.map {
+ Pair(
+ it.split(" ")[1].split("=")[1].split(",")[1].toInt(),
+ it.split(" ")[1].split("=")[1].split(",")[0].toInt()
+ )
+ }
+ moves = inputMoves.toMutableList()
+ inputPos.println()
+ inputMoves.println()
+ val res1 = this.part1()
+ val res2 = this.part2()
+ bufferedWriter?.close()
+ return res1 to res2
+ }
+
+ private fun part1(): Long {
+ val res = mutableListOf(0, 0, 0, 0)
+ initialPositions.zip(moves).forEach {
+ val finalPos = move100Times(it.first, it.second)
+ when {
+ finalPos.first < xlim / 2 && finalPos.second < ylim / 2 -> res[0]++
+ finalPos.first > xlim / 2 && finalPos.second < ylim / 2 -> res[1]++
+ finalPos.first < xlim / 2 && finalPos.second > ylim / 2 -> res[2]++
+ finalPos.first > xlim / 2 && finalPos.second > ylim / 2 -> res[3]++
+ }
+ }
+ res.println()
+ return res.fold(1) { acc, i -> acc * (if (i == 0) 1 else i) }
+ }
+
+ private fun move100Times(pos: Pair, move: Pair): Pair {
+ var newPos = pos
+ for (i in 0 until 100) {
+ newPos = moveRobot(newPos, move)
+ }
+ return newPos
+ }
+
+ private fun moveRobot(pos: Pair, move: Pair): Pair {
+ var x = pos.first + move.first
+ if (x >= xlim) x -= xlim
+ else if (x < 0) x += xlim
+ var y = pos.second + move.second
+ if (y >= ylim) y -= ylim
+ else if (y < 0) y += ylim
+ return Pair(x, y)
+ }
+
+// unable to find a good way to find Christmas tree
+// so run 10000 iterations, and output to a file to look manually
+// can find it by searching "ooooooooooooooooooooo" in the file
+ private fun part2(): Long {
+ var res = 0L
+ var positions = initialPositions
+ for (i in 0 until 10000) {
+ var notConnected = false
+ positions = positions.zip(moves).map {
+ moveRobot(it.first, it.second)
+ }.toMutableList()
+ bufferedWriter?.write("------------------------ Day: ${i + 1} ------------------------")
+ bufferedWriter?.newLine()
+
+ positions.draw()
+ positions.forEach {
+ if (
+ !positions.contains(Pair(it.first + 1, it.second + 1)) &&
+ !positions.contains(Pair(it.first - 1, it.second + 1)) &&
+ !positions.contains(Pair(it.first + 1, it.second - 1)) &&
+ !positions.contains(Pair(it.first - 1, it.second - 1))
+ ) notConnected = true
+ }
+ if (!notConnected) {
+ res = i.toLong()
+ break
+ }
+ }
+ return res
+ }
+
+ private fun MutableList>.draw() {
+ val map = MutableList(xlim) { MutableList(ylim) { '.' } }
+ forEach { map[it.first][it.second] = 'o' }
+ val strs = map.map {
+ val strBuilder = StringBuilder()
+ it.forEach { c ->
+ when {
+ c == '.' -> strBuilder.append(' ')
+ else -> strBuilder.append('o')
+ }
+ }
+ strBuilder.toString()
+ }
+ strs.forEach {
+ bufferedWriter?.write(it)
+ bufferedWriter?.newLine()
+// .use { bw ->
+// bw?.write(it)
+// bw?.newLine()
+// }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Day15.kt b/src/Day15.kt
new file mode 100644
index 0000000..bfd9d88
--- /dev/null
+++ b/src/Day15.kt
@@ -0,0 +1,221 @@
+import java.io.BufferedWriter
+import java.io.File
+
+class Day15 : Application {
+ var input: MutableList> = mutableListOf()
+ val directions = listOf(Pair(-1, 0), Pair(0, 1), Pair(1, 0), Pair(0, -1))
+ var bufferedWriter: BufferedWriter? = null
+
+ override fun run(fileName: String): Pair {
+ bufferedWriter = File("src/resources/$fileName-output.txt").bufferedWriter()
+ val input = readInput(fileName)
+ val emptyListIdx = input.indexOf("")
+ val inputMap = input.subList(0, emptyListIdx)
+ val steps = input.subList(emptyListIdx + 1, input.size).fold(StringBuilder()) { acc, s -> acc.append(s) }
+ .toString().toList().map {
+ when (it) {
+ '^' -> 0
+ '>' -> 1
+ 'v' -> 2
+ else -> 3
+ }
+ }
+ val initialCoord = getInitialCoord(inputMap)
+ val res1 = this.part1(inputMap, steps, initialCoord)
+ val part2Input = inputMap.map {
+ val strBuilder = StringBuilder()
+ it.forEach { c ->
+ when(c) {
+ '.' -> strBuilder.append("..")
+ '#' -> strBuilder.append("##")
+ 'O' -> strBuilder.append("[]")
+ '@' -> strBuilder.append("@.")
+ }
+ }
+ strBuilder.toString()
+ }
+ val newInitialCoord = getInitialCoord(part2Input.map{it})
+ part2Input.forEach {
+ bufferedWriter!!.write(it)
+ bufferedWriter!!.newLine()
+ }
+ bufferedWriter!!.write("---------------------------")
+ bufferedWriter!!.newLine()
+ val res2 = this.part2(part2Input, steps, newInitialCoord)
+
+ return res1 to res2
+ }
+
+ private fun part1(inputMap: List, steps: List, initialCoord: Pair): Long {
+ var res = 0L
+ var coord = initialCoord
+ input = inputMap.map { it.toMutableList() }.toMutableList()
+ steps.forEach { n ->
+ coord = computeStep(directions[n], coord)
+ }
+ input.forEachIndexed { i, list ->
+ list.forEachIndexed { idx, c ->
+ if (c == 'O') {
+ res += 100 * i + idx
+ }
+ }
+ }
+ return res
+ }
+
+ private fun part2(inputMap: List, steps: List, initialCoord: Pair): Long {
+ var res = 0L
+ var coord = initialCoord
+ input = inputMap.map { it.toMutableList() }.toMutableList()
+ steps.forEach {
+ coord = computeSquareStep(directions[it], coord)
+ input.forEach {
+ val strBuilder = StringBuilder()
+ it.forEach { c -> strBuilder.append(c) }
+ bufferedWriter!!.write(strBuilder.toString())
+ bufferedWriter!!.newLine()
+ }
+ bufferedWriter!!.write("------------------------")
+ bufferedWriter!!.newLine()
+ }
+ input.forEachIndexed { i, list ->
+ list.forEachIndexed { idx, c ->
+ if (c == '[') {
+ res += 100 * i + idx
+ }
+ }
+ }
+ input.println()
+ return res
+ }
+
+ private fun getInitialCoord(inputMap: List): Pair {
+ inputMap.forEachIndexed { i, s ->
+ s.forEachIndexed { j, c ->
+ if (c == '@') return Pair(i, j)
+ }
+ }
+ return Pair(0, 0)
+ }
+
+ private fun computeStep(dir: Pair, coord: Pair): Pair {
+ val isNextCoordEmpty = try {
+ input[coord.first + dir.first][coord.second + dir.second] == '.'
+ } catch (e: IndexOutOfBoundsException) {
+ return coord
+ }
+ if (isNextCoordEmpty) {
+ input[coord.first][coord.second] = '.'
+ input[coord.first + dir.first][coord.second + dir.second] = '@'
+ return Pair(coord.first + dir.first, coord.second + dir.second)
+ } else {
+ if (input[coord.first + dir.first][coord.second + dir.second] == '#') return coord
+ val distToEmptyCoord = distToEmptyCoord(dir, coord)
+ if (distToEmptyCoord == -1) return coord
+ else {
+ input[coord.first + dir.first * distToEmptyCoord][coord.second + dir.second * distToEmptyCoord] =
+ 'O'
+ input[coord.plus(dir).first][coord.plus(dir).second] = '@'
+ input[coord.first][coord.second] = '.'
+ return coord.plus(dir)
+ }
+ }
+ }
+
+ private fun distToEmptyCoord(dir: Pair, coord: Pair, isPart2: Boolean? = null): Int {
+ val part2 = isPart2 ?: false
+ var res = 0
+ var continueSearch = true
+ var coords = coord
+ while (continueSearch) {
+ coords = coords.plus(dir)
+ try {
+ if (input[coords.first][coords.second] == '.') return ++res
+ if (input[coords.first][coords.second] == '#') return -1
+ if (!part2 && input[coords.first][coords.second] == 'O') res++
+ if (part2 && (input[coords.first][coords.second] == '[' || input[coords.first][coords.second] == ']')) res++
+ } catch (e: IndexOutOfBoundsException) {
+ return -1
+ }
+ }
+ return -1
+ }
+
+ private fun computeSquareStep(dir: Pair, coord: Pair): Pair {
+ val isNextCoordEmpty = try {
+ input[coord.first + dir.first][coord.second + dir.second] == '.'
+ } catch (e: IndexOutOfBoundsException) {
+ return coord
+ }
+ if (isNextCoordEmpty) {
+ input[coord.first][coord.second] = '.'
+ input[coord.first + dir.first][coord.second + dir.second] = '@'
+ return Pair(coord.first + dir.first, coord.second + dir.second)
+ } else {
+ if (input[coord.first + dir.first][coord.second + dir.second] == '#') return coord
+ if (dir.first == 0) {
+ // horizontal
+ val distToEmptyCoord = distToEmptyCoord(dir, coord, true)
+ if (distToEmptyCoord == -1) return coord
+ input[coord.first][coord.second] = '.'
+ input[coord.plus(dir).first][coord.plus(dir).second] = '@'
+ for (i in 2 until distToEmptyCoord + 1) {
+ if (i % 2 == 0) {
+ input[coord.first][coord.second + dir.second * i] = if (dir.second == 1) '[' else ']'
+ } else {
+ input[coord.first][coord.second + dir.second * i] = if (dir.second == 1) ']' else '['
+ }
+ }
+ } else {
+ // vertical
+ val (distToEmptyCoord, coords) = distToEmptyCoordVertical(dir, coord)
+ if (distToEmptyCoord == -1) return coord
+ while (coords.isNotEmpty()) {
+ val coordList = coords.removeLast()
+ coordList.forEach {
+ input[it.second.first][it.second.second] = '.'
+ input[it.second.first + dir.first][it.second.second] = it.first
+ }
+ }
+ return coord.plus(dir)
+ }
+ }
+ return coord.plus(dir)
+ }
+
+ private fun distToEmptyCoordVertical(
+ dir: Pair,
+ coord: Pair
+ ): Pair>>>> {
+ var res = 0
+ val coordsData = ArrayDeque>>>()
+ coordsData.addLast(listOf(Pair('@', coord)))
+ var coords: MutableList>
+ while (true) {
+ var possibleToStopSearching = true
+ val newList = mutableListOf>>()
+ coords = coordsData.last().map { Pair(it.second.first + dir.first, it.second.second) }.toMutableList()
+ try {
+ coords.forEach {
+ if (input[it.first][it.second] == '#') return Pair(-1, coordsData)
+ if (input[it.first][it.second] == '[') {
+ possibleToStopSearching = false
+ newList.add(Pair('[', Pair(it.first, it.second)))
+ newList.add(Pair(']', Pair(it.first, it.second + 1)))
+ }
+ if (input[it.first][it.second] == ']') {
+ possibleToStopSearching = false
+ newList.add(Pair(']', Pair(it.first, it.second)))
+ newList.add(Pair('[', Pair(it.first, it.second - 1)))
+ }
+ }
+ coordsData.addLast(newList.distinct())
+ if (possibleToStopSearching) return Pair(res, coordsData)
+ res++
+ } catch (e: IndexOutOfBoundsException) {
+ return Pair(-1, coordsData)
+ }
+ }
+ return Pair(-1, coordsData)
+ }
+}
\ No newline at end of file
diff --git a/src/Day16.kt b/src/Day16.kt
new file mode 100644
index 0000000..200f362
--- /dev/null
+++ b/src/Day16.kt
@@ -0,0 +1,85 @@
+class Day16 : Application {
+ val directions = listOf(Pair(-1, 0), Pair(0, 1), Pair(1, 0), Pair(0, -1))
+ var inputMap = mutableListOf>()
+ var scoreMap = mutableListOf>>()
+ var part2List = mutableListOf>()
+ override fun run(fileName: String): Pair {
+ val input = readInput(fileName)
+ inputMap = input.map { it.toMutableList() }.toMutableList()
+ scoreMap = inputMap.map {
+ it.map { c ->
+ when (c) {
+ '#' -> mutableListOf(-1L, -1L, -1L, -1L)
+ else -> mutableListOf(0L, 0L, 0L, 0L)
+ }
+ }.toMutableList()
+ }.toMutableList()
+ val res1 = this.part1()
+ val res2 = this.part2(res1, scoreMap[1][input.lastIndex - 1].indexOf(res1))
+ return res1 to res2
+ }
+
+ private fun part1(): Long {
+ val initialPos = Pair(inputMap.lastIndex - 1, 1)
+ val initialDir = 1
+ val finalPos = Pair(1, inputMap.lastIndex - 1)
+ computePart1(initialPos, initialDir, 0)
+ return scoreMap[finalPos.first][finalPos.second].filterNot { it <= 0L }.min()
+ }
+
+ private fun part2(score: Long, dir: Int): Long {
+ val finalPos = Pair(1, inputMap.lastIndex - 1)
+ computePart2(finalPos, dir, score)
+
+ return part2List.distinct().size.toLong()
+ }
+
+ private fun computePart1(pos: Pair, dir: Int, currScore: Long) {
+ try {
+ if (scoreMap[pos.first][pos.second][dir] in 1.., dir: Int, currScore: Long): Int {
+ if (currScore < 0) return -1
+ if (currScore == 0L) {
+ return if (pos.first == inputMap.lastIndex - 1 && pos.second == 1) 1
+ else -1
+ }
+ var res = 1
+ if (scoreMap[pos.first][pos.second][dir] == currScore ||
+ scoreMap[pos.first][pos.second][(dir + 3) % 4] == currScore - 1000 ||
+ scoreMap[pos.first][pos.second][(dir + 1) % 4] == currScore - 1000
+ ) {
+ if (scoreMap[pos.first][pos.second][dir] == currScore) {
+ val computeRes = computePart2(pos.plus(directions[(dir + 2) % 4]), (dir) % 4, currScore - 1)
+ res += computeRes
+ }
+ if (scoreMap[pos.first][pos.second][(dir + 3) % 4] == currScore - 1000) {
+ val computeRes = computePart2(pos.plus(directions[(dir + 1) % 4]), (dir + 3) % 4, currScore - 1001)
+ res += computeRes
+ }
+ if (scoreMap[pos.first][pos.second][(dir + 1) % 4] == currScore - 1000) {
+ val computeRes = computePart2(pos.plus(directions[(dir + 3) % 4]), (dir + 1) % 4, currScore - 1001)
+ res += computeRes
+ }
+ part2List.add(pos)
+ return res
+ } else return -1
+ }
+}
\ No newline at end of file
diff --git a/src/Day17.kt b/src/Day17.kt
new file mode 100644
index 0000000..06c8a08
--- /dev/null
+++ b/src/Day17.kt
@@ -0,0 +1,18 @@
+class Day17 : Application {
+ override fun run(fileName: String): Pair {
+ val input = readInput(fileName)
+
+ val res1 = this.part1()
+ val res2 = this.part2()
+ return res1 to res2
+ }
+
+ private fun part1(): Long {
+ var res = 0L
+ return res
+ }
+
+ private fun part2(): Long {
+ return 0
+ }
+}
\ No newline at end of file
diff --git a/src/Day18.kt b/src/Day18.kt
new file mode 100644
index 0000000..55e199b
--- /dev/null
+++ b/src/Day18.kt
@@ -0,0 +1,189 @@
+class Day18 : Application {
+ var inputMap = mutableListOf>()
+ var dimension = 0
+ val directions = listOf(Pair(-1, 0), Pair(0, 1), Pair(1, 0), Pair(0, -1))
+ var limit = 0
+ override fun run(fileName: String): Pair {
+ if (fileName.contains("test")) {
+ dimension = 7
+ limit = 12
+ } else {
+ dimension = 71
+ limit = 1024
+ }
+ val fullInput = readInput(fileName).map { Pair(it.split(',')[1].toInt(), it.split(',')[0].toInt()) }
+// fullInput.forEach(::println)
+ val input =
+ fullInput.subList(0, limit)
+ for (i in 0..>): Long {
+// idea from https://www.reddit.com/r/adventofcode/comments/1hhiawu/2024_day_18_part_2_visualization_of_my_algorithm/
+ inputMap = mutableListOf()
+ for (i in 0.., score: Int) {
+ if (pos.first < 0 || pos.first >= dimension || pos.second < 0 || pos.second >= dimension) return
+ if (inputMap[pos.first][pos.second] == -1) return
+ if (inputMap[pos.first][pos.second] in 1..score) return
+ inputMap[pos.first][pos.second] = score
+ if (pos.first == dimension - 1 && pos.second == dimension - 1) return
+ computePart1(pos.plus(directions[0]), score + 1)
+ computePart1(pos.plus(directions[1]), score + 1)
+ computePart1(pos.plus(directions[2]), score + 1)
+ computePart1(pos.plus(directions[3]), score + 1)
+ }
+
+ private fun computeConnection(coord: Pair): Int {
+ var topRight = false
+ var botLeft = false
+ if (coord.first == 0 || coord.second == dimension - 1) topRight = true
+ if (coord.second == 0 || coord.first == dimension - 1) botLeft = true
+ try {
+ val next = inputMap[coord.first - 1][coord.second - 1]
+ if (next == 2) topRight = true
+ if (next == 3) botLeft = true
+ } catch(e : IndexOutOfBoundsException){}
+ try {
+ val next = inputMap[coord.first - 1][coord.second]
+ if (next == 2) topRight = true
+ if (next == 3) botLeft = true
+ } catch(e : IndexOutOfBoundsException){}
+ try {
+ val next = inputMap[coord.first - 1][coord.second + 1]
+ if (next == 2) topRight = true
+ if (next == 3) botLeft = true
+ } catch(e : IndexOutOfBoundsException){}
+ try {
+ val next = inputMap[coord.first][coord.second - 1]
+ if (next == 2) topRight = true
+ if (next == 3) botLeft = true
+ } catch(e : IndexOutOfBoundsException){}
+ try {
+ val next = inputMap[coord.first][coord.second + 1]
+ if (next == 2) topRight = true
+ if (next == 3) botLeft = true
+ } catch(e : IndexOutOfBoundsException){}
+ try {
+ val next = inputMap[coord.first + 1][coord.second - 1]
+ if (next == 2) topRight = true
+ if (next == 3) botLeft = true
+ } catch(e : IndexOutOfBoundsException){}
+ try {
+ val next = inputMap[coord.first + 1][coord.second]
+ if (next == 2) topRight = true
+ if (next == 3) botLeft = true
+ } catch(e : IndexOutOfBoundsException){}
+ try {
+ val next = inputMap[coord.first + 1][coord.second + 1]
+ if (next == 2) topRight = true
+ if (next == 3) botLeft = true
+ } catch(e : IndexOutOfBoundsException){}
+ return when {
+ topRight && botLeft -> 4
+ topRight -> 2
+ botLeft -> 3
+ else -> 1
+ }
+ }
+ private fun updateNeighbors(coord: Pair, newVal: Int): Pair> {
+ try {
+ if (inputMap[coord.first - 1][coord.second - 1] == 1) {
+ inputMap[coord.first - 1][coord.second - 1] = computeConnection(coord.plus(Pair(-1, -1)))
+ if (inputMap[coord.first - 1][coord.second - 1] == 4) return Pair(true, coord.plus(Pair(-1, -1)))
+ val newRes = updateNeighbors(coord.plus(Pair(-1, -1)), newVal)
+ if (newRes.first) return newRes
+ }
+ } catch(e : IndexOutOfBoundsException){}
+ try {
+ if (inputMap[coord.first - 1][coord.second] == 1) {
+ inputMap[coord.first - 1][coord.second] = computeConnection(coord.plus(Pair(-1, 0)))
+ if (inputMap[coord.first - 1][coord.second] == 4) return Pair(true, (coord.plus(Pair(-1, 0))))
+ val newRes = updateNeighbors(coord.plus(Pair(-1, 0)), newVal)
+ if (newRes.first) return newRes
+ }
+ } catch(e : IndexOutOfBoundsException){}
+ try {
+ if (inputMap[coord.first - 1][coord.second + 1] == 1) {
+ inputMap[coord.first - 1][coord.second + 1] = computeConnection(coord.plus(Pair(-1, 1)))
+ if (inputMap[coord.first - 1][coord.second + 1] == 4) return Pair(true, (coord.plus(Pair(-1, 1))))
+ val newRes = updateNeighbors(coord.plus(Pair(-1, 1)), newVal)
+ if (newRes.first) return newRes
+ }
+ } catch(e : IndexOutOfBoundsException){}
+ try {
+ if (inputMap[coord.first][coord.second - 1] == 1) {
+ inputMap[coord.first][coord.second - 1] = computeConnection(coord.plus(Pair(0, -1)))
+ if (inputMap[coord.first][coord.second - 1] == 4) return Pair(true, (coord.plus(Pair(0, -1))))
+ val newRes = updateNeighbors(coord.plus(Pair(0, -1)), newVal)
+ if (newRes.first) return newRes
+ }
+ } catch(e : IndexOutOfBoundsException){}
+ try {
+ if (inputMap[coord.first][coord.second + 1] == 1) {
+ inputMap[coord.first][coord.second + 1] = computeConnection(coord.plus(Pair(0, 1)))
+ if (inputMap[coord.first][coord.second + 1] == 4) return Pair(true, (coord.plus(Pair(0, 1))))
+ val newRes = updateNeighbors(coord.plus(Pair(0, 1)), newVal)
+ if (newRes.first) return newRes
+ }
+ } catch(e : IndexOutOfBoundsException){}
+ try {
+ if (inputMap[coord.first + 1][coord.second - 1] == 1) {
+ inputMap[coord.first + 1][coord.second - 1] = computeConnection(coord.plus(Pair(1, -1)))
+ if (inputMap[coord.first + 1][coord.second - 1] == 4) return Pair(true, (coord.plus(Pair(1, -1))))
+ val newRes = updateNeighbors(coord.plus(Pair(1, -1)), newVal)
+ if (newRes.first) return newRes
+ }
+ } catch(e : IndexOutOfBoundsException){}
+ try {
+ if (inputMap[coord.first + 1][coord.second] == 1) {
+ inputMap[coord.first + 1][coord.second] = computeConnection(coord.plus(Pair(1, 0)))
+ if (inputMap[coord.first + 1][coord.second] == 4) return Pair(true, (coord.plus(Pair(1, 0))))
+ val newRes = updateNeighbors(coord.plus(Pair(1, 0)), newVal)
+ if (newRes.first) return newRes
+ }
+ } catch(e : IndexOutOfBoundsException){}
+ try {
+ if (inputMap[coord.first + 1][coord.second + 1] == 1) {
+ inputMap[coord.first + 1][coord.second + 1] = computeConnection(coord.plus(Pair(1, 1)))
+ if (inputMap[coord.first + 1][coord.second + 1] == 4) return Pair(true, (coord.plus(Pair(1, 1))))
+ val newRes = updateNeighbors(coord.plus(Pair(1, 1)), newVal)
+ if (newRes.first) return newRes
+ }
+ } catch(e : IndexOutOfBoundsException){}
+ return Pair(false, Pair(0, 0))
+ }
+}
\ No newline at end of file
diff --git a/src/Day19.kt b/src/Day19.kt
new file mode 100644
index 0000000..9ed7083
--- /dev/null
+++ b/src/Day19.kt
@@ -0,0 +1,18 @@
+class Day19 : Application {
+ override fun run(fileName: String): Pair {
+ val input = readInput(fileName)
+
+ val res1 = this.part1()
+ val res2 = this.part2()
+ return res1 to res2
+ }
+
+ private fun part1(): Long {
+ var res = 0L
+ return res
+ }
+
+ private fun part2(): Long {
+ return 0
+ }
+}
\ No newline at end of file
diff --git a/src/Day20.kt b/src/Day20.kt
new file mode 100644
index 0000000..5234e53
--- /dev/null
+++ b/src/Day20.kt
@@ -0,0 +1,18 @@
+class Day20 : Application {
+ override fun run(fileName: String): Pair {
+ val input = readInput(fileName)
+
+ val res1 = this.part1()
+ val res2 = this.part2()
+ return res1 to res2
+ }
+
+ private fun part1(): Long {
+ var res = 0L
+ return res
+ }
+
+ private fun part2(): Long {
+ return 0
+ }
+}
\ No newline at end of file
diff --git a/src/Day21.kt b/src/Day21.kt
new file mode 100644
index 0000000..d751cf9
--- /dev/null
+++ b/src/Day21.kt
@@ -0,0 +1,18 @@
+class Day21 : Application {
+ override fun run(fileName: String): Pair {
+ val input = readInput(fileName)
+
+ val res1 = this.part1()
+ val res2 = this.part2()
+ return res1 to res2
+ }
+
+ private fun part1(): Long {
+ var res = 0L
+ return res
+ }
+
+ private fun part2(): Long {
+ return 0
+ }
+}
\ No newline at end of file
diff --git a/src/Day22.kt b/src/Day22.kt
new file mode 100644
index 0000000..a0a2771
--- /dev/null
+++ b/src/Day22.kt
@@ -0,0 +1,18 @@
+class Day22 : Application {
+ override fun run(fileName: String): Pair {
+ val input = readInput(fileName)
+
+ val res1 = this.part1()
+ val res2 = this.part2()
+ return res1 to res2
+ }
+
+ private fun part1(): Long {
+ var res = 0L
+ return res
+ }
+
+ private fun part2(): Long {
+ return 0
+ }
+}
\ No newline at end of file
diff --git a/src/Day23.kt b/src/Day23.kt
new file mode 100644
index 0000000..0be2aaa
--- /dev/null
+++ b/src/Day23.kt
@@ -0,0 +1,18 @@
+class Day23 : Application {
+ override fun run(fileName: String): Pair {
+ val input = readInput(fileName)
+
+ val res1 = this.part1()
+ val res2 = this.part2()
+ return res1 to res2
+ }
+
+ private fun part1(): Long {
+ var res = 0L
+ return res
+ }
+
+ private fun part2(): Long {
+ return 0
+ }
+}
\ No newline at end of file
diff --git a/src/Day24.kt b/src/Day24.kt
new file mode 100644
index 0000000..a34fb68
--- /dev/null
+++ b/src/Day24.kt
@@ -0,0 +1,18 @@
+class Day24 : Application {
+ override fun run(fileName: String): Pair {
+ val input = readInput(fileName)
+
+ val res1 = this.part1()
+ val res2 = this.part2()
+ return res1 to res2
+ }
+
+ private fun part1(): Long {
+ var res = 0L
+ return res
+ }
+
+ private fun part2(): Long {
+ return 0
+ }
+}
\ No newline at end of file
diff --git a/src/Day25.kt b/src/Day25.kt
new file mode 100644
index 0000000..814b0ce
--- /dev/null
+++ b/src/Day25.kt
@@ -0,0 +1,18 @@
+class Day25 : Application {
+ override fun run(fileName: String): Pair {
+ val input = readInput(fileName)
+
+ val res1 = this.part1()
+ val res2 = this.part2()
+ return res1 to res2
+ }
+
+ private fun part1(): Long {
+ var res = 0L
+ return res
+ }
+
+ private fun part2(): Long {
+ return 0
+ }
+}
\ No newline at end of file
diff --git a/src/Utils.kt b/src/Utils.kt
index 7ff1419..3aba5b9 100644
--- a/src/Utils.kt
+++ b/src/Utils.kt
@@ -3,10 +3,7 @@ import java.security.MessageDigest
import kotlin.io.path.Path
import kotlin.io.path.readText
-/**
- * Reads lines from the given input txt file.
- */
-fun readInput(name: String) = Path("src/$name.txt").readText().trim().lines()
+fun readInput(name: String) = Path("src/resources/$name.txt").readText().trim().lines()
/**
* Converts string to md5 hash.
@@ -19,3 +16,5 @@ fun String.md5() = BigInteger(1, MessageDigest.getInstance("MD5").digest(toByteA
* The cleaner shorthand for printing output.
*/
fun Any?.println() = println(this)
+
+fun Pair.plus(b: Pair) = Pair(this.first + b.first, this.second + b.second)
\ No newline at end of file
diff --git a/src/resources/.DS_Store b/src/resources/.DS_Store
new file mode 100644
index 0000000..2bcd805
Binary files /dev/null and b/src/resources/.DS_Store differ
diff --git a/src/resources/day01.txt b/src/resources/day01.txt
new file mode 100644
index 0000000..81065b8
--- /dev/null
+++ b/src/resources/day01.txt
@@ -0,0 +1,2 @@
+27484, 67560, 43926, 86974, 71747, 28088, 34772, 29824, 29947, 98288, 65056, 51274, 77249, 47027, 38391, 70732, 48005, 78366, 61139, 73910, 20206, 22102, 88580, 54397, 49998, 61967, 12345, 41314, 21798, 98407, 86141, 73311, 81862, 95566, 87351, 15848, 51788, 35997, 47658, 81744, 47851, 43111, 11414, 40636, 27695, 81110, 44831, 58200, 88294, 16039, 59282, 69211, 52748, 52668, 43520, 28943, 24548, 67129, 53243, 65561, 82182, 49274, 15952, 60418, 27775, 73493, 52098, 27121, 81056, 28121, 30348, 56433, 25161, 83995, 57450, 52600, 77850, 37216, 98526, 90655, 45217, 69053, 13539, 89360, 84311, 87153, 24300, 23519, 28852, 53355, 42582, 26552, 75913, 53485, 34601, 76249, 94920, 72323, 69403, 95672, 26935, 87512, 61615, 74695, 20200, 19304, 68077, 10582, 27335, 37584, 73196, 16502, 91474, 54822, 71321, 41518, 87096, 21202, 93142, 38047, 24517, 44312, 33144, 77684, 80588, 67107, 54896, 51770, 45857, 46481, 47496, 28125, 14980, 51789, 12986, 25765, 74251, 78770, 55011, 29165, 17728, 33981, 36823, 39673, 91903, 19472, 26800, 37852, 14040, 55052, 65668, 89327, 76888, 70948, 12472, 14831, 22665, 22214, 89577, 81023, 84429, 75394, 42076, 68351, 62000, 17132, 41051, 76577, 72700, 21580, 20635, 62682, 96847, 79918, 80975, 72024, 29236, 82592, 40379, 22464, 53246, 92362, 67933, 83285, 32355, 72419, 54766, 44778, 97706, 14239, 61196, 49491, 14607, 54850, 71449, 27968, 33242, 44321, 97596, 82906, 14319, 46189, 49649, 24148, 34109, 81217, 25414, 75794, 15200, 95299, 39732, 87884, 15317, 21193, 15090, 21390, 21698, 56575, 84593, 83880, 36664, 42212, 27053, 84601, 77818, 44608, 56932, 93674, 79048, 88828, 11883, 36014, 12590, 76559, 39043, 82003, 20407, 10048, 31281, 28063, 45813, 18006, 95040, 62587, 28094, 29580, 72853, 39380, 50190, 86034, 26295, 22364, 73757, 45106, 91186, 30056, 91866, 89436, 73210, 62546, 40469, 55116, 11849, 77677, 61244, 26136, 81481, 72429, 76056, 35895, 68089, 18171, 63514, 97499, 75403, 36977, 96237, 29452, 98034, 42417, 57358, 60023, 72118, 85974, 80417, 13977, 71082, 44648, 72171, 70404, 54381, 72013, 51192, 14717, 23855, 48675, 83605, 31420, 83753, 10437, 58483, 69788, 81921, 56676, 42129, 21405, 54273, 63042, 11660, 64263, 11027, 47012, 94401, 27499, 70973, 47772, 35646, 16154, 91790, 50094, 80579, 49745, 18137, 79817, 18437, 46949, 60816, 35903, 17915, 57636, 97265, 54184, 72211, 50122, 98895, 83261, 61814, 41074, 25545, 69677, 32198, 90218, 32063, 26348, 23459, 19924, 12755, 75332, 20426, 33510, 32520, 50821, 45619, 30651, 23288, 26097, 35967, 13374, 35414, 67278, 34100, 26440, 55848, 60238, 11578, 53675, 95139, 53655, 75061, 25717, 96718, 60846, 31991, 41677, 81456, 62569, 14572, 47381, 84958, 85437, 12693, 56021, 55744, 68582, 15330, 94099, 89771, 52313, 56489, 50298, 74104, 29286, 24482, 82812, 13182, 15225, 78417, 83094, 26751, 92253, 34340, 73732, 91045, 52416, 13671, 33612, 56971, 40346, 72844, 94947, 86520, 75495, 87108, 61901, 85022, 51692, 97087, 17780, 78024, 82627, 86867, 14770, 99690, 37970, 38091, 93808, 19623, 62514, 39354, 18731, 20182, 96893, 93703, 32281, 44738, 34416, 99168, 60552, 62143, 34660, 11505, 24137, 69957, 32792, 55146, 24998, 45008, 55840, 56271, 51951, 23366, 94193, 67623, 35037, 13330, 31163, 87613, 40427, 90416, 81180, 82377, 64803, 62137, 28226, 12419, 14256, 74284, 63856, 12114, 23305, 99115, 38426, 87398, 92158, 39006, 17021, 11701, 31448, 78513, 85920, 93843, 30287, 78384, 41990, 11317, 30841, 10135, 85875, 65006, 19493, 29916, 12137, 13493, 36868, 19718, 73983, 79278, 70849, 43543, 69664, 36211, 69076, 50555, 16277, 86854, 18173, 15367, 87778, 85537, 29202, 65597, 94036, 40995, 57002, 31037, 62138, 23493, 32543, 13649, 45082, 39931, 54328, 90435, 98509, 40846, 12273, 70078, 69792, 71552, 43202, 23140, 26364, 34210, 47040, 29563, 35773, 52323, 37176, 97815, 43884, 94682, 82836, 89878, 39807, 42368, 13016, 89249, 65121, 20487, 24970, 30802, 65040, 28328, 52220, 26818, 65282, 78164, 46968, 78981, 18980, 30648, 51633, 31442, 63174, 44998, 60294, 33509, 28215, 76076, 64908, 17601, 33308, 79813, 89994, 35315, 67669, 73099, 25168, 71490, 58441, 28299, 64607, 34983, 96817, 13045, 71656, 26886, 60587, 75130, 86187, 85198, 33243, 43027, 38691, 49403, 45353, 18425, 18026, 39076, 28212, 18907, 71135, 13958, 53937, 12712, 63297, 50764, 95321, 97757, 72342, 62894, 71239, 77659, 63198, 84364, 61075, 51222, 24995, 16599, 86925, 99048, 13542, 12591, 25905, 32208, 22133, 41575, 59604, 16836, 31682, 69364, 82188, 41914, 45576, 25079, 81537, 46462, 66551, 26591, 77328, 33985, 33418, 91080, 61568, 57867, 84472, 12654, 70565, 42550, 51259, 13169, 65905, 15805, 90109, 76980, 57913, 72381, 70281, 78134, 37955, 93173, 74086, 58167, 40765, 23790, 33592, 78454, 15430, 67945, 64241, 83702, 46375, 26342, 34863, 19482, 34284, 38000, 98157, 15930, 64693, 12550, 51953, 77269, 13652, 86840, 52314, 98333, 40687, 35046, 59975, 72833, 14044, 71828, 40577, 51481, 80118, 55714, 24410, 99412, 35437, 48548, 84964, 75235, 21303, 83551, 52760, 85000, 56259, 42764, 11312, 24461, 27237, 58802, 55301, 74259, 56046, 19866, 73679, 33891, 45639, 54195, 95097, 57914, 59298, 89370, 76504, 56108, 29130, 33712, 25154, 96503, 98909, 40872, 82776, 63510, 26533, 56079, 39398, 47768, 20341, 99994, 10110, 57700, 30209, 94995, 44918, 66796, 51995, 77354, 93013, 54620, 92444, 93849, 49161, 28949, 37715, 23904, 73156, 42384, 17773, 58155, 54490, 56486, 97223, 32955, 25281, 15737, 35697, 18244, 42515, 40947, 93475, 14131, 67547, 95089, 43557, 11037, 34322, 22250, 71266, 89572, 90169, 17372, 65790, 27576, 37101, 73468, 39721, 65682, 47073, 90895, 43637, 78516, 21073, 92011, 46069, 26851, 47448, 65439, 29023, 51855, 65553, 80536, 16678, 90651, 19633, 93746, 70591, 94422, 33657, 52974, 13630, 69196, 79490, 32250, 66530, 32790, 17127, 92015, 28249, 65102, 91455, 64033, 24017, 45651, 60117, 96785, 50649, 15436, 65914, 36166, 78692, 91558, 49051, 66543, 95701, 38010, 45785, 64305, 47125, 66807, 53798, 39771, 31704, 62165, 65163, 29324, 60646, 91668, 70470, 49620, 73173, 50390, 89026, 81234, 45456, 39896, 56209, 48104, 62372, 39333, 79867, 95279, 52605, 75787, 84796, 38805, 45963, 27579, 90333, 32386, 14026, 19291, 77541, 99587, 31439, 42133, 44755, 85828, 42114, 59161, 43113, 19801, 99100, 65884, 54308, 65747, 29500, 41826, 85615, 70557, 95815, 87262, 83658, 81087, 90172, 89905, 76914, 97931, 33944, 12857, 31425, 47737, 54370, 30972, 95939, 65658, 56393, 19853, 88897, 82340, 84119, 56333, 63170, 46323, 25888, 93367, 63331, 16400, 54046, 47922, 32747, 29791, 71231, 57799, 89922, 58351, 49144, 44735, 48818, 73875, 88792, 95437, 16461, 47343, 12386, 91444, 89445, 24720, 76245, 53193, 81174, 62085, 63488, 25099, 45860, 59677, 85517, 38418, 95501, 21940, 88869, 15733, 28860, 65805, 92611, 73443, 68225, 59098, 94473, 45560, 14714, 72384, 16713, 59990, 10894, 32150, 91101, 87562, 86572, 15065, 83303, 96607, 36622, 52276, 99240, 46404, 62733, 67070, 36323, 14422, 76755, 76212, 68464, 69048, 78830, 92884, 73029, 73783, 20321, 23224, 16276, 10461, 17913, 28947, 23436, 18265, 72046, 61316, 70861
+55634, 75018, 95501, 55714, 78366, 62509, 15990, 96324, 57910, 14717, 92495, 95004, 83538, 63476, 61559, 87324, 31948, 18349, 70973, 47466, 14717, 96393, 13914, 95954, 14239, 34634, 14607, 78200, 23855, 80316, 19452, 49491, 87593, 96160, 52582, 49491, 65164, 33641, 55714, 95501, 18884, 83702, 70973, 52220, 93149, 96694, 48192, 15065, 41889, 63631, 62165, 62894, 27053, 47769, 76755, 80470, 55714, 34601, 55790, 78366, 95501, 74658, 33194, 12345, 46593, 43900, 95501, 31096, 12550, 83702, 52220, 39771, 81388, 60545, 58448, 91287, 36836, 41677, 41677, 95125, 42384, 36037, 17117, 26136, 49087, 25849, 76566, 84695, 42384, 42384, 47375, 14607, 44442, 31831, 42384, 90670, 28575, 55714, 83702, 99168, 30972, 41677, 46189, 65158, 84691, 14239, 52722, 52930, 49491, 63132, 54501, 26753, 69512, 56271, 89918, 27775, 95501, 18798, 56489, 52220, 96289, 85343, 41677, 45037, 14717, 15065, 28328, 49491, 46189, 98951, 99168, 33812, 41468, 36618, 27053, 53516, 12345, 55714, 12550, 61671, 27121, 25499, 91585, 86789, 32719, 75443, 98823, 56489, 10534, 81862, 21798, 53241, 55541, 94956, 29025, 18426, 35540, 83730, 78366, 15782, 46189, 30972, 37915, 56261, 83702, 55865, 15065, 14898, 62031, 17436, 61587, 99808, 51695, 86863, 14717, 49491, 66208, 52603, 26136, 78366, 78366, 15065, 96790, 20525, 46189, 26136, 27053, 79069, 14239, 30166, 80805, 52600, 56489, 52600, 56271, 72844, 79185, 58952, 10417, 39771, 76755, 41677, 30451, 27053, 27542, 26136, 30869, 52220, 34601, 40426, 95501, 56489, 14607, 45220, 54970, 47973, 96819, 39771, 52529, 67718, 17626, 29641, 62894, 68684, 89330, 80231, 44013, 27002, 58758, 14239, 94737, 64083, 56489, 14717, 14308, 50086, 11695, 97014, 56489, 14607, 20651, 26237, 39721, 12345, 39855, 62165, 56271, 70973, 84946, 27121, 33303, 89399, 35446, 39771, 49491, 16061, 44972, 70973, 98851, 21798, 71876, 39771, 25343, 26646, 28328, 47460, 96095, 95501, 43102, 81862, 70973, 10254, 47079, 46286, 42053, 66988, 27121, 14239, 62087, 42384, 96303, 70973, 21798, 52179, 48291, 95222, 81166, 78723, 22884, 39721, 22466, 98147, 41677, 27121, 76432, 52568, 56271, 39046, 82417, 85385, 41819, 22488, 76901, 16456, 70973, 72092, 69258, 15363, 33440, 78366, 45210, 95501, 24684, 52220, 77153, 65651, 22660, 21798, 46189, 39771, 12550, 11236, 39771, 28328, 34601, 86449, 14607, 78067, 83702, 65003, 11452, 36155, 25782, 47994, 41013, 20279, 34534, 36291, 85422, 52406, 70431, 81862, 64251, 10652, 14607, 34601, 49937, 60524, 52220, 30972, 12550, 55735, 34202, 23203, 68443, 47344, 99640, 95501, 42860, 72844, 78366, 86108, 60623, 81862, 44985, 90447, 81862, 62281, 94900, 73969, 42384, 30964, 28328, 24873, 52220, 17266, 74256, 75269, 52000, 55316, 33934, 32349, 36104, 35349, 58662, 74304, 38629, 91593, 36751, 14607, 30972, 95154, 52890, 73820, 48739, 56489, 14559, 75319, 52220, 92873, 21675, 99240, 78366, 21810, 28234, 63254, 78620, 14469, 42239, 15446, 52600, 35748, 76509, 15436, 76755, 23336, 12550, 59480, 78380, 27053, 57333, 76094, 91971, 95357, 81688, 49007, 75999, 70973, 66691, 23385, 14768, 48182, 90234, 27775, 57322, 58353, 14717, 14239, 34601, 63426, 83250, 98026, 63990, 53572, 25974, 11925, 72844, 25161, 73804, 78366, 79173, 85825, 15313, 64946, 52600, 28328, 70973, 47478, 95501, 46847, 30972, 15065, 76755, 40028, 81544, 56271, 56489, 49491, 42384, 80995, 65077, 21798, 52600, 56086, 62303, 34601, 27121, 12345, 48079, 55714, 56271, 92370, 23855, 56271, 33003, 14239, 21798, 25747, 60774, 56489, 52220, 74754, 14239, 52600, 41677, 27775, 20613, 27053, 49191, 81862, 80089, 82040, 34022, 85672, 14607, 35936, 11444, 81574, 55714, 48397, 74632, 70973, 29041, 72844, 96364, 77922, 35039, 89711, 14616, 62165, 65090, 86139, 46008, 44592, 62165, 72080, 27412, 72844, 42384, 76147, 21798, 65427, 99168, 70973, 70973, 12443, 51861, 51073, 30972, 61678, 91679, 72844, 24424, 26674, 70973, 79932, 37967, 52600, 99240, 42384, 56489, 86672, 62894, 32030, 52770, 14717, 11443, 93881, 80725, 60551, 49335, 72639, 62165, 50347, 39721, 34601, 52600, 65043, 78196, 72844, 36315, 86175, 43976, 14239, 42384, 42384, 92031, 12345, 10167, 86468, 60466, 48514, 11600, 99168, 49648, 90046, 28328, 23855, 15065, 55320, 76755, 35621, 56271, 62908, 32551, 26068, 49491, 65599, 14316, 85487, 54021, 42384, 12513, 52594, 19297, 32234, 31236, 94041, 21838, 37352, 14717, 78366, 96018, 97837, 19753, 62165, 70973, 44001, 41677, 21798, 64924, 43682, 34601, 70973, 34954, 23030, 28240, 56374, 95558, 81033, 30518, 70973, 62165, 15065, 64408, 28328, 34601, 66708, 27053, 39771, 34601, 34601, 82492, 42887, 74914, 28817, 85938, 40779, 78366, 32921, 59335, 99168, 12345, 34718, 82815, 76636, 30945, 34601, 37240, 81295, 33484, 67805, 49073, 80068, 18371, 17145, 80589, 90417, 94168, 39721, 93602, 21798, 46958, 41677, 95501, 35957, 37717, 49491, 52600, 52600, 89557, 21798, 61755, 15065, 26806, 98399, 81977, 56489, 65010, 62507, 24038, 34601, 34601, 40279, 76591, 21709, 52220, 59302, 94355, 38777, 75281, 25359, 47933, 61504, 28328, 23895, 12345, 27053, 49491, 27053, 46255, 56271, 96584, 52220, 14607, 33277, 75075, 72844, 70345, 56271, 23454, 30972, 29726, 51050, 21638, 78721, 27053, 52600, 55714, 39018, 95501, 52220, 43009, 25161, 34743, 41677, 42554, 28328, 29475, 63539, 66314, 52220, 30972, 18563, 51083, 49491, 81231, 27053, 77076, 11025, 14607, 97003, 95582, 37280, 27053, 56489, 95501, 31922, 62165, 83547, 64695, 41677, 95501, 42384, 28233, 32491, 61928, 87569, 21823, 15065, 14886, 32452, 27775, 56489, 27728, 26309, 53226, 15776, 98902, 70973, 87812, 84461, 14607, 34601, 83702, 90585, 52600, 67883, 78366, 30972, 18187, 60451, 28328, 62894, 18396, 30730, 52072, 71619, 52600, 52220, 41677, 25161, 65615, 56489, 70973, 34601, 80330, 52600, 96655, 77648, 25161, 51573, 94233, 56271, 81862, 60802, 54374, 34741, 62894, 55714, 52600, 20887, 28328, 56271, 14607, 86054, 27053, 95501, 22503, 69007, 56271, 67504, 15065, 73240, 55714, 85539, 18771, 95501, 84004, 66585, 64152, 26097, 71764, 30702, 37200, 52600, 29029, 39771, 65672, 15065, 14247, 18620, 36512, 99202, 82629, 62894, 27600, 95501, 40539, 99003, 56271, 72035, 47366, 28328, 88930, 49491, 27053, 11986, 34906, 76755, 99055, 43550, 72844, 70973, 55340, 95942, 16863, 99168, 46189, 40119, 91883, 52600, 59337, 42384, 14239, 26731, 22856, 78366, 25161, 62894, 28328, 45495, 70230, 88861, 95501, 15065, 83702, 99725, 27736, 78366, 13437, 18052, 52600, 88914, 52220, 93458, 14144, 13271, 65648, 76222, 34601, 49301, 76755, 41677, 41823, 46298, 11280, 44705, 60268, 56271, 97212, 76755, 21741, 42384, 52220, 16019, 15436, 46189, 27121, 49491, 56271, 56489, 24568, 39771, 31753, 76932, 37078, 12345, 27053, 67447, 52600, 78366, 31757, 42384, 34473, 46189, 27053, 52654, 98942, 24726, 98584, 11941, 45484, 21798, 78366, 30972, 30972, 77281, 74187, 49491, 34601, 47592, 41677, 14239, 69119, 76150, 12345, 92795, 14607, 57058, 19835, 56887, 49491, 76755, 25566, 99330, 52220, 83417, 28328, 76755, 29889, 52600, 77863, 62165, 21798, 89470, 52220, 72758, 30562, 27053, 54765, 28328, 36193, 18463, 27143, 56489, 42384, 30416, 42384, 52220
\ No newline at end of file
diff --git a/src/resources/day02.txt b/src/resources/day02.txt
new file mode 100644
index 0000000..6f3dae2
--- /dev/null
+++ b/src/resources/day02.txt
@@ -0,0 +1,1000 @@
+67 69 70 71 72 75 74
+20 21 24 26 28 28
+43 45 48 50 53 57
+54 55 57 60 62 67
+23 26 24 27 28
+70 72 69 70 71 72 70
+3 5 8 10 8 9 11 11
+40 41 43 44 43 45 49
+22 24 27 30 31 29 31 36
+35 37 39 39 42 45 47 50
+81 83 83 84 85 83
+8 10 10 11 11
+85 86 86 87 91
+9 11 12 12 15 18 19 24
+84 87 89 93 94 95
+46 49 53 55 56 57 59 57
+65 67 69 71 73 77 77
+40 43 47 48 52
+69 70 74 75 78 81 82 88
+32 34 39 42 44
+56 59 60 67 69 67
+64 67 69 74 75 76 77 77
+20 21 24 31 35
+32 34 36 39 45 50
+57 56 57 59 60 63 64 65
+63 60 61 64 66 68 70 69
+11 9 12 13 16 18 18
+50 47 49 52 56
+15 12 13 16 19 21 26
+74 72 71 74 75
+76 73 70 72 69
+20 18 16 18 21 24 24
+23 20 23 25 28 30 27 31
+47 45 47 49 47 53
+16 14 17 17 18 19
+46 44 45 45 46 43
+65 62 62 65 67 68 68
+85 84 87 87 91
+80 79 79 80 86
+21 20 23 26 28 32 33
+61 58 62 63 65 63
+3 2 5 9 9
+73 70 74 76 80
+25 24 27 31 33 35 38 44
+31 30 37 40 42 45
+81 79 84 85 86 88 90 88
+6 4 6 8 13 14 14
+67 65 68 73 75 76 80
+42 40 43 49 51 52 55 61
+76 76 77 79 81 84
+57 57 60 63 64 66 69 66
+18 18 21 23 25 27 27
+59 59 61 64 68
+27 27 29 30 33 39
+79 79 81 78 79
+16 16 17 14 13
+45 45 43 45 45
+87 87 89 92 93 92 93 97
+69 69 70 71 74 73 74 81
+37 37 39 40 41 41 42 45
+10 10 12 12 9
+35 35 38 41 41 41
+64 64 66 69 69 72 73 77
+22 22 22 24 26 33
+5 5 9 10 13 16 18 19
+24 24 25 29 28
+41 41 42 46 46
+24 24 26 28 29 33 37
+4 4 5 9 11 14 16 23
+48 48 50 55 56 57 59
+22 22 23 28 29 30 32 29
+10 10 11 17 17
+33 33 36 43 46 50
+41 41 48 51 54 59
+36 40 42 44 47 50 52
+19 23 25 27 30 31 32 31
+44 48 49 51 52 53 55 55
+33 37 39 41 43 45 48 52
+12 16 19 22 25 26 31
+47 51 48 49 52
+37 41 43 44 41 43 46 43
+19 23 26 29 27 30 32 32
+10 14 11 13 17
+25 29 32 30 37
+64 68 68 70 73
+1 5 7 7 9 10 8
+21 25 27 27 27
+5 9 12 13 13 16 20
+65 69 69 71 72 75 77 82
+61 65 69 71 72
+57 61 62 65 67 71 69
+82 86 87 88 90 94 94
+79 83 85 89 90 93 97
+24 28 32 33 35 37 40 47
+71 75 81 83 86 87 90
+44 48 50 57 59 56
+49 53 54 55 60 60
+18 22 25 27 32 34 38
+51 55 57 58 64 66 72
+65 71 74 75 78 79 81 83
+13 19 22 25 28 31 29
+80 87 90 93 96 96
+11 16 17 20 21 23 27
+18 23 26 29 32 38
+86 91 93 92 95 98
+57 63 64 66 64 65 64
+73 78 79 76 78 80 82 82
+32 38 41 43 42 45 49
+78 83 86 84 87 92
+73 78 79 80 82 84 84 85
+64 71 72 74 75 76 76 73
+54 59 59 62 64 65 65
+51 58 61 63 66 67 67 71
+19 25 27 27 30 36
+21 27 30 32 36 38
+12 17 18 22 25 24
+43 49 51 52 53 57 60 60
+19 25 29 32 33 35 39
+47 53 54 58 63
+10 16 19 24 25 26
+25 30 33 40 42 41
+84 89 90 96 96
+3 10 12 15 21 25
+16 23 25 26 27 28 34 39
+57 56 54 53 51 49 46 49
+17 16 15 14 14
+27 25 23 21 20 16
+42 41 38 35 33 32 29 23
+83 82 80 77 75 73 75 74
+36 35 37 34 33 30 28 31
+7 6 4 1 2 2
+89 86 84 83 84 82 78
+67 66 64 61 59 62 55
+54 51 49 48 48 46 44 43
+60 59 59 57 59
+35 34 34 31 30 30
+29 27 26 24 24 20
+72 70 69 69 66 61
+25 23 22 18 15 13 10 9
+45 43 42 41 37 35 32 34
+98 95 91 88 88
+90 89 85 82 78
+25 24 23 19 18 11
+47 45 44 41 36 33
+48 46 44 42 39 37 32 33
+27 24 21 19 14 14
+64 62 56 54 50
+95 93 92 89 82 80 74
+92 94 91 88 87 86 85 84
+84 87 86 84 83 85
+58 59 56 55 52 50 50
+25 26 24 23 22 20 17 13
+14 15 14 13 11 9 3
+26 27 28 25 24
+35 38 35 32 33 35
+29 30 29 26 24 22 23 23
+53 55 56 53 49
+53 56 53 50 52 46
+44 45 45 42 41 39 38 36
+29 32 30 27 27 26 25 27
+24 26 23 23 20 18 17 17
+30 31 31 30 28 27 26 22
+74 77 74 73 72 70 70 63
+83 86 84 81 77 74 71
+16 17 15 12 8 11
+67 70 68 67 63 63
+42 43 41 39 37 33 29
+28 31 27 24 23 20 15
+76 79 73 70 67
+10 13 12 6 3 4
+71 73 71 69 67 65 59 59
+40 42 40 38 33 32 31 27
+95 96 89 88 82
+36 36 33 32 31
+29 29 26 24 22 21 23
+93 93 90 88 87 87
+89 89 87 84 80
+26 26 23 20 19 12
+72 72 75 74 72 69
+41 41 40 39 37 35 37 40
+5 5 4 2 5 3 3
+29 29 28 30 29 28 24
+96 96 93 95 90
+23 23 23 21 18 15 13
+75 75 74 73 72 72 69 70
+82 82 82 80 79 77 75 75
+56 56 55 53 53 49
+47 47 47 46 45 44 38
+30 30 29 26 22 21
+37 37 33 30 27 24 26
+57 57 53 50 48 46 43 43
+81 81 80 79 77 73 69
+67 67 64 61 57 55 49
+41 41 40 37 34 27 25
+35 35 30 29 26 23 20 22
+33 33 32 25 22 22
+30 30 23 21 17
+26 26 24 22 17 14 9
+80 76 75 72 70 68 66 65
+44 40 39 37 34 31 29 32
+69 65 62 61 61
+81 77 75 72 69 68 65 61
+51 47 45 44 41 34
+88 84 81 80 81 79 77 74
+65 61 62 61 60 59 56 57
+65 61 59 62 60 60
+65 61 62 61 60 59 55
+33 29 26 27 25 23 20 14
+33 29 29 27 25 23 22
+64 60 58 58 56 55 56
+72 68 65 65 64 64
+67 63 60 59 58 58 54
+41 37 35 35 30
+38 34 31 27 25 22 21 18
+18 14 12 8 11
+16 12 11 8 5 1 1
+77 73 69 67 63
+61 57 53 52 47
+82 78 76 70 68 66 63 62
+68 64 59 58 60
+79 75 68 65 64 62 60 60
+83 79 77 71 68 64
+20 16 11 9 3
+30 25 23 22 21 19
+97 90 89 88 85 86
+68 63 61 59 58 58
+36 29 28 27 24 21 19 15
+19 14 12 11 6
+60 55 56 54 51
+63 57 54 52 54 56
+25 19 18 17 18 16 16
+57 51 48 51 48 47 44 40
+33 27 28 25 22 20 14
+41 36 35 35 32 30
+58 51 50 47 46 46 47
+40 33 30 30 30
+75 68 67 67 66 65 62 58
+74 67 64 64 63 61 60 54
+37 30 26 24 23
+86 81 77 74 75
+20 13 9 8 5 4 2 2
+51 45 42 38 37 36 34 30
+77 72 70 68 64 58
+89 83 82 81 78 77 71 68
+25 18 12 9 8 11
+42 37 30 28 28
+73 66 60 57 54 50
+58 51 48 43 37
+34 37 38 39 42 45 43
+51 53 54 55 58 60 60
+41 43 46 49 52 54 56 60
+45 46 49 52 59
+91 92 95 93 94
+83 86 85 88 90 93 96 95
+66 68 67 69 70 71 72 72
+11 12 14 15 14 17 21
+43 46 44 46 49 54
+2 3 6 8 11 11 13 14
+17 20 22 22 19
+9 10 10 11 12 12
+83 85 87 88 88 92
+41 43 46 47 47 54
+61 62 64 68 69 70
+63 66 68 70 73 77 76
+55 56 60 61 64 66 69 69
+37 39 40 44 46 49 53
+39 41 44 48 51 54 55 60
+4 7 14 16 17 18 21 22
+38 41 43 44 49 46
+14 17 20 27 29 30 30
+34 35 37 39 44 45 46 50
+79 82 88 89 91 92 99
+62 61 62 65 68 69 70
+26 24 27 28 31 28
+64 63 66 68 71 71
+32 30 33 36 39 40 44
+30 28 31 33 36 43
+81 80 82 80 83 85 86
+47 44 46 49 50 49 51 49
+36 33 35 32 32
+58 56 55 56 60
+25 23 20 21 24 30
+27 25 26 29 31 31 32
+67 66 66 68 66
+58 57 57 59 59
+86 84 84 87 89 91 92 96
+18 17 19 21 22 22 25 30
+88 86 87 89 93 96
+29 27 29 30 31 35 32
+35 32 36 38 40 43 43
+38 35 38 42 44 47 51
+41 40 44 46 48 49 56
+82 80 81 87 89 91
+45 43 44 50 51 50
+8 5 10 12 15 15
+59 56 59 62 68 71 74 78
+7 5 7 12 13 14 21
+83 83 84 86 89
+77 77 80 81 84 81
+9 9 10 12 14 17 20 20
+28 28 31 32 35 38 40 44
+40 40 43 44 47 50 55
+51 51 53 55 56 53 55 56
+23 23 24 21 24 22
+44 44 47 48 46 46
+84 84 86 88 87 89 93
+69 69 67 68 74
+62 62 65 65 67
+69 69 70 70 72 71
+77 77 77 79 79
+21 21 24 24 28
+49 49 50 50 52 53 58
+27 27 29 33 36 39 40
+46 46 50 52 55 57 56
+31 31 35 37 40 42 42
+45 45 47 48 52 56
+2 2 5 9 16
+46 46 47 50 57 58
+70 70 72 75 81 79
+85 85 86 88 89 94 94
+33 33 34 36 42 46
+24 24 25 30 31 32 37
+83 87 88 90 93 95
+82 86 89 91 94 97 94
+39 43 45 48 50 50
+19 23 26 28 32
+2 6 7 8 11 13 14 19
+30 34 35 38 35 37 39
+73 77 79 77 80 83 80
+51 55 58 61 59 59
+69 73 74 75 73 77
+63 67 70 69 70 73 78
+33 37 40 40 43
+17 21 24 24 23
+9 13 16 16 17 18 18
+23 27 27 30 34
+69 73 73 74 77 78 83
+45 49 50 52 55 58 62 64
+3 7 11 14 16 19 22 21
+61 65 69 70 71 72 73 73
+77 81 84 85 86 90 92 96
+58 62 65 69 71 74 80
+36 40 42 48 50
+42 46 49 50 53 59 60 59
+38 42 47 48 49 49
+6 10 12 18 20 22 26
+44 48 55 56 58 64
+17 23 24 26 27 28
+75 80 82 83 84 87 90 87
+37 43 45 48 48
+18 24 25 28 32
+19 25 26 27 30 31 32 39
+17 23 24 26 28 26 27 28
+18 25 22 25 23
+25 31 32 35 37 36 37 37
+47 54 51 54 58
+33 40 41 40 42 49
+47 52 55 58 58 60
+52 57 57 60 59
+26 33 33 35 35
+8 14 14 15 17 21
+54 61 61 62 65 66 68 73
+38 44 48 50 53 56 59
+27 32 35 39 36
+83 90 93 95 99 99
+61 67 71 73 77
+76 81 85 87 92
+6 12 14 15 22 25
+5 11 12 17 14
+24 31 33 34 41 42 42
+74 79 80 83 86 92 96
+67 74 77 79 85 91
+81 79 77 74 77
+37 35 32 30 27 27
+73 72 69 66 62
+32 29 26 25 22 21 16
+16 13 15 13 12 11 9 6
+76 73 74 72 73
+28 26 25 26 23 21 21
+47 44 43 45 41
+39 37 34 31 33 27
+68 66 65 64 62 60 60 57
+9 7 6 6 7
+34 32 29 29 28 26 25 25
+69 68 68 66 65 62 58
+53 52 51 49 49 43
+20 19 17 13 10 7 4
+46 43 40 39 35 34 33 36
+51 50 46 45 45
+20 18 14 12 8
+30 29 26 23 21 17 15 8
+77 74 67 66 64 62 61 59
+19 17 14 8 11
+28 27 21 20 18 18
+91 90 87 80 76
+32 29 26 25 18 11
+67 70 67 65 64
+95 96 93 92 89 87 89
+18 21 18 17 14 14
+66 67 65 62 61 57
+18 21 19 16 15 14 8
+11 14 11 9 8 11 10 9
+89 91 90 91 90 91
+70 73 72 70 73 70 70
+11 13 12 10 13 10 9 5
+15 18 17 15 18 15 12 6
+32 34 32 29 27 27 24 21
+14 17 17 15 17
+55 56 54 52 49 48 48 48
+45 46 46 45 44 40
+64 65 63 63 62 57
+68 71 70 67 66 64 60 59
+50 53 51 49 45 48
+71 74 71 68 64 62 59 59
+29 30 26 25 21
+97 99 97 93 86
+82 85 84 78 75 73
+14 15 14 7 4 2 4
+64 67 66 64 63 62 57 57
+67 68 65 63 61 55 51
+35 36 35 33 27 25 24 17
+90 90 88 87 84 82
+21 21 19 16 13 14
+58 58 57 55 54 54
+75 75 73 70 67 65 61
+14 14 13 12 11 6
+83 83 81 78 76 78 77 74
+78 78 77 76 77 78
+40 40 39 36 33 32 34 34
+71 71 70 73 69
+62 62 65 64 63 60 55
+83 83 80 80 78
+92 92 91 89 86 86 85 87
+18 18 18 16 15 14 12 12
+15 15 13 13 9
+42 42 41 38 38 33
+80 80 77 73 72
+9 9 8 7 6 2 3
+78 78 76 74 73 69 69
+93 93 90 86 83 79
+52 52 48 47 41
+65 65 62 57 56 54 52
+71 71 70 64 66
+49 49 44 42 41 41
+57 57 55 52 45 41
+77 77 70 69 66 59
+55 51 49 47 44 42
+56 52 50 49 48 51
+90 86 83 82 80 80
+47 43 42 39 36 35 31
+83 79 77 74 72 67
+19 15 13 10 7 5 7 6
+19 15 13 15 14 13 10 12
+78 74 76 75 73 71 71
+53 49 52 49 46 45 41
+37 33 31 32 30 29 28 22
+14 10 10 9 6
+33 29 29 27 24 21 18 21
+99 95 92 92 92
+94 90 90 88 87 84 82 78
+29 25 24 21 21 19 18 12
+53 49 46 45 41 38 36
+19 15 14 12 10 6 8
+23 19 18 17 14 10 10
+93 89 87 83 79
+25 21 17 14 9
+82 78 73 71 70
+89 85 84 83 82 77 76 78
+30 26 19 16 15 15
+94 90 87 84 79 75
+31 27 26 25 18 15 9
+36 29 26 25 23 21
+56 51 48 45 44 41 39 40
+53 46 45 42 40 39 39
+67 60 59 57 56 53 51 47
+71 65 62 60 59 57 52
+23 17 16 19 17 15
+19 14 17 16 15 13 15
+59 54 52 53 52 51 51
+45 40 43 41 37
+70 64 61 60 59 62 55
+35 30 28 28 26 25
+31 26 23 22 22 19 22
+88 83 80 80 77 74 72 72
+62 55 53 53 50 48 46 42
+58 52 51 51 44
+66 59 55 52 49 47 46 44
+93 86 83 80 79 75 74 75
+46 40 38 34 34
+96 89 88 86 84 80 79 75
+79 72 68 65 60
+36 30 27 21 19 17 14
+35 28 26 19 20
+38 33 26 25 24 21 18 18
+31 26 21 20 17 16 15 11
+64 59 57 50 48 45 39
+42 44 45 48 51 54 53
+46 48 50 53 54 57 57
+60 63 64 66 67 70 71 75
+29 31 34 36 42
+40 41 43 44 47 46 47 49
+78 79 76 78 81 78
+8 11 13 11 12 12
+40 43 41 43 47
+25 27 29 32 33 36 35 41
+41 42 45 45 48
+6 9 10 10 13 12
+3 5 7 10 10 12 12
+80 82 82 85 87 91
+4 6 9 12 15 18 18 23
+34 35 38 42 44 47
+38 41 43 47 45
+30 32 34 38 39 39
+13 14 18 19 22 24 28
+28 31 34 36 40 43 49
+3 4 5 11 13 15 17 20
+77 78 84 87 88 91 94 93
+82 84 87 94 94
+24 27 29 32 37 38 42
+70 71 76 79 85
+28 26 29 32 35
+11 9 11 13 14 13
+36 33 34 35 37 37
+11 9 10 13 15 18 20 24
+66 65 68 70 73 79
+37 34 36 33 36
+25 23 25 23 25 26 28 25
+25 24 25 27 24 27 29 29
+52 50 49 50 54
+65 63 61 62 63 64 69
+53 51 51 53 55
+76 75 78 79 81 81 80
+90 87 88 88 88
+89 88 91 92 95 95 99
+85 82 83 85 86 87 87 93
+85 83 87 90 92
+8 5 8 11 15 13
+84 81 85 88 90 90
+13 11 15 16 19 20 24
+61 59 61 65 67 73
+31 29 31 36 37
+3 1 4 9 7
+28 25 32 34 35 37 37
+25 23 25 27 30 36 40
+43 42 43 44 50 56
+39 39 41 43 44 46 49
+72 72 73 75 72
+58 58 60 62 63 66 66
+56 56 58 60 62 64 68
+53 53 56 59 60 61 68
+82 82 81 83 84
+61 61 64 66 65 62
+5 5 6 9 6 6
+7 7 4 7 9 12 13 17
+56 56 53 55 56 57 62
+24 24 27 27 29
+15 15 16 19 19 21 24 21
+73 73 73 76 78 81 83 83
+40 40 42 42 46
+57 57 57 60 63 64 65 71
+86 86 89 93 96 97
+55 55 56 57 60 64 62
+39 39 43 46 49 51 54 54
+8 8 12 13 17
+46 46 50 51 52 59
+34 34 41 43 45 46 48 51
+60 60 61 67 68 69 66
+46 46 47 48 49 54 55 55
+3 3 10 11 13 16 20
+36 36 39 46 51
+15 19 21 24 25 26 29 30
+19 23 26 29 31 30
+39 43 46 48 48
+16 20 22 23 24 28
+20 24 26 29 32 35 42
+25 29 30 32 29 31 32
+66 70 68 70 68
+72 76 79 78 78
+92 96 94 95 99
+22 26 28 29 26 33
+87 91 91 92 93 94 95 97
+48 52 54 56 56 58 56
+85 89 90 90 93 93
+20 24 27 29 29 32 34 38
+72 76 76 78 84
+31 35 39 41 44 47
+16 20 24 27 26
+87 91 92 93 95 99 99
+62 66 70 72 76
+53 57 59 63 64 69
+81 85 87 92 94
+7 11 18 19 20 23 24 22
+37 41 48 51 52 52
+69 73 76 82 84 88
+43 47 54 57 60 61 66
+47 52 54 56 58
+2 8 9 11 9
+83 89 91 94 94
+51 58 61 64 68
+54 59 60 63 64 65 70
+81 88 89 86 89
+80 85 87 84 81
+36 43 45 46 48 50 48 48
+19 26 28 31 28 32
+31 36 37 38 39 38 44
+42 48 48 50 51 54
+11 16 17 19 22 22 25 24
+52 58 61 61 62 65 68 68
+79 84 84 86 88 90 94
+49 54 57 59 59 60 61 66
+32 39 40 44 46 49
+58 65 69 70 71 73 75 74
+3 8 12 15 17 19 19
+24 29 31 34 38 40 44
+62 67 70 73 77 80 87
+2 8 9 15 16
+3 8 11 14 15 21 19
+9 14 16 18 24 26 29 29
+48 55 58 60 61 66 68 72
+66 72 79 82 85 87 89 94
+85 84 82 81 79 78 75 77
+87 84 81 78 76 75 75
+35 34 33 32 30 26
+69 67 65 64 63 61 55
+51 48 47 44 46 43 40
+87 86 83 84 85
+42 40 42 39 39
+96 93 94 93 89
+48 47 50 48 47 41
+18 16 13 12 12 9
+65 64 62 62 60 59 60
+77 76 76 75 72 70 68 68
+46 44 44 41 40 36
+46 45 42 40 40 37 32
+26 24 23 19 17 15
+19 16 13 12 8 10
+28 26 25 24 21 17 17
+50 48 45 41 38 34
+24 23 21 18 17 13 6
+49 48 43 42 40
+35 33 30 25 26
+23 20 17 15 9 9
+65 63 62 61 54 51 47
+72 69 67 64 58 56 50
+76 77 75 73 72
+49 50 48 46 45 43 46
+52 53 50 48 48
+83 86 85 83 81 79 75
+24 26 23 22 15
+71 74 77 74 72 71 69 67
+29 32 33 31 33
+66 69 67 66 63 66 64 64
+90 93 91 90 91 87
+51 53 50 51 45
+14 16 13 11 11 9 7 6
+81 82 80 77 77 76 77
+7 9 9 7 6 3 3
+82 84 84 81 77
+63 65 63 61 61 59 57 50
+43 44 42 38 36 33
+50 52 48 47 45 42 41 44
+53 55 51 50 47 47
+61 64 61 57 55 51
+78 81 79 77 73 66
+42 44 42 39 32 31
+14 15 14 9 11
+92 93 92 86 83 83
+72 74 67 64 61 58 56 52
+49 50 47 45 43 41 34 29
+38 38 35 34 33 32 29
+70 70 69 68 65 64 62 64
+49 49 46 44 44
+17 17 15 12 11 8 5 1
+14 14 12 9 8 3
+27 27 28 25 23
+62 62 61 62 59 58 55 56
+60 60 59 61 59 57 56 56
+69 69 68 71 67
+75 75 78 77 75 70
+26 26 25 23 22 22 19 17
+85 85 82 82 81 78 81
+57 57 55 52 51 51 51
+10 10 10 9 5
+69 69 66 65 65 58
+41 41 39 36 32 31 29 27
+17 17 13 12 9 7 9
+32 32 31 27 27
+21 21 17 14 10
+74 74 73 70 68 67 63 57
+47 47 41 39 37 34 31
+49 49 46 45 40 39 40
+73 73 70 65 65
+35 35 34 31 26 22
+50 50 43 41 38 32
+34 30 27 25 22 19
+55 51 49 47 44 42 40 41
+42 38 36 35 32 29 28 28
+64 60 57 56 53 50 47 43
+54 50 49 48 46 44 41 35
+25 21 20 18 20 17
+97 93 94 91 94
+38 34 35 34 34
+51 47 45 47 46 43 42 38
+95 91 93 92 91 85
+41 37 36 34 34 32
+34 30 28 28 30
+51 47 47 44 44
+12 8 8 7 3
+97 93 91 90 90 88 87 80
+96 92 91 87 85 84
+87 83 81 78 76 73 69 70
+22 18 16 14 13 9 9
+77 73 72 69 65 61
+81 77 75 71 70 68 61
+71 67 62 60 57
+84 80 77 71 70 67 65 68
+73 69 66 65 59 59
+45 41 38 35 33 26 24 20
+31 27 25 19 17 14 12 5
+23 16 13 12 11
+78 72 70 68 69
+52 45 44 41 40 40
+67 61 58 55 53 49
+67 60 59 58 55 53 46
+50 45 43 44 42
+69 63 65 64 66
+97 90 93 90 89 86 83 83
+31 26 24 21 23 19
+42 37 35 37 34 32 29 24
+95 90 88 87 86 86 85 83
+43 37 35 35 34 31 33
+15 9 7 4 3 3 3
+84 78 75 72 72 71 69 65
+88 82 81 81 78 76 73 66
+22 15 14 10 7 5 4
+90 84 81 77 78
+93 86 83 79 78 77 75 75
+37 32 29 25 21
+76 70 68 66 62 61 56
+84 77 75 72 71 64 63 60
+90 85 83 81 75 72 70 71
+67 60 55 53 53
+47 40 38 31 27
+96 89 82 81 76
+99 95 91 88 87 85 83 79
+53 46 45 44 44 42 41 34
+53 53 54 60 63 64 67 71
+68 71 67 66 59
+56 63 64 66 69 72 72
+77 73 71 69 66 63 62 58
+12 15 12 11 8 6 9
+16 15 17 18 15 17 24
+30 29 30 34 36 40
+57 57 58 60 64 66 67 65
+43 43 46 47 48 49 47
+35 31 27 26 25 23 20 19
+38 45 47 48 49 48 51 58
+35 35 32 31 30 29 24
+49 47 44 41 38
+19 20 23 25 26
+88 85 83 82 79
+58 59 62 63 65 67
+7 9 10 11 13 14
+50 53 55 56 58 59
+99 97 94 91 89 87 85
+13 15 18 21 22 24 25
+60 57 55 52 51 48 47
+68 69 72 73 74
+83 84 85 88 90 91 94
+46 48 51 53 54 57 59
+51 52 55 57 59 62 65 68
+29 31 32 33 34 36 37
+52 54 57 59 61 64 67
+88 85 83 80 79 78 75 73
+31 32 34 35 37
+22 20 17 15 12 11 8 5
+67 68 69 71 73 76
+4 7 9 12 14 15
+36 39 40 43 46 49 50 51
+29 28 26 25 23 22 21 18
+17 19 21 22 23
+86 85 83 81 78
+20 17 15 12 11 9
+85 82 80 79 76 73 71 68
+60 61 63 64 66
+35 33 31 28 27 26 23
+51 54 55 58 59 62
+4 5 6 7 8 11 12
+57 59 60 61 62 64 66
+69 67 66 65 64
+72 73 76 77 79 82 83
+83 84 86 88 89
+41 44 45 47 48 49 51
+70 73 76 77 80
+89 86 85 84 82 81 78 76
+14 13 12 10 7 4
+78 77 76 75 72 71
+15 16 18 19 21
+41 44 45 47 48
+76 79 81 84 86 87 90 93
+54 51 48 46 43 41 39
+14 11 10 7 5
+46 48 51 53 56 57 60 63
+99 98 97 95 93
+23 22 19 16 15 13 11
+54 53 52 50 47 44 42
+43 41 40 37 36 34 32 29
+66 67 70 73 74 77 78
+57 58 61 63 66 69
+41 40 38 36 35 34
+55 54 53 50 48 47 44 41
+81 79 78 77 74 71
+33 34 35 36 39
+90 87 85 84 83 81
+35 33 31 28 27 25
+55 53 50 48 45 42 39
+71 73 75 78 81 82 83
+36 33 32 30 28 27 24 23
+37 34 32 31 30 27
+55 54 53 52 50 47 44 42
+42 41 39 37 36 35
+14 11 9 8 6 3
+45 42 41 40 37 35 32
+69 67 66 63 60 57 55 53
+17 19 22 25 26 27
+70 73 75 76 77 79 80 82
+65 64 61 59 58 56 54 53
+78 80 81 84 86 88 91
+1 4 6 9 11 13 16
+32 31 29 28 25 23 22
+36 37 40 42 43
+34 36 38 39 42 43 45
+81 84 87 90 92 95 97
+12 14 16 17 18
+38 40 42 43 44 45 47
+4 6 8 10 11 14 16 19
+98 95 94 93 91 90
+52 51 49 46 44
+35 37 40 43 44
+84 83 81 80 78 75
+58 60 61 64 67 68 69 70
+58 55 52 50 48 45 42 39
+95 94 93 91 90
+91 90 89 86 85 83 81
+48 51 53 55 58 61
+40 42 45 48 51 53 55
+77 80 81 83 85 86 88
+47 49 52 54 55 57
+55 53 50 49 47 44 43 42
+63 65 67 69 70 72 73
+30 27 25 24 22 21
+78 80 82 84 87 90 92 94
+54 53 52 51 49 46
+77 74 73 70 68 65 63 61
+96 95 93 90 87
+48 49 51 52 54 55
+75 78 79 80 82 83
+61 64 67 69 72 74
+74 72 69 67 65 62
+35 36 38 39 40 41
+61 64 66 67 69 70 72 75
+53 52 51 50 48 45 44 42
+16 17 19 20 22 23 26 27
+88 91 92 94 96
+50 52 55 56 57 60
+62 64 67 69 72 75
+7 9 11 14 16 19 21 24
+32 31 30 27 24 22 19 16
+82 79 77 75 73 72
+60 58 56 54 53 51 48 47
+23 26 28 31 33
+92 91 88 87 86 84 82
+90 89 88 87 86 84 83 80
+77 79 80 83 85 88 90
+78 79 81 84 85 88 91
+42 39 37 34 31 29 26
+78 77 75 72 71 70 67 65
+64 67 68 71 73
+17 20 21 22 24
+58 56 54 53 52 50
+30 33 35 36 38 40 42
+71 68 65 62 61
+29 27 25 23 22 19
+41 39 38 36 35 33 32
+93 90 89 87 84
+41 39 38 37 34 31 28 26
+29 28 25 24 22 20 19 16
+35 38 39 42 45
+81 82 85 86 88 91
+34 35 37 40 42 45 48
+68 70 71 72 74 75 76 79
+11 14 15 17 18 19 20 21
+32 29 26 23 21
+92 90 87 84 82
+83 82 80 77 74 73
+88 89 90 93 94 96 99
+42 45 48 51 54 55 58 61
+83 85 86 87 90 93 94 96
+42 45 47 49 52 55 58
+11 13 14 15 18 19 22
+23 20 18 15 13 11 10 7
+47 44 41 40 37
+26 25 23 21 18 15
+3 5 6 7 8 10 11 12
+59 60 63 64 66 67 69
+92 90 87 86 85
+99 96 95 93 92 90 89
+73 70 68 67 64
+44 41 40 39 38 37 36 34
+30 33 35 38 41 42 45 46
+92 90 88 86 85
+98 96 93 90 87 85
+55 52 51 50 48 46 43
+85 86 88 91 93
+65 62 61 58 57 56 55 53
+25 28 31 32 35 38
+24 27 30 33 35
+70 67 64 62 59
+26 28 31 34 36 37 39 40
+94 93 92 91 90 89 86
+22 25 27 28 29 30 33 36
+44 47 50 52 54 55 58 60
+64 61 58 57 54 51 48 46
+26 24 23 21 19
+34 33 32 30 27 24 22
+24 26 29 31 34 35 37
+99 98 95 94 93 92 91 90
+44 42 39 38 35 33 31
+68 66 64 61 58 56 53
+19 17 14 12 9 7 5 3
+72 69 67 66 65 62 60
+41 44 45 46 48 51 53 55
+17 18 21 24 27 29 32
+71 73 76 79 80 83 86
+10 13 16 17 19 21 22 24
+46 43 40 38 35 34 31
+51 53 56 57 60
+23 25 27 28 30 31
+98 95 92 91 89 86
+60 57 55 54 53 52 49 48
+26 27 30 33 35
+41 39 38 36 34
+41 38 37 35 32 29 27
+89 92 95 97 98
+81 80 77 74 71 68 67
+12 13 15 17 20 21
+95 92 89 86 83 82
+20 18 17 16 14 11
+14 15 16 17 20 23 24 25
+91 89 86 83 81 79 78 76
+7 8 10 13 16
+21 22 25 26 28 31 34
+27 30 31 33 35 37 39
+50 53 54 55 56 58 60
+89 92 95 96 98
+59 57 56 54 53 52 50
+28 27 24 23 21 19
+77 78 79 82 85
+93 91 90 87 85 83 81
+56 55 53 51 48 45 42 40
+13 12 10 7 5 3 1
+40 42 45 48 49 50
+51 50 48 46 44 41 39 37
+77 79 80 83 85 86 87 90
+61 60 57 56 53 52 51 50
+28 25 23 21 20 19
+58 57 54 51 50 48 45 43
+54 57 58 59 61 63
+87 86 84 83 81 80 79 77
+4 6 8 11 13 16 17 19
+48 47 45 44 42 39
+13 15 17 19 21 24 25 27
+82 80 79 78 75 74
+90 88 85 82 81 79 76 75
+68 67 64 61 59
+90 93 94 96 98 99
+45 44 43 41 39
+9 12 13 15 18 19 20
+77 79 82 83 86 87
+17 15 12 11 8 6 3
+1 4 5 8 10 13 16
+50 49 48 46 43 41 40
+45 44 42 40 39 38 37
+20 23 25 26 29 32 35
+62 65 66 68 70
+22 24 25 27 30 33 36
+20 18 15 13 10 9 6
+65 63 62 61 58 55 54 51
+15 13 12 10 9 6 5
+28 26 25 23 20 17 15 13
+80 81 82 83 86
+85 82 80 78 76 73
+25 22 21 19 17 15 12
+52 54 55 58 60 61 62 65
+77 79 82 85 87
+36 33 32 31 28
+43 44 45 47 49
+12 15 17 18 21 22 24 26
+19 16 14 11 10 9
+67 68 70 71 74 76
\ No newline at end of file
diff --git a/src/resources/day02sanju.txt b/src/resources/day02sanju.txt
new file mode 100644
index 0000000..f187642
--- /dev/null
+++ b/src/resources/day02sanju.txt
@@ -0,0 +1,1000 @@
+90 91 93 96 93
+3 5 7 10 11 11
+35 37 39 42 46
+67 70 72 74 79
+9 12 13 16 15 16 19
+48 51 52 55 58 61 58 57
+3 4 7 9 8 9 9
+22 25 28 30 28 32
+38 41 44 45 42 49
+54 57 59 59 61
+54 55 55 56 58 55
+66 68 70 71 72 72 75 75
+32 35 35 38 42
+22 24 26 28 28 31 34 41
+55 57 59 63 64
+18 21 25 26 28 27
+39 40 41 43 47 49 50 50
+10 11 14 17 20 22 26 30
+35 36 39 40 44 45 52
+57 59 66 67 70
+15 17 19 22 29 26
+66 69 72 75 78 83 83
+73 76 78 83 86 90
+23 26 28 35 36 41
+83 81 82 85 88 90 92 93
+4 2 3 4 1
+8 7 8 9 11 13 13
+71 70 71 73 76 80
+22 20 21 22 25 31
+80 78 81 83 82 84 87 88
+14 13 16 19 18 19 20 18
+69 68 65 67 67
+57 55 56 55 59
+5 4 7 9 11 13 12 18
+91 88 88 90 92 93
+47 45 48 48 46
+58 56 59 60 63 63 63
+39 37 40 43 43 45 49
+34 33 36 36 43
+13 11 13 17 20 23 25
+11 8 12 14 12
+2 1 5 7 7
+8 7 10 14 18
+38 36 38 40 41 45 48 53
+68 67 72 75 77 79
+25 24 26 29 30 37 39 37
+31 29 31 37 37
+64 61 62 69 72 76
+5 2 5 11 14 15 22
+55 55 58 60 61 64 65
+59 59 61 63 66 65
+2 2 5 7 9 12 12
+29 29 31 34 35 38 39 43
+42 42 44 46 49 51 54 61
+89 89 90 93 96 94 96 98
+41 41 39 40 41 43 45 42
+36 36 38 35 37 37
+1 1 4 2 6
+36 36 39 41 40 42 47
+29 29 29 32 35 36
+24 24 26 29 31 31 29
+58 58 58 60 60
+56 56 56 58 62
+73 73 76 76 79 86
+49 49 52 56 59
+11 11 12 13 17 18 15
+63 63 67 70 70
+82 82 86 89 90 91 94 98
+38 38 40 42 45 49 54
+16 16 21 22 23
+45 45 51 54 51
+6 6 7 10 13 14 20 20
+22 22 23 29 30 32 33 37
+7 7 13 14 21
+81 85 87 89 90 92 95 97
+75 79 80 81 79
+56 60 61 63 65 65
+67 71 74 75 79
+4 8 11 13 15 18 23
+83 87 85 87 90 93 95
+90 94 95 93 94 93
+87 91 92 93 96 94 94
+34 38 39 36 38 39 43
+4 8 9 7 10 17
+23 27 28 30 33 33 34 36
+11 15 15 17 16
+38 42 44 47 48 49 49 49
+43 47 49 49 52 55 59
+79 83 85 85 92
+16 20 24 26 29 30
+77 81 83 87 90 92 89
+33 37 39 42 44 48 51 51
+71 75 79 81 85
+69 73 76 77 81 88
+33 37 42 44 47 50 53
+13 17 20 23 28 26
+51 55 56 59 60 62 67 67
+35 39 41 43 49 52 56
+60 64 70 71 76
+25 32 34 37 38 41
+1 6 8 10 12 9
+20 27 29 30 30
+52 59 60 62 63 64 65 69
+71 78 80 81 84 85 90
+64 71 73 71 72 73 76
+67 72 75 76 74 76 77 76
+38 43 40 41 41
+2 8 11 9 13
+72 79 80 79 80 86
+21 26 26 29 31
+72 78 79 79 81 83 81
+76 81 84 84 85 85
+42 47 50 53 53 54 58
+14 21 23 25 26 29 29 35
+83 88 90 93 97 98
+17 22 26 29 30 31 28
+46 52 54 58 58
+22 28 32 33 37
+65 71 73 77 82
+64 71 73 75 78 81 88 89
+42 47 50 55 56 54
+69 74 77 79 85 85
+54 59 62 68 72
+40 45 46 51 53 55 61
+55 53 50 47 44 43 40 42
+94 91 90 89 86 85 85
+52 50 47 46 44 40
+52 49 47 45 43 38
+88 87 88 85 84 82 81 78
+95 93 96 93 94
+84 83 84 83 83
+70 67 65 64 61 64 60
+98 97 98 97 95 94 92 86
+29 27 24 24 22
+34 31 30 30 28 29
+83 81 78 78 77 75 75
+60 59 59 58 57 55 52 48
+97 96 96 95 93 88
+50 49 47 43 42 41 39
+45 43 39 38 37 40
+91 89 85 83 83
+20 18 14 11 7
+82 81 79 76 75 71 66
+45 43 42 40 33 30 28 25
+92 91 85 84 85
+30 29 24 21 18 15 14 14
+31 28 27 26 21 18 14
+38 35 34 33 31 28 22 17
+46 47 45 43 41
+89 90 88 86 84 83 84
+68 71 69 68 66 66
+71 73 72 69 65
+44 46 43 41 38 32
+8 11 9 12 11 10
+49 51 49 48 50 52
+75 76 79 76 76
+67 70 71 70 66
+51 53 54 53 50 48 47 42
+67 69 66 65 65 62
+57 59 59 58 55 53 54
+66 67 66 66 63 63
+49 50 49 46 46 43 40 36
+50 52 52 50 49 47 40
+22 23 20 16 13 11 10 8
+29 31 30 26 23 26
+46 47 43 42 42
+65 68 67 64 63 59 55
+68 69 67 64 60 58 53
+87 90 87 82 80 79 78 77
+43 44 43 41 34 37
+13 14 13 11 10 4 4
+77 78 76 74 69 67 63
+69 71 69 63 61 54
+32 32 29 26 25 22 20 19
+99 99 98 97 96 98
+91 91 89 88 86 86
+26 26 23 21 17
+45 45 43 42 40 37 36 30
+41 41 39 42 39 37
+7 7 6 8 7 4 2 4
+30 30 33 32 31 29 27 27
+58 58 55 53 50 53 49
+31 31 28 31 25
+35 35 35 32 30
+46 46 46 43 44
+38 38 38 37 37
+77 77 74 71 71 69 65
+70 70 68 65 65 62 60 54
+60 60 58 54 51 48 45 43
+32 32 28 27 26 23 21 24
+43 43 41 40 36 36
+72 72 70 66 62
+25 25 23 19 13
+68 68 67 65 62 61 56 54
+74 74 71 69 67 60 59 61
+40 40 37 32 32
+73 73 66 64 61 57
+47 47 41 40 35
+84 80 77 75 73 70 68
+93 89 88 86 85 82 80 81
+35 31 30 28 27 26 25 25
+28 24 22 21 18 17 13
+34 30 28 27 25 22 20 15
+17 13 10 7 10 7
+95 91 94 92 90 92
+20 16 13 12 13 11 9 9
+58 54 53 52 54 52 48
+86 82 83 82 77
+28 24 21 21 20
+97 93 93 91 92
+28 24 23 20 18 18 18
+38 34 32 32 30 28 27 23
+53 49 47 46 45 44 44 39
+69 65 62 61 57 56 53
+48 44 42 40 39 35 38
+73 69 67 63 63
+59 55 53 51 47 44 41 37
+83 79 76 73 71 68 64 57
+23 19 17 16 14 9 8
+51 47 45 38 41
+77 73 70 68 63 61 60 60
+26 22 21 20 18 17 11 7
+31 27 26 21 14
+34 27 25 22 19
+78 71 70 67 70
+62 56 53 50 48 46 46
+18 12 11 9 5
+79 74 72 69 67 66 65 58
+10 5 6 3 1
+69 63 65 63 60 62
+60 54 51 49 52 50 50
+28 23 25 24 21 17
+58 51 52 50 49 46 41
+49 44 44 41 39 36
+47 40 38 38 37 36 35 38
+48 43 41 40 37 37 37
+87 82 80 77 77 73
+24 18 18 16 15 14 9
+83 77 73 71 68 67 66 64
+58 53 49 47 48
+50 45 44 40 38 38
+34 29 28 24 22 21 20 16
+48 42 41 39 35 29
+94 89 83 82 80 78
+65 58 51 49 46 48
+51 46 43 40 33 32 29 29
+53 48 45 43 37 33
+85 80 79 74 71 70 63
+9 11 13 14 15 18 19 17
+88 91 93 95 96 96
+2 4 6 7 9 13
+59 60 63 66 68 69 74
+16 17 16 19 20 22
+20 22 19 21 18
+11 12 14 15 13 16 16
+24 25 26 23 27
+83 84 85 84 87 88 94
+41 42 45 45 48 50 51
+38 41 42 45 45 48 50 48
+73 75 75 78 78
+68 69 70 70 73 76 79 83
+58 61 64 64 65 66 73
+32 33 34 36 40 41 43
+35 36 37 41 42 44 43
+79 81 82 83 87 89 92 92
+54 55 57 58 62 66
+33 35 36 40 42 49
+15 17 22 23 26
+18 20 27 29 31 33 32
+79 81 83 84 90 91 91
+32 33 35 41 45
+75 77 80 83 89 91 98
+14 12 14 15 16 17
+89 86 89 92 93 94 95 92
+56 55 58 61 61
+41 40 42 43 45 48 50 54
+56 54 56 58 65
+61 59 56 58 61
+59 57 60 61 60 57
+24 23 25 27 24 25 27 27
+90 87 88 86 88 92
+11 8 6 9 10 11 18
+74 73 73 75 78 80
+88 85 88 88 86
+92 91 92 92 94 94
+5 2 2 4 8
+42 41 43 46 48 48 54
+62 60 62 63 65 69 70 72
+91 88 92 95 94
+48 47 51 52 54 54
+20 18 19 20 21 25 27 31
+80 77 80 84 90
+56 53 56 57 60 67 70
+8 5 10 13 16 15
+39 38 40 43 50 52 52
+54 51 54 61 64 67 71
+58 55 61 62 64 67 70 76
+67 67 69 72 73 76 79 82
+11 11 14 15 18 20 19
+63 63 66 68 70 72 72
+26 26 28 31 33 36 40
+67 67 68 70 73 76 78 83
+8 8 11 13 15 12 13 16
+13 13 10 13 16 17 20 18
+49 49 48 51 53 55 55
+37 37 39 38 42
+85 85 87 84 91
+21 21 23 23 25
+56 56 59 60 60 63 61
+37 37 39 42 45 45 45
+49 49 51 54 57 58 58 62
+31 31 31 32 34 36 42
+67 67 68 70 73 76 80 81
+9 9 12 13 16 20 18
+73 73 76 78 80 81 85 85
+60 60 61 65 68 71 75
+7 7 11 12 19
+44 44 45 46 47 53 55
+16 16 21 22 25 28 27
+9 9 10 15 18 21 24 24
+83 83 84 87 89 94 98
+24 24 27 29 36 37 43
+81 85 86 88 91 94 95 97
+41 45 46 49 51 50
+31 35 36 37 38 39 39
+56 60 61 62 65 69
+74 78 79 81 82 88
+12 16 17 14 15 18
+58 62 63 65 63 65 63
+39 43 42 45 48 49 49
+57 61 59 61 63 64 66 70
+1 5 6 5 7 9 14
+70 74 77 77 78 81 84 85
+25 29 31 31 33 34 36 35
+57 61 61 63 63
+76 80 82 82 86
+28 32 34 35 35 37 44
+52 56 60 63 64
+10 14 16 18 22 25 28 26
+62 66 67 70 73 77 79 79
+42 46 50 53 54 55 56 60
+10 14 18 21 23 30
+72 76 77 82 83
+29 33 36 37 40 43 49 47
+79 83 85 90 90
+63 67 68 70 71 72 78 82
+20 24 27 29 32 39 44
+56 61 62 65 67
+58 65 66 69 70 72 71
+29 36 39 41 41
+70 77 80 83 84 88
+39 45 46 49 55
+45 52 55 54 57 59 62 63
+14 19 20 22 19 21 24 23
+11 18 21 22 24 22 22
+49 54 57 59 62 65 63 67
+37 42 39 40 41 48
+14 19 22 23 26 26 29
+87 94 95 96 96 93
+51 58 61 62 64 64 64
+57 64 65 66 68 68 69 73
+31 36 38 38 39 46
+16 23 25 28 31 34 38 39
+46 53 56 59 63 62
+46 51 53 56 58 59 63 63
+39 46 50 51 54 58
+63 70 71 75 82
+71 77 78 79 86 88
+75 81 83 89 91 92 91
+57 64 65 67 70 72 79 79
+4 10 13 20 21 23 24 28
+7 12 15 20 25
+74 72 71 69 68 65 68
+79 77 74 73 73
+60 59 57 56 52
+32 31 28 25 18
+35 32 33 31 28
+30 29 31 29 26 25 22 23
+10 9 8 7 5 7 7
+68 67 66 64 65 61
+68 66 64 66 63 62 56
+74 73 73 71 69 67 66 64
+92 91 88 88 90
+48 47 44 44 43 43
+45 42 40 40 39 35
+51 48 48 45 42 39 32
+93 90 89 85 82
+83 81 78 74 73 75
+82 79 75 72 69 68 68
+76 75 73 72 70 67 63 59
+95 93 89 88 81
+70 69 68 61 58 56 53
+99 98 97 90 92
+33 30 23 20 18 15 15
+82 79 76 71 69 68 65 61
+28 25 23 16 14 12 10 4
+14 15 13 12 9 8 5
+67 68 67 64 63 61 59 61
+84 86 85 83 83
+43 46 45 43 39
+45 46 44 41 40 34
+45 48 46 43 41 44 43 42
+19 21 20 22 24
+68 69 68 69 66 66
+33 34 32 35 31
+88 91 90 92 90 85
+30 31 30 27 26 26 24 22
+35 38 36 36 38
+7 9 9 7 7
+39 41 38 38 34
+30 31 28 28 22
+43 46 42 41 38 36 33
+74 75 73 69 72
+20 23 20 17 15 11 11
+56 57 54 50 47 46 44 40
+20 21 18 16 12 10 4
+44 45 43 37 34
+47 48 46 45 43 42 36 38
+51 52 50 44 41 41
+37 40 35 34 32 28
+94 97 94 91 90 87 82 77
+88 88 85 82 80 77 74
+87 87 84 81 80 83
+67 67 65 64 64
+68 68 65 62 58
+32 32 29 26 23 18
+64 64 65 64 63 61
+66 66 67 65 68
+79 79 76 77 74 73 73
+68 68 69 67 65 64 63 59
+75 75 72 75 74 72 65
+73 73 71 70 70 69
+96 96 94 92 92 89 91
+43 43 41 41 40 40
+95 95 94 94 91 89 85
+69 69 66 66 59
+55 55 54 52 48 46 44
+28 28 26 25 23 19 18 21
+27 27 25 24 20 20
+17 17 13 10 6
+86 86 85 81 76
+53 53 52 49 44 43 41
+91 91 90 85 84 81 84
+96 96 90 87 84 81 78 78
+76 76 74 71 70 63 59
+46 46 44 41 40 34 27
+52 48 46 43 42 41
+58 54 52 49 50
+76 72 70 68 65 65
+23 19 18 15 13 11 10 6
+26 22 19 16 11
+46 42 40 37 40 38 35
+19 15 14 13 10 11 8 10
+91 87 85 83 81 78 81 81
+77 73 75 74 72 69 68 64
+39 35 32 35 32 27
+94 90 89 86 86 84 82
+99 95 94 92 92 94
+53 49 48 48 48
+86 82 80 80 78 75 71
+42 38 38 36 29
+31 27 25 21 18 17
+84 80 76 73 74
+86 82 81 79 75 75
+46 42 38 36 32
+69 65 64 60 53
+82 78 75 69 66 65 63
+93 89 86 81 82
+91 87 86 84 77 77
+31 27 25 23 22 15 11
+95 91 88 81 78 77 72
+40 34 32 29 28 25
+79 72 69 68 65 62 59 60
+80 73 72 71 69 66 66
+95 88 85 84 82 78
+31 25 24 23 21 15
+34 29 30 27 24 21 20 19
+72 65 63 62 59 60 61
+14 8 9 7 5 5
+75 69 72 70 67 64 63 59
+72 66 63 64 62 59 53
+26 20 19 17 17 14
+89 84 84 82 79 78 75 78
+65 59 57 57 55 52 49 49
+17 10 9 8 8 4
+52 45 44 44 41 39 32
+16 11 8 4 2
+49 43 39 38 36 33 36
+77 70 69 68 64 64
+68 61 58 55 51 48 44
+41 34 30 28 27 20
+35 28 27 24 17 15
+43 38 35 32 30 29 22 24
+68 61 58 53 53
+23 16 11 8 4
+53 47 45 44 37 34 28
+75 71 68 68 65 64 58
+62 66 67 70 67 69 69
+26 30 31 34 37 44 46 46
+77 79 77 80 79 77 80
+28 33 34 35 37 41 43
+74 76 80 82 83 86 89 96
+39 35 37 36 31
+34 36 34 32 28
+56 54 53 48 45 41
+68 70 69 67 65 63 62
+41 44 45 48 52 53 56 53
+84 84 77 75 72 72
+84 86 83 85 88 87
+66 66 71 72 73 75 81
+76 76 77 79 80 82 88 89
+30 26 23 20 19 15 10
+42 38 36 34 33 33 35
+34 32 30 28 23 20 18 11
+35 38 37 35 35 33
+72 68 67 66 64 67 65 62
+74 70 66 64 61 61
+30 33 35 37 41
+38 42 45 47 50 56
+62 65 67 65 65
+30 31 33 37 38
+41 34 30 28 27 25 24 25
+71 73 75 74 79
+74 73 70 64 62 62
+81 85 86 88 88 88
+87 83 84 81 79 75
+56 58 56 53 50 48 46 41
+54 48 44 42 42
+40 42 40 39 38 32 30 30
+52 55 57 60 61 64 66 66
+68 67 70 73 74 77 82 81
+70 71 76 78 82
+54 57 59 63 67
+78 84 85 85 86 90
+12 19 20 21 22 20 23 23
+80 80 79 80 76
+84 79 79 78 78
+7 8 11 14 16 18 19 25
+12 12 11 9 11 5
+11 15 19 20 18
+82 83 86 88 88 90 91
+18 15 12 12 11 9 11
+24 31 32 35 39 43
+6 4 6 5 6 12
+64 68 73 75 78 80 81 85
+43 47 48 46 47 54
+7 10 11 13 17 20 20
+52 46 45 44 43 42
+41 43 43 40 40
+79 81 78 74 71 70 66
+63 62 64 67 70 71 71
+13 17 20 26 28
+18 15 13 16 19 22 23 20
+81 77 71 68 67
+28 22 18 15 12 9 8
+30 30 32 35 36
+40 40 41 43 44 47 47
+96 96 97 97 95
+55 55 59 60 63 67
+44 51 51 53 60
+23 30 31 32 35 36 36
+54 54 56 59 61 67 68 68
+76 76 79 80 81 84 84 91
+33 26 23 22 22 21 22
+88 88 88 86 79
+35 39 42 44 48 54
+87 87 88 90 88 89 89
+17 11 8 11 8 9
+32 36 37 40 41
+72 73 72 70 67 65 66 64
+49 55 57 55 57 60 61 64
+20 20 19 20 17
+37 36 39 38 37 34
+28 30 27 26 25 23 18 20
+17 16 14 10 6
+87 83 78 75 74 71 70 72
+1 5 9 12 14 14
+30 29 30 29 25
+41 41 44 44 46
+81 79 77 76 73
+32 29 27 24 21 18 17
+33 36 39 41 43
+59 60 61 62 63 64 67 70
+16 17 20 22 23
+54 57 58 60 61 63 64 65
+13 12 11 9 7 6 4
+39 42 43 46 48 49
+73 74 75 76 79 80 83 85
+45 48 51 52 54 57 58
+31 28 25 24 23
+63 60 57 56 55 52
+26 27 28 30 32 35
+29 32 34 35 36 38
+28 29 30 33 35 36 37
+35 36 37 40 42 44 47
+87 85 82 79 77 76
+16 14 12 10 8 6 5 3
+74 71 68 65 63
+22 21 19 18 17
+51 48 45 42 41 38 35 32
+59 58 56 54 52
+36 35 34 32 31 30
+75 78 79 81 83 84
+80 82 85 88 91 93 94
+29 31 32 35 38 41
+83 84 87 89 90 91
+16 19 21 24 27 29
+35 36 39 41 43
+22 25 26 29 32 33
+34 31 28 25 22 20 18
+50 47 44 41 39 37 35 32
+41 39 36 34 32 31
+34 32 31 28 27
+25 23 22 21 20 17
+86 88 90 91 92 94 96
+51 52 55 58 60
+43 41 39 38 36 35 34 33
+36 33 30 29 28
+77 78 79 82 85
+88 85 82 81 79 78 76
+20 22 25 28 30 33 35 37
+16 19 22 25 28 30 32
+98 96 93 91 89 87
+80 77 76 74 72
+5 8 9 12 15 17
+14 13 10 7 5
+37 39 42 45 46 47 48
+1 3 6 8 10 11 14
+18 17 15 14 11 10
+49 48 47 45 43 40 37
+90 89 86 83 80 78
+91 89 86 84 81 79 76
+61 58 55 52 50 49
+77 80 82 83 86 88 89 91
+41 42 43 44 45
+53 51 50 49 47 44 41 38
+92 93 96 97 98
+51 52 53 56 58
+70 69 67 65 62
+21 23 24 25 26 28 31 32
+37 39 42 44 47 49 51 52
+29 31 33 34 35 36 37 38
+26 24 21 18 16 15 12 9
+75 72 71 68 66 63 62
+66 67 70 72 74
+78 77 74 72 71 70
+12 13 15 18 20 21 24 27
+65 64 63 61 60 57
+26 24 23 20 17 15 12
+17 19 22 25 27 30
+88 85 84 81 78 76 75 73
+85 84 81 78 75 72 69 67
+21 19 18 17 14
+62 59 58 55 53 51 50
+93 91 89 86 84 81
+79 82 85 88 89 91
+87 89 91 92 94 97
+98 97 95 94 93 91 88 85
+35 38 41 42 43 44 47
+65 62 61 58 56 55 52
+30 27 26 23 20 17 14
+55 54 53 50 48 47
+80 78 77 75 73 71
+48 51 54 56 57
+40 38 36 35 33
+70 73 76 79 81 84 86 88
+47 45 44 41 40 38 37 34
+35 34 32 29 27
+44 47 50 53 56
+7 9 10 12 13 14
+58 59 62 65 66 67 68
+19 18 16 14 12 10 7
+86 85 83 81 80 78
+56 57 60 63 64 67 68 69
+99 96 93 90 89
+37 36 34 32 31 29
+59 56 53 51 50 48
+73 72 71 70 69 66 65
+53 52 51 50 48 47
+76 75 72 71 68 67 66
+49 52 55 58 60 62
+80 78 75 72 71 68 67
+41 39 37 35 32 29 26 25
+66 67 70 72 73
+54 53 51 49 47 44 43 41
+93 96 97 98 99
+75 76 78 80 81 82 83
+45 43 40 39 37 34
+4 6 8 11 12
+46 43 41 39 36 34 31
+61 58 55 54 52 50 47 45
+16 14 11 8 6
+75 76 79 81 82 83
+47 45 43 41 38 37 34 31
+90 89 88 85 84 82 80
+49 47 44 43 41 39 36
+15 13 12 11 10 7 5 2
+99 97 95 94 93
+9 10 12 15 18 21 23
+8 11 13 14 15 16
+27 30 32 35 36 37 39 40
+56 59 62 64 67 69
+60 63 64 66 67 70 72
+48 50 51 53 54
+51 48 45 44 42 41 39 36
+58 60 63 64 66 67 68 71
+74 72 71 70 67
+89 86 84 83 81 78 76 75
+74 76 79 80 83 85 87 89
+95 94 93 90 88 85
+24 27 28 30 31 33
+62 63 66 67 69 71
+68 70 72 74 77
+23 22 19 16 15
+3 5 7 8 10 11 14 17
+82 85 86 88 89 90
+12 10 7 6 3 2
+41 42 43 44 47 50
+16 19 22 23 24 27
+55 52 49 47 44
+83 82 80 79 78 75 72
+81 80 79 77 76 75 72
+41 39 38 36 35 34
+21 24 27 28 29 32 33 34
+79 78 75 72 71 70 67 66
+62 59 56 55 54 51
+85 86 88 91 92 94 97 99
+69 67 65 64 61 59
+54 55 58 61 64
+75 77 80 82 83 86 88
+10 11 12 13 14 15 17 19
+69 72 74 76 78 80 81
+93 92 89 87 84 82
+44 41 38 37 35 34 33
+99 98 95 92 91 88 87 84
+40 37 35 33 30 27 24 23
+4 7 10 12 14 17
+74 77 80 82 84
+33 34 37 38 40 42 43 46
+29 27 26 23 22 19
+57 59 62 64 66
+17 14 11 10 7 6 3 2
+79 76 73 70 69 68
+51 48 46 44 42 40 38
+40 41 43 45 46 47 49
+14 11 9 8 6 3
+16 15 12 9 8 5 4
+68 67 66 64 63 60 58 56
+32 31 30 29 28
+36 39 40 42 45 46
+27 29 32 35 36 37 39
+89 88 87 85 84 81 78 77
+42 40 38 35 33 32 29 27
+50 47 46 45 42
+68 69 71 74 76 77
+23 25 27 28 30 32 33 35
+7 9 12 14 16 17 20 21
+77 74 72 71 70 69 67 66
+11 9 7 6 5 3
+23 22 20 18 17 15 14 12
+84 85 88 90 91
+50 51 54 57 60 63 64
+66 68 70 73 74 75
+77 78 81 82 85
+38 41 42 44 47 50 51 52
+89 90 91 93 94 97
+36 39 41 43 44
+19 22 23 26 27 30
+29 27 24 22 20
+27 25 22 19 18
+31 34 35 36 37 40 41 44
+91 92 93 95 98
+67 70 73 74 76
+17 18 19 22 25 27 29
+35 33 30 29 26 24 22 21
+13 11 10 7 5 4 3
+78 76 75 73 72 70 68 66
+86 87 88 90 91
+22 21 18 17 14 12 10
+67 68 71 74 77 80
+50 53 56 57 59 62 65
+70 71 72 73 74 77 80
+53 55 56 58 59 60 63
+44 42 40 39 37 35
+39 38 36 33 30 28 26
+50 48 47 45 44 41
+51 48 46 45 44 42 39
+87 85 82 79 78 77 76
+76 75 74 73 71 68
+67 69 72 73 76 79 80 81
+68 65 63 61 60
+70 68 66 65 63 60
+49 50 53 56 59 62
+37 40 41 43 44 47 50 52
+66 65 63 61 58 55
+41 38 35 34 32 31
+33 32 31 28 25 23
+42 41 39 38 36 35 32 30
+51 48 47 45 43 42
+49 47 45 42 39 38 36
+86 83 80 79 76 73 72 71
+52 53 56 58 61 62 63
+54 57 59 61 62
+2 4 6 7 10
+7 10 11 12 13 14 16 19
+67 69 71 72 73 74
+36 37 38 41 43 46 49 50
+72 75 76 79 80 81
+12 11 10 7 6
+26 28 29 31 34 36
+66 63 62 61 58
+46 43 41 39 36 34 33 31
+37 39 41 44 47 50 51 53
+22 19 18 16 13
+20 22 25 26 27
+68 65 64 62 60
+9 10 13 16 18 20 21
+51 53 56 59 62
+19 20 23 24 26 27 29
+25 22 20 18 16
+50 52 54 56 58 61 62
+27 25 22 21 20 19 16 15
+47 48 51 52 55 56 58
+18 20 21 22 24 26 27 30
+76 77 80 81 82 83 85
+31 33 36 39 40
+23 25 28 31 34 37 38 39
+70 69 68 66 64 62 60
+43 42 41 38 35
+9 10 12 14 16 19 20 22
+65 62 59 58 56 53 50 48
+12 15 18 20 22 23 26 29
+32 35 37 40 41 44 46 47
+60 57 54 53 52 49
+25 28 29 30 31
+91 90 89 87 85 84
+1 4 7 9 10 12
+24 25 26 29 32 33
+39 41 44 45 47 49 50
+37 34 33 31 28 26 24
+54 57 59 61 62 63
+92 89 86 84 81 79 78
+42 45 47 50 52 55
+24 27 28 29 32 34 35
+8 5 4 3 1
+13 15 18 19 22 25 28
+61 59 58 56 53 50
+7 9 12 15 16 18
+13 15 16 19 21
+82 81 78 75 74
+6 8 10 13 16
+33 31 29 28 25 24 23 20
+12 10 9 7 4
+1 3 5 8 11 14 17 19
+31 28 26 24 21
+22 23 25 27 28 31 33
+24 22 20 18 16
+63 66 67 68 71
+51 48 45 44 43
+81 83 84 87 88 89 92 93
+85 82 80 77 75 73
+82 80 77 74 71 68 65 64
+57 58 61 64 65 66
+55 54 51 48 47 44
+7 10 13 14 17 19
+70 68 66 65 64
+57 59 62 65 66 69
+23 21 20 17 16 14 13
+58 57 56 53 52 49 46
+30 31 33 35 38 41 43
+35 36 38 41 43
+45 47 50 53 54 55
+46 49 52 54 55 56 59 62
+56 57 60 61 64 67 68
+28 30 32 34 36 37 39 42
+19 17 16 13 11 9
+9 10 11 13 16 19
+65 63 61 59 58 57 55
+85 82 80 79 76 73 72
+37 35 34 31 30
+67 66 65 62 60 59 56
+51 54 56 58 60 62
+60 57 56 54 52 49
+85 82 81 78 77
+90 89 88 85 83 82 79 78
+41 38 36 33 32
+94 92 90 88 87 86 83 80
+89 87 85 83 81 80 77
+66 67 70 71 73 74 75
+66 65 63 62 61
+75 73 71 69 67 66
+36 34 33 31 30 29 27
+71 69 66 65 62 59 57
+27 25 23 22 19 18 15 13
+55 54 53 51 48
+23 21 18 15 13 11 8 7
+63 66 69 70 72 75 76
+46 44 42 40 37 34 33
+39 38 35 34 33 30 29 28
+10 13 15 18 19 20 21 23
+20 19 18 15 13 10
+65 67 70 71 73 75 78
+60 61 64 65 66 67 70 73
+68 67 64 62 60
+64 63 60 57 55 52
+84 85 88 90 93 96 98 99
+84 87 90 93 96 97 99
+81 83 86 89 91 92 93 94
+42 45 47 48 51 54
+72 74 77 79 81 83 84 86
+54 53 50 49 46 43
+55 57 58 60 62 64 66 68
+20 21 22 23 25 26 27
+53 54 56 58 59 60 61
+67 68 70 72 73 76
+20 17 15 12 10 8
+71 68 65 62 61 60 59 57
+78 76 75 73 72
+25 23 22 19 18 17 15 13
+30 29 27 26 25 23 20 18
+23 24 25 28 29 31 34
+40 43 45 47 49
+44 46 48 51 52 53
+38 36 33 31 28
+28 29 32 34 37 38 40 41
+44 45 46 48 49
+99 96 93 91 89 87 84 82
+49 48 47 45 43
+79 81 84 85 87 89 92
+28 29 32 35 38 39 41 42
+26 23 22 19 16 14 13
+30 27 24 23 20 19
+76 74 71 69 67 64
+99 96 95 94 93 90 88
+69 68 67 64 63 62 60
+88 91 93 95 97
+86 87 90 91 92 95 96
+33 34 36 37 39 40
+65 63 62 59 58
+29 28 26 24 21 19 17
+87 84 81 80 78 77 74 72
+89 87 84 81 78
+76 79 81 84 86 87 88
+48 50 53 54 55
+38 41 42 43 45
+93 90 88 86 84 81 80 77
+87 85 83 80 78
+75 73 71 70 69
+23 21 20 18 15 12 9 6
+89 87 84 81 79
+80 83 85 86 88 91 94
+62 65 66 69 70 71
+28 26 23 21 19
+94 93 90 87 86 83
+19 17 15 13 11 10 8 6
+63 65 67 68 71
+2 3 6 7 10 11
+37 39 42 44 45
+52 54 56 57 60
+54 51 50 49 47
+55 54 53 52 50 47
+78 80 82 85 86
+76 74 73 71 68
+78 79 82 84 85 87 90 93
+52 51 50 49 48
+25 28 30 32 35 36 38
+59 56 55 52 49 46 45 42
+18 19 22 23 25 28 30
+57 56 55 52 51 48 45
+55 53 51 50 47 44
+34 33 32 31 28 25 23
+75 72 71 69 68 67 65 64
+4 7 10 12 13 15 16
+61 59 57 55 54 53 52 49
+72 71 69 68 67 65 62 59
+32 33 34 35 36 37
+21 19 16 15 13 12 10
+56 55 52 50 47 44 43
+66 68 70 73 76 79 82
+12 11 8 5 3 2
+87 89 91 94 96
+81 78 77 74 73 70 69
+75 78 81 82 84 85 87 89
+36 35 34 31 29 27 25 22
+39 38 36 34 31 28 25
+64 65 67 70 72
+82 85 87 88 90 92 94 95
+46 45 43 41 40 38 36 35
+45 47 48 50 53 55
+52 51 50 48 47 46
+59 56 54 52 50 48 46 43
+6 9 12 13 15 18 20 22
+18 16 15 12 9
+14 11 9 6 3 2
+64 62 59 57 55 54
+50 47 45 44 43
+62 64 65 67 70 71 72
+66 67 70 73 74 76 78 80
+61 63 66 68 70
+28 27 24 22 19
\ No newline at end of file
diff --git a/src/resources/day02tj.txt b/src/resources/day02tj.txt
new file mode 100644
index 0000000..6cf52dd
--- /dev/null
+++ b/src/resources/day02tj.txt
@@ -0,0 +1,1000 @@
+92 94 97 98 97
+26 27 28 31 33 34 37 37
+56 59 60 61 62 65 69
+42 44 46 48 55
+15 18 19 22 21 24 26
+74 76 77 76 77 78 75
+60 62 64 65 64 64
+61 64 67 64 67 68 72
+71 74 73 76 82
+25 26 27 29 29 32
+27 28 30 30 32 35 34
+6 7 7 9 9
+33 34 34 35 39
+17 19 20 23 23 25 26 32
+29 30 31 35 37 38 39 41
+22 25 29 32 33 34 37 34
+15 18 20 24 26 27 30 30
+44 45 48 52 54 55 58 62
+35 37 38 39 42 46 49 55
+71 74 77 84 86 89 91
+23 25 27 32 29
+14 15 16 18 25 25
+10 11 14 19 21 24 28
+40 41 46 47 49 55
+12 10 11 13 15 18 20
+50 48 49 51 53 55 56 55
+18 16 18 21 24 27 28 28
+51 48 51 54 58
+81 78 80 82 87
+35 34 31 32 35
+60 57 59 60 62 61 60
+29 26 24 25 28 28
+28 27 26 28 31 35
+80 78 77 80 83 88
+87 85 85 88 90
+91 89 89 91 92 89
+87 86 88 90 93 93 93
+32 29 31 34 37 39 39 43
+8 5 5 8 9 15
+85 83 85 88 92 93 95
+34 33 37 39 40 41 42 40
+26 25 27 28 30 32 36 36
+18 16 19 23 25 28 32
+13 12 16 18 20 26
+18 17 18 19 21 27 28
+15 12 18 19 18
+57 55 60 62 62
+68 65 67 68 75 77 78 82
+70 67 74 77 78 81 84 90
+48 48 50 53 55 57
+11 11 12 15 17 18 20 19
+20 20 23 25 28 30 30
+12 12 13 16 18 20 21 25
+41 41 44 47 49 51 54 61
+5 5 7 5 6 7
+82 82 81 84 87 85
+10 10 11 8 8
+6 6 9 7 9 12 16
+32 32 30 32 35 40
+25 25 25 28 31
+31 31 32 32 33 36 38 35
+18 18 19 19 21 23 26 26
+7 7 9 12 12 14 18
+24 24 24 26 27 32
+74 74 77 78 82 84
+26 26 30 32 30
+52 52 54 57 60 64 64
+57 57 60 64 65 69
+30 30 31 35 38 45
+52 52 55 56 58 65 68
+12 12 17 19 21 19
+49 49 52 53 59 61 61
+6 6 8 15 19
+65 65 66 72 79
+47 51 54 55 57 59 62 63
+63 67 68 69 71 73 74 72
+67 71 72 74 77 80 81 81
+6 10 12 15 16 18 22
+55 59 62 63 68
+20 24 26 28 25 27 30 33
+57 61 63 62 64 65 63
+41 45 44 46 46
+26 30 32 30 32 36
+62 66 68 65 68 74
+76 80 80 83 84 85
+83 87 89 89 88
+60 64 64 66 67 70 71 71
+1 5 7 7 8 12
+28 32 32 34 35 38 44
+1 5 8 10 14 17
+56 60 63 65 69 66
+53 57 61 62 63 66 66
+63 67 70 74 78
+85 89 90 94 99
+21 25 26 31 33 35
+8 12 13 20 18
+40 44 47 53 56 56
+72 76 81 84 87 91
+45 49 51 54 59 60 65
+27 33 34 36 37 38
+33 40 41 44 42
+20 25 28 30 33 33
+35 40 42 44 47 51
+49 55 56 57 58 65
+46 52 53 54 53 56
+27 32 34 35 33 32
+71 77 75 77 77
+40 45 42 45 47 51
+50 55 58 59 58 64
+44 49 49 50 52 53 56
+75 82 82 83 85 84
+83 90 92 92 92
+59 64 66 69 71 71 75
+14 20 22 23 26 27 27 33
+57 62 64 65 67 71 73
+15 20 24 27 25
+11 17 19 23 26 26
+22 29 30 33 37 38 40 44
+76 83 86 87 91 94 99
+32 38 39 45 47
+60 65 68 70 77 78 75
+75 81 82 83 88 91 94 94
+3 8 11 18 20 24
+10 16 22 25 26 27 34
+5 4 3 2 1 2
+65 63 60 59 59
+96 95 93 92 89 87 85 81
+67 66 65 62 60 57 56 49
+29 26 29 26 24
+77 76 74 75 74 72 69 70
+13 12 10 13 11 10 10
+64 61 60 57 59 56 52
+59 57 55 54 57 52
+50 48 48 46 44
+46 44 44 41 38 35 36
+56 53 53 50 48 46 46
+59 58 58 57 55 51
+38 35 34 31 28 25 25 19
+75 73 69 66 64 63 61
+42 39 36 34 30 32
+34 31 27 24 24
+52 49 45 42 39 37 33
+26 25 24 21 20 16 9
+96 94 89 88 86
+19 17 10 9 8 10
+52 51 50 49 46 39 39
+44 41 38 37 34 29 25
+24 22 20 19 13 10 8 3
+56 59 58 55 53 51 49 48
+51 53 52 50 49 47 44 46
+45 46 44 42 41 41
+21 23 21 19 16 12
+81 83 82 80 77 70
+44 47 48 47 46 43
+29 32 31 32 29 27 25 27
+23 26 23 26 23 23
+63 66 65 66 64 61 59 55
+55 56 53 52 55 52 49 44
+61 64 61 61 60 59 58 56
+21 22 20 20 22
+67 68 68 66 65 62 62
+35 38 38 37 36 32
+44 46 46 43 41 39 37 31
+46 47 43 42 41 40
+36 39 35 34 31 28 25 26
+66 69 68 67 65 61 61
+22 23 19 18 16 13 10 6
+91 92 91 87 82
+83 86 81 80 79
+53 54 48 46 43 42 43
+61 62 61 54 51 50 50
+74 76 70 67 65 62 58
+39 41 38 35 28 25 20
+40 40 37 34 33 30 27 26
+18 18 17 16 18
+82 82 80 79 79
+25 25 22 20 16
+22 22 20 18 16 15 8
+50 50 47 50 47 45
+40 40 42 41 38 41
+39 39 42 41 41
+98 98 96 94 95 93 90 86
+62 62 65 64 63 60 55
+94 94 92 92 90 88
+69 69 68 68 70
+42 42 41 39 39 39
+39 39 36 35 33 33 29
+45 45 45 42 41 39 33
+21 21 20 17 15 11 10
+59 59 57 53 51 48 49
+84 84 82 80 76 76
+32 32 28 27 26 23 22 18
+55 55 51 48 46 44 38
+80 80 73 72 69 66 63
+12 12 10 4 7
+35 35 32 31 26 25 25
+27 27 25 23 18 17 13
+64 64 61 54 53 51 44
+43 39 36 33 32 29 28
+79 75 73 72 71 73
+70 66 65 63 60 57 56 56
+51 47 46 44 40
+85 81 79 78 71
+98 94 91 89 90 87 84
+62 58 56 55 52 55 54 56
+20 16 18 15 15
+73 69 72 69 68 67 63
+41 37 34 31 32 31 26
+76 72 70 68 68 65 63
+54 50 49 48 48 47 50
+82 78 76 75 75 74 74
+94 90 88 85 83 83 79
+28 24 21 20 18 18 16 10
+52 48 44 42 39 38
+32 28 26 24 21 17 19
+27 23 21 19 15 13 10 10
+33 29 28 26 22 18
+62 58 54 52 51 48 42
+99 95 92 86 83
+91 87 85 83 77 78
+22 18 13 11 9 7 7
+98 94 89 87 85 82 80 76
+43 39 38 37 34 28 23
+47 40 39 38 35 32
+17 12 10 8 7 4 2 3
+84 77 74 73 70 69 69
+64 57 54 52 48
+90 83 82 80 78 75 72 67
+90 85 87 84 81 78 76
+29 24 22 24 23 21 19 20
+84 79 77 80 78 77 77
+63 57 54 56 52
+38 32 33 31 30 27 25 18
+32 25 25 22 20
+19 13 13 12 10 11
+18 13 12 12 12
+13 8 7 6 6 2
+40 34 31 31 28 23
+81 74 71 67 64 63
+75 70 68 65 63 62 58 60
+60 55 52 48 48
+91 85 83 80 76 73 72 68
+79 74 71 70 67 63 57
+86 81 75 73 72 71 69
+31 25 20 19 21
+75 68 67 65 60 60
+68 62 59 58 51 50 47 43
+71 64 59 57 54 48
+61 64 66 69 70 68
+68 71 72 75 76 76
+4 5 6 9 13
+1 4 7 8 10 11 16
+11 12 13 15 14 16 19
+56 57 59 56 54
+85 86 85 86 88 90 91 91
+40 41 42 39 41 43 45 49
+15 18 21 22 25 23 30
+69 71 71 74 75
+3 6 9 9 7
+83 86 86 87 88 89 89
+90 93 95 95 99
+2 3 5 5 10
+49 52 53 55 59 61 64 65
+58 60 64 65 64
+5 7 8 12 12
+80 82 84 86 88 89 93 97
+37 39 43 45 47 54
+79 81 83 90 91
+41 42 47 48 45
+76 79 84 86 89 90 91 91
+3 6 7 13 15 17 21
+79 80 82 83 88 95
+42 40 41 44 45 47
+55 53 54 57 60 63 61
+29 26 29 30 33 35 37 37
+83 80 82 83 84 88
+47 44 46 49 56
+91 90 88 91 92 95 97
+24 22 23 24 25 27 24 21
+20 19 22 20 23 25 25
+43 40 41 40 43 46 48 52
+27 24 25 27 29 27 29 34
+46 44 45 48 48 49 51
+45 44 47 47 44
+66 64 64 67 68 70 71 71
+94 93 93 95 99
+22 21 21 24 29
+24 23 27 29 32 34 36
+72 70 73 77 78 76
+16 14 17 21 22 22
+39 36 39 40 44 47 48 52
+71 68 72 75 81
+70 69 76 77 78 79 81 84
+11 8 10 15 17 14
+75 74 75 76 78 84 85 85
+28 26 32 33 34 38
+8 7 13 15 16 19 26
+45 45 47 50 51
+77 77 79 82 83 86 88 87
+13 13 15 16 17 20 20
+54 54 55 58 60 64
+34 34 37 40 42 48
+20 20 19 21 23 26 28
+22 22 24 27 25 27 28 26
+38 38 37 38 41 42 42
+24 24 21 24 25 27 31
+4 4 5 3 5 6 13
+35 35 37 37 39 42
+31 31 32 35 38 38 35
+30 30 32 32 35 35
+12 12 15 15 19
+80 80 82 82 84 89
+28 28 30 34 36
+49 49 50 54 53
+35 35 37 38 39 43 44 44
+53 53 56 60 64
+56 56 60 62 63 64 70
+20 20 23 28 29
+57 57 58 61 66 69 71 69
+2 2 4 9 9
+61 61 64 65 68 75 78 82
+46 46 51 53 55 57 63
+30 34 37 39 41 44 46
+39 43 44 45 46 47 48 45
+69 73 75 76 78 81 81
+60 64 67 70 71 75
+84 88 90 91 96
+61 65 63 66 67
+88 92 95 92 95 92
+79 83 85 87 90 89 89
+19 23 26 28 30 33 32 36
+82 86 83 86 89 95
+26 30 32 33 33 36 38
+61 65 67 70 73 74 74 72
+39 43 45 48 51 51 51
+60 64 65 68 70 70 74
+66 70 73 73 75 77 83
+17 21 23 26 30 31 32
+27 31 34 38 39 36
+48 52 53 54 58 58
+3 7 8 12 16
+44 48 51 53 55 59 66
+74 78 85 86 88
+25 29 34 37 34
+23 27 30 36 36
+58 62 64 71 74 78
+50 54 55 58 59 62 67 74
+26 33 35 37 40 43
+71 77 79 80 82 83 84 81
+6 12 14 16 18 21 23 23
+38 43 46 47 48 49 53
+20 27 28 31 36
+49 55 56 55 58
+82 88 90 88 87
+54 60 58 59 59
+34 39 41 39 43
+65 71 72 70 76
+48 54 54 55 56
+36 43 45 48 48 51 54 52
+16 23 25 28 30 30 30
+18 25 25 27 31
+74 80 82 84 84 85 90
+14 19 20 24 25 27 29 32
+38 44 48 51 54 52
+21 27 29 31 35 38 38
+31 38 42 45 46 47 51
+73 78 80 81 85 88 93
+49 56 62 64 66
+20 25 27 30 37 36
+68 75 78 83 83
+37 42 43 44 45 50 54
+32 38 40 45 47 48 49 55
+47 46 45 44 46
+93 92 90 87 85 82 80 80
+32 29 27 26 25 22 19 15
+22 21 18 17 14 12 6
+31 28 25 26 24 22 19 18
+25 23 21 24 21 23
+90 87 85 83 85 85
+18 16 14 16 13 12 10 6
+58 56 55 52 54 53 51 44
+38 36 33 33 32 30 28
+53 52 51 51 50 49 50
+63 61 58 57 56 56 56
+35 34 32 30 28 28 25 21
+69 66 65 65 60
+30 27 26 25 21 18
+88 86 84 83 79 80
+90 87 84 82 81 77 77
+27 24 21 17 13
+34 32 29 25 22 21 20 13
+97 94 93 87 86
+85 83 76 74 77
+77 75 72 70 63 63
+27 24 21 18 11 7
+36 33 30 28 22 19 13
+83 86 85 84 81 79 78
+94 96 95 93 90 87 86 87
+61 62 60 58 57 56 56
+14 17 16 13 11 7
+81 82 79 76 73 70 69 62
+19 21 20 17 15 14 15 13
+29 32 33 31 30 31
+63 65 68 65 65
+60 63 60 57 59 57 56 52
+93 95 93 91 88 90 83
+30 32 32 29 26 23 20
+30 31 31 30 28 27 26 29
+76 78 78 76 76
+18 19 19 17 14 10
+58 60 60 59 54
+50 53 52 48 46 44 43
+94 97 93 91 88 90
+84 87 83 80 79 79
+59 61 58 55 53 49 45
+86 88 87 85 84 82 78 72
+92 94 91 88 87 86 80 77
+48 49 47 44 43 37 38
+68 69 63 60 58 56 55 55
+58 61 60 54 51 47
+84 86 85 80 74
+43 43 41 40 39
+71 71 68 65 66
+21 21 20 18 17 15 12 12
+61 61 59 58 57 53
+86 86 85 84 82 81 80 73
+26 26 23 20 17 20 18
+86 86 83 82 85 82 83
+29 29 28 25 23 24 22 22
+54 54 51 52 51 49 45
+40 40 39 38 36 39 33
+87 87 85 85 84 81
+60 60 60 59 56 57
+11 11 8 6 6 5 3 3
+61 61 60 60 58 57 54 50
+92 92 91 88 85 83 83 77
+38 38 35 31 30
+15 15 11 10 13
+89 89 85 84 81 81
+28 28 27 23 22 20 16
+73 73 71 67 66 61
+51 51 50 48 46 41 40
+90 90 88 82 80 79 77 78
+82 82 77 76 75 74 74
+78 78 76 75 70 66
+66 66 60 57 52
+38 34 33 31 30
+73 69 68 66 69
+56 52 51 50 50
+48 44 41 39 35
+59 55 54 52 51 48 41
+19 15 12 13 12 9
+56 52 54 53 56
+80 76 74 73 75 75
+35 31 30 32 29 28 24
+51 47 48 46 45 44 38
+80 76 76 74 72
+75 71 70 67 67 68
+75 71 70 67 67 67
+48 44 42 39 36 36 34 30
+74 70 68 68 67 60
+32 28 26 25 22 21 17 15
+99 95 91 88 87 89
+38 34 30 28 26 23 23
+25 21 17 14 13 12 8
+58 54 50 49 47 42
+78 74 71 70 68 67 61 60
+23 19 13 11 13
+19 15 10 7 7
+81 77 71 69 65
+87 83 78 77 74 67
+17 10 7 5 3
+28 22 19 18 17 15 17
+62 55 53 52 49 49
+61 54 52 50 49 45
+69 63 62 59 57 55 52 45
+91 84 81 84 81
+49 42 39 36 37 36 39
+14 9 10 9 9
+41 35 33 31 28 29 28 24
+96 91 88 90 88 82
+79 73 73 71 70 68 65 63
+76 69 69 68 67 69
+51 46 43 41 38 37 37 37
+66 59 56 53 53 49
+43 37 36 36 35 33 31 24
+35 30 28 24 21 20 18
+45 40 37 34 30 31
+54 47 44 40 38 38
+91 86 84 80 78 74
+62 55 54 51 47 45 44 38
+48 41 40 35 33 30 27
+89 82 79 77 70 68 67 68
+31 26 24 21 20 18 12 12
+51 45 39 38 37 34 30
+71 66 61 59 58 56 51
+78 79 82 85 88 85
+49 50 52 54 54
+55 56 57 59 63
+35 38 41 44 45 47 49 55
+10 13 12 13 14
+4 5 8 5 8 6
+77 80 81 84 85 83 83
+28 30 27 28 30 34
+20 23 24 27 28 31 29 36
+9 12 12 14 17
+52 53 53 56 55
+31 34 34 37 37
+27 30 31 34 34 35 39
+79 80 81 83 84 86 86 92
+36 37 38 42 43
+7 10 13 17 19 18
+51 52 54 58 60 62 62
+15 18 22 24 27 28 32
+23 24 25 29 30 31 32 38
+61 63 66 68 75 76 77
+43 44 45 47 54 52
+28 30 32 39 41 42 42
+43 46 47 54 55 58 60 64
+15 18 25 27 29 32 37
+88 85 88 89 92 95
+45 43 46 48 45
+45 44 47 49 51 53 56 56
+9 6 7 9 11 12 13 17
+34 32 33 35 36 41
+11 8 10 12 15 18 17 19
+58 57 58 56 54
+24 23 22 25 26 29 30 30
+93 91 94 95 94 98
+68 65 68 66 71
+34 31 31 32 33 35 38 40
+86 83 85 85 87 90 93 91
+38 36 38 41 41 43 45 45
+27 26 26 27 31
+48 45 46 46 52
+7 6 7 11 14 16 17 18
+57 54 56 57 58 59 63 61
+41 40 43 47 47
+26 23 25 27 31 33 37
+48 46 49 51 53 57 64
+64 61 62 68 69 72 75
+85 84 85 91 92 94 91
+80 79 80 86 89 89
+45 42 48 50 53 57
+13 12 15 21 24 26 33
+74 74 77 80 81 83 85
+22 22 25 27 28 30 33 30
+39 39 42 44 47 49 50 50
+87 87 90 92 94 98
+66 66 69 72 75 76 78 85
+88 88 89 86 87
+19 19 17 19 17
+11 11 12 9 11 11
+1 1 3 1 4 5 8 12
+37 37 36 37 43
+34 34 37 37 38 39
+33 33 36 38 38 39 40 37
+79 79 80 80 81 84 87 87
+12 12 14 14 18
+32 32 33 36 36 38 41 46
+78 78 82 84 85 86 89
+21 21 24 26 30 33 35 32
+7 7 10 14 16 19 19
+81 81 84 88 89 91 95
+68 68 69 72 75 79 84
+49 49 56 57 60 62 64
+44 44 46 49 56 58 60 59
+36 36 39 40 42 44 51 51
+63 63 65 67 72 76
+69 69 71 74 81 83 89
+85 89 90 91 92 93
+11 15 18 20 21 18
+22 26 27 29 29
+5 9 11 12 16
+58 62 63 64 65 66 71
+77 81 82 80 82 85 86
+83 87 85 86 84
+6 10 11 8 10 10
+41 45 47 49 51 52 51 55
+54 58 57 58 61 64 65 71
+27 31 31 33 36 38
+76 80 80 83 86 85
+7 11 11 12 12
+31 35 36 37 37 41
+60 64 67 67 73
+28 32 34 37 38 42 45 46
+53 57 60 61 62 65 69 67
+10 14 18 21 21
+83 87 89 93 97
+67 71 73 77 84
+4 8 10 12 15 17 23 26
+70 74 79 81 83 81
+78 82 84 90 90
+63 67 74 75 78 79 83
+10 14 17 23 26 29 30 37
+38 44 47 49 50 51 53 54
+37 44 47 50 51 53 52
+81 86 89 90 91 91
+43 48 50 52 54 58
+10 16 18 20 26
+85 92 91 93 95 97
+25 32 35 34 35 37 36
+38 45 46 47 49 47 47
+20 27 24 25 29
+84 89 90 93 91 98
+57 63 63 65 68
+75 82 84 84 87 89 90 87
+33 38 40 43 43 43
+59 64 64 66 68 71 75
+26 33 33 36 39 41 42 48
+51 57 59 63 65 67
+15 22 25 29 28
+78 83 84 88 90 92 92
+70 76 80 82 85 88 92
+33 39 41 42 46 53
+27 32 39 42 43 45 48
+21 27 33 36 37 36
+42 47 49 55 56 56
+19 26 28 35 36 38 42
+12 17 20 23 26 33 34 41
+56 54 53 52 51 48 47 48
+20 17 16 14 11 9 9
+25 23 20 17 15 13 9
+78 77 75 72 69 62
+37 34 35 33 30 29
+19 17 14 13 12 15 17
+30 27 25 22 20 23 23
+31 28 27 26 28 24
+40 39 40 39 37 36 31
+58 55 54 54 53
+66 64 64 61 58 55 56
+53 51 48 48 45 45
+42 39 39 38 34
+57 54 52 50 50 44
+65 63 59 58 57 55
+42 40 39 35 33 30 28 30
+14 12 10 8 4 4
+16 13 12 8 5 1
+36 34 31 27 26 24 23 18
+94 91 88 81 78
+21 18 13 11 13
+70 68 61 60 58 58
+40 38 35 32 25 21
+76 74 69 67 64 61 60 55
+77 79 76 74 72 70
+48 50 48 45 46
+19 20 18 17 17
+34 35 32 29 28 25 22 18
+60 62 61 58 57 51
+57 59 58 57 58 56
+84 86 88 86 84 83 82 85
+82 85 82 80 77 79 79
+16 19 17 16 15 13 15 11
+57 59 58 56 54 57 55 48
+70 72 72 70 67 66
+65 68 66 66 63 64
+62 63 63 60 58 55 54 54
+10 11 10 10 6
+63 66 64 63 63 58
+33 35 33 29 26 24 23
+61 64 62 58 56 58
+41 42 40 36 36
+93 96 93 90 87 83 79
+54 56 53 49 42
+16 17 11 8 6
+66 69 66 61 62
+30 33 32 31 30 23 20 20
+71 72 70 68 61 60 56
+35 36 31 30 28 23
+79 79 78 77 75 73
+38 38 35 32 30 31
+17 17 16 14 13 13
+85 85 82 80 77 75 71
+53 53 52 50 49 47 45 39
+75 75 73 71 74 72 70 68
+25 25 24 27 25 28
+50 50 47 45 43 42 44 44
+40 40 42 40 36
+86 86 84 82 84 78
+70 70 70 67 66 65
+62 62 60 57 57 56 54 56
+13 13 13 11 10 9 8 8
+32 32 30 28 28 24
+69 69 68 67 67 65 62 56
+54 54 51 47 46
+51 51 49 46 43 39 42
+27 27 26 23 22 18 15 15
+60 60 59 57 54 50 48 44
+26 26 24 20 14
+39 39 36 30 27 25
+94 94 92 85 83 86
+96 96 90 88 86 85 82 82
+77 77 70 68 66 65 61
+60 60 59 58 57 50 45
+59 55 53 50 49
+71 67 64 63 62 64
+93 89 86 84 82 82
+14 10 9 7 3
+34 30 27 25 24 22 19 14
+26 22 24 22 20 17
+98 94 93 90 93 90 93
+46 42 40 42 40 40
+29 25 23 25 24 23 19
+23 19 20 19 13
+12 8 5 4 4 3 2
+26 22 20 20 23
+91 87 84 83 82 82 79 79
+66 62 59 58 55 55 51
+34 30 29 29 28 23
+44 40 37 35 31 29 27
+48 44 41 37 40
+41 37 33 30 29 29
+65 61 59 55 51
+76 72 69 67 65 61 55
+49 45 43 40 34 31 28 26
+87 83 82 77 75 76
+94 90 83 82 81 81
+77 73 66 64 63 61 58 54
+31 27 24 17 11
+61 54 52 51 50 47
+84 79 77 75 72 69 72
+61 56 53 50 47 46 44 44
+69 62 60 59 57 56 54 50
+49 42 41 39 38 35 34 28
+21 16 17 15 14 12
+27 21 18 17 18 16 13 15
+31 26 28 26 26
+29 22 20 19 18 21 19 15
+59 52 50 52 50 47 46 41
+24 18 16 16 13
+19 13 10 10 7 4 7
+84 78 78 75 72 72
+41 35 32 29 29 26 22
+26 20 18 16 16 13 7
+22 16 15 11 10
+26 19 17 16 12 9 10
+85 80 79 75 73 71 71
+74 68 66 62 61 59 57 53
+77 71 70 67 65 61 56
+54 47 44 41 35 34 32
+35 28 26 21 18 20
+79 72 71 66 64 64
+56 49 44 41 37
+87 80 78 77 76 69 63
+10 12 14 16 18 15 15
+3 8 15 18 19 18
+1 3 2 4 9
+21 21 20 22 25 28 31 35
+80 74 72 71 71 69
+36 40 43 48 45
+65 60 59 56 52
+94 89 89 86 79
+9 13 16 16 19 23
+47 42 40 40 42
+39 35 32 31 27 24 25
+99 94 92 90 85 82
+38 43 44 44 44
+59 62 61 60 58 58 57 51
+26 31 34 36 39 42 46 50
+10 11 10 6 3 6
+29 33 36 39 41 39 42 40
+89 88 85 84 82 81 79 75
+60 66 69 66 67
+9 6 7 4 5 7 10 9
+4 5 8 10 13 14 15 18
+86 85 83 81 78 77 75 74
+29 30 32 35 37 40 42 44
+44 42 40 37 36
+82 83 84 86 89 92 95
+68 66 63 60 58 55 53 51
+24 22 19 18 16 13 12 10
+39 38 35 33 30 29 27
+14 11 9 6 5 2
+17 16 14 12 9 7 6
+85 88 89 91 92 94 95
+71 74 75 77 78
+14 16 19 21 23 26 28
+57 59 61 63 65
+54 55 57 58 60 63 64 66
+11 8 7 6 4
+88 87 85 82 79
+14 17 18 20 21 24 26
+39 38 35 32 30 27 24 21
+84 85 87 90 91 93 94 97
+46 47 49 52 55 56
+59 62 64 66 69 72
+39 42 45 46 47 49 52
+81 79 76 73 70 67 64
+75 78 79 82 83 86 89 91
+53 56 59 61 64 67 70 73
+35 32 30 28 27 26 25 22
+3 4 5 7 9 11
+49 48 45 44 41 40 39
+16 18 19 20 21
+21 22 23 24 26 27 28 30
+74 72 69 68 67
+54 51 49 47 44 42 40
+82 80 78 75 72 69 66 63
+66 69 70 73 75
+57 54 51 50 49 47 44
+68 71 72 74 77 79 82 85
+12 14 15 16 17 18
+32 31 29 28 27 25
+72 74 75 78 81
+73 76 78 81 83 85 88 89
+50 47 46 44 42 40 38
+60 58 56 54 53 50 47 45
+84 81 80 79 76 75 74 72
+85 86 89 91 93 96
+37 35 32 30 27 26 23 21
+67 64 61 59 56 53 50
+76 73 71 68 67 66 64
+68 66 64 63 60 58 55 53
+42 44 45 48 51 52 53 56
+21 22 25 26 28 29
+97 94 93 91 88 85
+97 95 92 91 89
+6 9 12 14 16 19
+66 65 63 60 58 56
+22 19 18 16 13 11 9
+64 65 67 68 69 72 74 76
+50 47 44 41 38 36
+22 21 20 17 15 12
+53 54 55 56 58 59 61
+83 86 87 88 89 90
+67 65 64 61 60
+68 65 64 63 61 58
+13 12 11 8 7 6 4 3
+33 32 29 27 24 23 21
+79 77 74 71 68
+57 55 52 51 48
+35 32 29 26 25
+79 82 83 85 86
+49 51 53 54 57 60
+92 90 89 87 84
+49 51 52 53 54 57 58
+3 5 8 10 12
+66 65 63 60 57 55
+6 5 4 2 1
+75 76 77 79 82 83 85
+45 42 39 38 36 33 31
+60 59 57 54 51 48
+94 92 90 89 87
+97 95 93 90 89
+23 26 29 31 32 33
+27 28 30 33 34
+85 87 89 91 94 97 99
+78 79 81 84 86
+87 84 81 80 78
+46 49 52 55 58 60
+82 79 78 77 76 74 71 68
+93 90 89 87 84 82 80 78
+34 31 28 25 22
+97 94 92 91 90 88 87
+99 97 96 93 91
+18 21 24 26 27 30
+79 76 75 74 71 70 69 68
+52 55 56 58 61 64 67
+74 73 71 68 66
+92 90 88 85 82 80 78
+36 34 33 30 29 27
+36 35 34 32 29
+15 17 18 20 22 23 24 26
+11 14 16 18 19 21
+64 61 59 56 53
+78 81 83 86 87 88
+8 10 13 14 15 18 21
+92 89 86 85 82
+65 64 63 62 61 58
+13 12 10 7 4
+71 73 75 77 79
+83 82 81 80 79 77 74
+66 68 70 72 74 77
+88 87 84 83 80
+65 64 61 60 58 56 54 53
+29 32 34 37 38 40 43 45
+75 78 80 81 82
+1 3 5 6 8 11 12 15
+21 18 17 16 13 11
+51 52 53 55 56 59 61 64
+65 67 68 71 73 75 77
+75 76 79 80 81 82 83
+49 50 52 53 55 58 59
+83 84 85 87 90 92 95
+36 35 33 30 29 28 25 24
+8 11 13 16 19 20 23 24
+85 88 90 91 92 95
+21 22 23 26 27 29
+92 89 87 84 83 81 78 76
+92 91 89 86 84 83 82 80
+18 21 22 25 27 29 32 34
+28 26 23 22 20 17 14 12
+73 76 77 80 82 83
+84 82 80 77 76 75 74
+76 75 73 72 70 67 64 63
+54 51 49 46 45
+39 42 44 45 46
+45 47 48 50 53 55
+34 37 40 41 42
+1 4 7 10 12 13 14 15
+69 68 65 63 60
+29 28 27 24 21 19 17
+19 22 23 26 28 30 32
+49 50 52 54 55 57
+17 20 22 23 25 26 28 29
+12 9 8 7 5 4 3 2
+83 85 87 90 93 96 97
+9 11 14 15 16 18 21
+80 83 85 87 89 91
+60 58 56 55 54 53 52
+51 50 48 47 46 44
+39 36 33 31 30
+44 41 38 35 32 29 26
+29 27 26 23 20 19 17
+89 86 85 83 82 80 79 77
+44 46 48 50 52
+74 73 71 70 69 68 66
+78 77 74 72 69 67
+43 42 40 37 36 35 34
+92 93 95 96 99
+23 26 29 32 34 37 38 40
+45 42 40 38 37 36 35
+66 67 68 69 70 71 74
+56 59 62 63 64 66
+61 62 64 67 68
+29 32 34 36 39
+73 70 68 65 63 62
+53 51 50 47 44 43 41
+28 30 33 36 38 39 40
+42 39 36 35 34
+57 56 55 52 51
+12 13 14 16 17 20
+13 11 9 6 4
+49 46 43 42 41 39 38 37
+43 44 47 48 49
+69 68 67 65 62
+72 74 76 78 81 84 87 90
+45 44 41 39 38
+93 90 87 86 85
+60 58 56 53 52 50
+97 95 94 92 90 89
+68 66 65 63 61 58 56
+66 63 60 57 54 53
+3 6 8 10 11 13
+87 88 89 91 92 94 96 97
+94 93 92 89 87 84
+36 37 40 41 44 45 47
+83 81 80 78 76 73
+40 42 43 46 48 50 52 53
+39 36 33 31 30 27 24
+63 65 66 69 71
+13 16 17 19 21 23
+69 68 67 65 63 62 60 58
+83 86 89 91 94 97 98
+79 78 76 74 72
+16 17 19 21 23 24 27
+87 86 85 84 83 80
+21 22 23 26 28 29 31 33
+46 48 51 52 54 57
+81 79 77 76 74
+78 80 82 84 87 89 91 92
+53 54 55 58 60 62 64 67
+75 72 69 66 63 62 61 60
+75 72 69 67 66 65
+15 18 19 20 21 22 25 27
+79 82 84 87 89 90 91
+47 44 43 41 39 38
+76 79 80 83 85 88
+12 9 7 5 2
+41 44 46 49 52 53
+83 85 87 90 93 94
+32 29 27 24 22 19 16 14
+68 67 66 64 61 58 57 56
+49 46 43 42 40 39 37 34
+72 69 66 65 63 62 59
+34 37 38 40 42 44
+45 44 42 41 38 37 36 35
+25 23 21 20 17 14 11
+34 31 29 28 25 22
+61 62 65 67 69 72
+28 30 32 33 36 38 41
+28 30 33 35 36
+6 8 9 12 14 15
+90 92 93 94 96 98
+55 58 60 63 64 67
+17 20 21 23 25 27 30
+82 83 86 89 91 93 94
+83 81 78 75 73 72 70 69
+74 75 77 80 82 84 85
+81 83 86 87 88
+50 48 47 45 43 42 39
+42 45 48 49 50
+80 81 84 86 89 92
+63 65 66 68 71 74
+33 31 29 26 23 21 19 16
+24 27 28 29 32 33
+54 56 58 59 61 64 65 67
+75 77 78 80 82 83 85
+71 74 75 76 78 80 82
+36 38 39 41 44 45
\ No newline at end of file
diff --git a/src/resources/day03.txt b/src/resources/day03.txt
new file mode 100644
index 0000000..76d25dc
--- /dev/null
+++ b/src/resources/day03.txt
@@ -0,0 +1,6 @@
+{!how()'&where()don't()select()@]how()}mul(884,758);-mul(971,475)who()~from()]~mul(358,23)~; +$><+mul(459,784)%,}mul(36,125)}?who()${select()mul(26,486);*@why(34,219)+who()}>*mul(439,790)who()^^what()}]mul(721,171);~>mul(240,453)mul(422,258)~-who(){'how(309,607)mul(437,905)> mul(670,503)?-*mul(979,674)%who()why()/&*:who()mul(412,637)> select()(select()select()'[do()&what()%how()from()<~ $what()mul(600,238);what()*mul(982,137)%~from())+~mul(550,306)@mul(331,66)>:&~ don't()?[mul(123,637)+)when()where(){mul(116,755)>why()mul(500,433))] where()] mul(801,467)~:,(where()^don't()what()(!/%mul(425,706)+ -!<{don't()from()+]',@mul(491,379)why()~:^select()from(286,158)mul(79,608)mul(892,927)&>+mul(681,799)why()> ]:*$how(167,759)%mul(79,235);,-mul(674,156)]why()who()from()from(949,563)' ~where()&mul(332,74)@how()mul(186,755)mul(65,13)-^),mul(334,303)+] ]!>{how()#who()mul(230,17)$how()+mul(673,345)%why(531,581)&+~]><)mul(37,326)$*$mul(119,45)from()mul(276,12)+^ do()?>%{%>why(){]mul(138,385)?~>mul(453,763)?;%mul(162,449)/[mul(629,968)&+@>:@select(){/don't()when();why(104,367) mul(136,744)mul(963,430)?~*what(829,68)}?#&{mul(32,898)~mul(875,563)#&+how()mul(946,225)why()what()^%#when(807,508)%mul(266,130)&%{$where();;--!mul(682,427)~who()$)from(69,589)%mul(103,378)}who()mul(458,652)%when(420,875)@(do()*when()mul(868,688)?mul(160,791)>+@when()>^}'what()from()mul(473,136)?$[;:who(){mul(825,302)where()&!why()/>from()select()what()when()mul(325,635))when()^from()mul(299,8)when()how()]:mul(332,547)?!}%#when()*from():mul(532,358)#[?how()@from()mul(961,542)select()don't() ;>,mul(357,878)@where()from()%/mul(61,265)~who():,{!where() how()^mul(854,862{why()what()%- {&what(671,387)mul(578,695)mul(436,41){{-/{ mul(447,680)when()?@$@#select()^>%mul(317,162)):>what()mul(13,671)where()$mul(309,369)({select()mul(249,325))-#from()~%mul(102,356)),*:;where()(mul(55,153)[-who()^^[>%<+mul(945,918)'[do()mul(115,952)-[from()()?[)mul(647,503)mul(474,649)'[mul(239,709)from()select()?^$^select()what(967,742)(where()mul(143,91)why()^,^{mul(465,739)+select()~who()/mul(244,259)don't())!when()who()mul(278,249)what()mul(276,375)do()mul(45,460){how()$from(),%<)who()don't()why()[how()mul(217,899+'mul(307,28), how(171,736),who(168,147)-;mul(372/'<{}who()mul(510,402)]why()<@!@-from():@mul(229,636){}[do();?)where()+(select()$how()mul(752,67)mul(344,833));)&,mul(601,124)*select()*< where()]mul(375,322)when(),]when(106,699)'$mul(477,697)+]{ how() %mul(626,452)don't()<'$when()mul(410,47)
+mul(273,442)!what()) where()where()!mul(128,601)select();$/from()how()[ ;-mul(37?mul(150,909)}{where()-{mul(260,599)~/< &>mul(104,207)%-;?+>from()select()[-mul(328,706):](?>how()mul(706,921)mul(820,805)&[who();(what()/&(mul&(when()^'[mul(819,464)-+mul(880,740),'(]>mul(366,77)^:mul(211,80)^+([$@mul(363,53)&}why(541,819)'{mul(239,819who()#when()}$'*):?mul(53,216)<~{{:don't()&})why()]&mul(442,772)#why()%~!%*[/+mul(9,796)why()>}@don't()#what()mul(772,725):(/^-select()when()?][mul(464,901)from(218,74)why(203,518)how()-<{?mul(558,885)mul(206,857{@;$[how()}~^how()where()mul(373,741) <*+@ :^@$mul(717,894);where()who()where()@mul(864,646)mul(490,329)-mul(528,726),,@,+ ,>+mul(223,265)?,where()mul(343,632)){from()what()why() select()@mul(809,361)(from(524,60)^%]when()$?)mul(300,959)*@when()}select())what()mul(88,356)&}where()];mul(232,864)-{@:]do()mul(482,56)@{where(455,533)):$<[mul(10where(601,497)mul(426,581)who()}*]%select(907,807)>&why()mul(227,368)%mul(812,31)from()$-don't(),~,}/mul(149,756)'select()who()mul(52,518)from()who(47,890)what(),>&who()mul(476,778)&$'how()!<[#when()mul(317,462)what()%mul(556,241):#%*mul(37,135))+?select()%how()$mul(462,741)what()select()!where()!who()-mul(758,786)who()what()-);$*!mul(288,131)&who()do()$:mul(694,781)!mul(737,400)>mul(692,914)^%},^$mul(450,519)where()mul(343,778)mul(862,640)[*}>>+&mul(292,865)[[]why(){why()&!how()how()don't() select()]who()when()-mul(120,234)}why();%^:$mul(12,755)from()from()select()%-?%}mul(616,813)@why()%from()-&mul(941,163)+;{~]mul(578,90)^;&(mul(947,324)!- ]//when()mul(881*}~mul(336,395)> $~[?mul(725,706)&<%mul(824,186)-@<)mul(330,957)$!mul(204,391)mul(265,505)what(),@:>-? /mul(974,931)$what();{[@{%!why()mul(90,923){#}what()?~-mul(696,784)<~who(718,997)mul(538,499)mul(476,975)mul(940,308)why()mul<+where()]'what()>%$}where()mul(820,423))mul(386,97)][,who()don't())?#,~*who()@mul(918,462{!what(382,394)where()[#(why()mul(904,736)%'}+mul(374,305)++!#mul(653,473)how(),-mul(162,434)?^@when()#mul(343,280)select()from(124,931)when(5,118)mul(468,653)}@#{mul(920,562)don't()&how() -mulwhat()---mul(950,664)!!select()-mul(4,72))when()$(how():!%mul(152,355)$+ '{<%mul(639,874)mul(704,465) !-$^&when()?)how(688,518)mul(718,288):{:-:()where()#mul(673,322)mul(871,761)from()when()~~()mul(893,784)
+%mul(189,64)/}mul(537,332),;+}mul(275,738)]<:!@&),&don't()mul(886,924)?+when()/$]$-((when()do()^[where():?what()mul(436,577)})(mul(158from(238,897)+from()when()>how()what()@mul(302,395)how()&;from(886,251)%+!^%do(); {@,mul(349,117)>#from()from()mul(304,66)mul(598,654)?where()#mul(660,67)~[mul(977,328);who()!mul(728,941);+#when()*-mul(874,428)%mul(789,631):>+)mul(704,887)<*$$,%[what() mul(53,94)when()]#%$what()* ]-mul(455,519):<~(*>mul(385,498)>]why()(/mul(93,328)mul(293(where()?^where(474,333)?(mul(13,796)% %do()from()select()mul(632,756):why(11,315)what()mul(703,564)mul(969,63)!$/mul(887,388)#)-mulwhere()[(mul(134,297)how(){:[(don't()-select()from()}/}[ mul(679,478)&%'{mul(435,924)'[select();when()why()mul(840,427)!/*{:mul(188,195)mul!;$how()mul(187,258)~)#mul(488,233)}why()(:[when()select(){mul(567,681)when()}~%?$select()$:mul(72,236)+where()when():%where():@@mul(44,340)when()%mul(480,990),+who()mul(318}/(~%}select(596,203):/{mul(951,330){['+@-+^/mul(474,877)&,@@select()from()^mul(123,577)mul(828,17)}@]where()[mul(346,649):(>@{;$mul(568,77)%(mul(582,991)>where():from(155,417) from()/mul(93,912)from()%when(),mul(656,124)}do()what()from()^+;what()from()mul(660,451)what(187,581)['^^mul(642,281)&mul(690,722)why();when()[$+!when()mul(545,305))~mul<*&'^why()$mul(640,100)$:how(728,83)where()when()select()mul(333,982){#from()%/[}how()mul(720,343mul(833,88)~where())'mul(479,932)@why()/who()@from()what()!mul(346,663)select()mul(884,485):from()from():[://'@mul(674,41)how()!{mul(729,49)'select()~@who()^^who()mul(650,61)from(432,392)$^{~from()[mul(754,933)why():,*$'!$select()do()'when()?how()@-$/what()mul(964,456)(/ *mul(583};!)/(mul(476,807)[(how():how()'@~[#mul(227,838);&mul(339,718)'[from(),@mul(953,984)mul(999,724)mul(43,842)don't()>&;^how()/#mul(803,31),'@'#where()$mul]&^')]when()][where()mul(134,795)&+how();?>++*!mul(237,729)>{/}+what()[mul(41,980)<*where()mul(835,273)}:;mul(23,904)^#where():$]mul(969,17)mul(461,814)mul%what()]why()mul(759,464)what()@{mul(322,326)>where()%(&;^mul(60,312)why()#!@;when(){':)mul(464,962)!!!from())mul(703,738)/who()how()mul(127,451)#!/usr/bin/perl{when()+:+who()(who()mul(181,460)
+do();)what(){,where()*mul(662,853)?-!mul(776,981)!who()%^;/}mul(624,583)*%%}/from()%?%mul(115,696) mul(873,420)mul(136,123)when(){:*(&where()}mul(514,998)who():[>who()'*why()):mul(175,609)how()^mul(53,892)why()select()]select()^){mul(750,639){how()(~>where()'mul(107,296)what()$:*mul(373,967[>]{)-!$ what()mul(281,521)when(573,540)who()] $$where()mul(465{from()$how()why()!+#(%what()where()mul(895,95)[why(216,972)}&& :!what(886,953)~mul(593,11)why()$[]~<+%from(926,553)who()mul(423,287)why()(from()(-(from()mul(854,833)#select()select()^mul(167,269)why()/]}:?]}>mul(745,993)~@what()'how())mul(827,736)([:@,what(293,969)'what()don't()-!~,mul(192,429);what()how()mul(847,188)>mul(141,869)[;how()mul(848,705)?when(){mul(559,567)^who()}from():!don't()%!where()>-what()](mul(105,363)why()where():where(578,872)(when()+mul(881,376)mul(695,809)^how()}!mul(364,248)?}:/from()}]]~%mul(804,4)mul(119,641)%from())%what()&mul(712,534)%??;-@@:what()mul(123,22)&-^from()$,mul(772,667)mul(42,86)])+!;when()^!$mul(622,677select(864,78)$mul(580,723)$where()#when()mul(751,301)+/(;+)]-select()mul(171,677)mul(661,374)~what()'*+ select()select(764,759):don't();)mul(840?{*%]why()mul(226,734)*where()(#*>^&mul(299,672)(who()mul(625,138))/<)don't();mul(468,424)+?%select()mul(760,645):(:who()};*#don't()mul(759,862)&@}] mul(334,129))]how();what()*how()#mul(305,664)when()):/do()%where()select()+'mul(58,303) ->what()* $mul(413,139)mul(982,406)-![[+select()(when()mul(165,136)]why()(when()mul(616,183)!+;/:%mul(481,602)}[^,{[@why()@<+mul(204,987!/mul(677,349)select()when()$who()why();[^,mul(194,35)select()',mul(127,110)-#:mul(596,30)- /who(12,984)-do()why()-mul(167,577)from()/'@where()$@-do()!>mul(981,462)*select()-+where()do()>]#~(,~mul(387,979)&mul(387,101)>mul(501,522)#{-mul(383,636)what()!+<mul(329 !$select()#]@[mul(864,202)select(){what()from()mul&/what(){>](~from()[%mul(806,858)[(>mul(892,860)!<:^:when()'@where()mul(491,377)&;/where()why()mul(478,743)when()mul(464,509)@;#')(+$mul(837,217)($mul(921,229), !/do()from():mul(45,689)-select()what()]$;mul(903,906){]<^when()where()<-mul(213,893)what()do()@^mul(514,953)where()[mul(143,932)~/when()$why()*~mul(990,283)~{# !mul(755,667)mul(474,41)
+-:'&select()},how()mul(224,420)*{]}from()~select();)+mul(244}mul(789,459)from()+select()+?+'&}(mul(570,585)' ^select()why()why()^select()*mul(474,591)}++why()-{}%^mul(2,90)how(){!%mul(899what()$@,*mul(517,561),~)mul(510,855)from(){how():>[mul(485,191)?mul(238,765)~<(mul(606,527)<+/-where()'select()mul(446,167),mul(445,372)<>/(~;mul(142,440)[+%,}mul(687,94)@-?::-mul(297,299)mul(381,157)mul(711,860)from(359,7),% what()>select()mul(18,464)~ ~(':mul(340,143)+/