{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 2 " ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "input = \"\"\"116\t1259\t1045\t679\t1334\t157\t277\t1217\t218\t641\t1089\t136\t247\t1195\t239\t834\n", "269\t1751\t732\t3016\t260\t6440\t5773\t4677\t306\t230\t6928\t7182\t231\t2942\t2738\t3617\n", "644\t128\t89\t361\t530\t97\t35\t604\t535\t297\t599\t121\t567\t106\t114\t480\n", "105\t408\t120\t363\t430\t102\t137\t283\t123\t258\t19\t101\t181\t477\t463\t279\n", "873\t116\t840\t105\t285\t238\t540\t22\t117\t125\t699\t953\t920\t106\t113\t259\n", "3695\t161\t186\t2188\t3611\t2802\t157\t2154\t3394\t145\t2725\t1327\t3741\t2493\t3607\t4041\n", "140\t1401\t110\t119\t112\t1586\t125\t937\t1469\t1015\t879\t1798\t122\t1151\t100\t926\n", "2401\t191\t219\t607\t267\t2362\t932\t2283\t889\t2567\t2171\t2409\t1078\t2247\t2441\t245\n", "928\t1142\t957\t1155\t922\t1039\t452\t285\t467\t305\t506\t221\t281\t59\t667\t232\n", "3882\t1698\t170\t5796\t2557\t173\t1228\t4630\t174\t3508\t5629\t4395\t180\t5100\t2814\t2247\n", "396\t311\t223\t227\t340\t313\t355\t469\t229\t162\t107\t76\t363\t132\t453\t161\n", "627\t1331\t1143\t1572\t966\t388\t198\t2068\t201\t239\t176\t1805\t1506\t1890\t1980\t1887\n", "3390\t5336\t1730\t4072\t5342\t216\t3823\t85\t5408\t5774\t247\t5308\t232\t256\t5214\t787\n", "176\t1694\t1787\t1586\t3798\t4243\t157\t4224\t3603\t2121\t3733\t851\t2493\t4136\t148\t153\n", "2432\t4030\t3397\t4032\t3952\t2727\t157\t3284\t3450\t3229\t4169\t3471\t4255\t155\t127\t186\n", "919\t615\t335\t816\t138\t97\t881\t790\t855\t89\t451\t789\t423\t108\t95\t116\"\"\"" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "239 1195\n", "230 6440\n", "106 530\n", "102 408\n", "105 840\n", "157 3611\n", "122 1586\n", "219 2409\n", "232 928\n", "170 5100\n", "132 396\n", "198 1980\n", "232 5336\n", "176 4224\n", "155 4030\n", "95 855\n" ] }, { "data": { "text/plain": [ "226" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s = 0\n", "for line in input.split('\\n'):\n", " row_numbers = sorted([int(val) for val in line.split()])\n", " for ind, divisor in enumerate(row_numbers):\n", " for divised in row_numbers[ind+1:]:\n", " if divised % divisor == 0:\n", " print(divisor, divised)\n", " s += divised // divisor\n", " break\n", "s" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[89, 95, 97, 108, 116, 138, 335, 423, 451, 615, 789, 790, 816, 855, 881, 919]" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "row_numbers" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "1195 % 239" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 3 (spirals) " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## First part " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "New approach and insight: start at the corners every time." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "input = 325489" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "def generate_spiral(R):\n", " \"\"\"Generates the spiral up to radius R.\n", " Returns a list of complex numbers (x, y coordinates).\"\"\"\n", " spiral = [(0+0j)]\n", " for r in range(R+1):\n", " corner = r - 1j * r\n", " side_len = 2 * r\n", " current_pos = corner\n", " for side, direction in zip(range(4), [1j, -1, -1j, 1]):\n", " for step in range(side_len):\n", " current_pos += direction\n", " spiral.append(current_pos)\n", " return spiral" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's plot this." ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAA3YAAAEyCAYAAAC2+0LeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X9sZPd53/vPJxRtz03cy7ZSKpOSurqIQNRVfb29hFOB\nRasqSijrqvLatRE7bq6dH5AcREiCm3AtWqjVm8AoAwJpjMhotDcWHLeKrGC9otRILi2XMVTnWrIp\nUV5KlpkqdrLaoVoxURnHMOtdkc/9g0OGombI4c6ZM9/vmfcLWOzOmbPf5/nOnPPwPDxzzjgiBAAA\nAADI1/f1OgEAAAAAQGdo7AAAAAAgczR2AAAAAJA5GjsAAAAAyByNHQAAAABkjsYOAAAAADJHYwcA\nAAAAmaOxAwAAAIDM0dgBAAAAQOYu6nUC+7n44ovjyJEjvU4DQIGefPLJP4+IS3qdRyeoTUD1UJsA\npKrd+pR0Y3fkyBEtLCz0Og0ABbL9Z73OoVPUJqB6qE0AUtVufeKjmAAAAACQORo7AAAAAMgcjR0A\nAAAAZI7GDgAAAAAyR2MHAAAAAJmjsQMAAACAzNHYAQAAAEDmOv4eO9uXS/q0pEslbUo6EREf37OO\nJX1c0o2SvivpgxHxVKexJWl2sa6ZuWWtrK1reKimyYlRHTs6UsTQSWB+eWN+6bP9BkmPSXq9tmri\nyYi4s9NxU3xtUswp1bzIKe+8UsypE7YHJC1IqkfETZ2OV/brQ7w8YxEvv3hFfEH5K5J+OSKesv1G\nSU/afjQivr5rnbdLuqrx54cl/bvG3x2ZXaxr6tSS1s9vSJLqa+uaOrUkSVkX8G3ML2/MLxvfk3Rd\nRHzH9qCkL9n+XEQ8fqEDpvjapJhTqnmRU955pZhTAX5R0nOS/kanA5X9+hAvz1jEyzOeI6KQgXYG\ntB+UdFdEPLpr2d2SvhgR9zUeL0u6NiJe3G+ssbGxWFhYaPn8+PS86mvrr1n+uoHv09Erhi5wBulY\nPLOmcxubr1nO/PLQr/MbGarpj26/ruX/s/1kRIx1M7cLZft/kfQlST8XEU+0Wi/H2pTq9phiXuTU\nvhTzqlptsn2ZpN+V9DFJ//d+Z+wOqk1S+fWp7G2kyvGqPLd+jndQbZLar0+FXmNn+4iko5L2HhCN\nSHph1+OzjWXNxrjF9oLthdXV1X3jrTQpTJKavmg5ajUP5peHfp1fq/0yZbYHbD8t6SVJjzZr6nKv\nTalujynmRU7tSzGvKtWmht+UdFxbl7u8xmFqk1R+fSp7G6lyvCrPrZ/jFVmbivgopiTJ9g9I+qyk\nX4qIb+99usl/aXqqMCJOSDohbf3mab+Yw0O1pr91Ghmq6f5br2kn7aS1+q0a88tDv85veKjWg2w6\nExEbkt5qe0jSA7avjohn9qyTdW1KdXtMMS9yal+KeVWpNtm+SdJLEfGk7WubrXOY2iSVX5/K3kaq\nHK/Kc+vneEXWpkLO2DWuS/mspHsj4lSTVc5KunzX48skrXQad3JiVLXBgVctqw0OaHJitNOhk8D8\n8sb88hMRa5K+KOmGTsZJ8bVJMScpzbzIqX0p5pViTh0Yl3Sz7T+V9BlJ19n+D50MWPbrQ7w8YxEv\nz3hF3BXTkj4p6bmI+I0Wqz0k6Tbbn9HWTVP+8qDr69qxfaHh8ZOndW5jUyMVuPPVbtvzqNKdvXZj\nfnmryv5n+xJJ5yNizXZN0vWSfr2TMVN8bVLdHlPMi5zyzivF/e9CRcSUpClJapyx+5WI+JedjFn2\n61P2NlLleFWeWz/F6+a+1/HNU2z/Y0n/RdKS/vrz3x+RdIUkRcRvN5q/u7T1W/DvSvqpiNj/6l61\ndxGwJP343V+WpEp8vA3IzWH3v9RuUGD7Ldq6McGAtj7F8PsR8av7/R9qE5C+3GvTXrsau45unrKN\n+gT0xoXse+3Wp47P2EXEl9T8Grrd64Skn+80FgAULSJOa+umTwCQrIj4orY+Kg4ATRV6V0wAAAAA\nQPlo7AAAAAAgczR2AAAAAJA5GjsAAAAAyByNHQAAAABkjsYOAAAAADJHYwcAAAAAmaOxAwAAAIDM\n0dgBAAAAQOZo7AAAAAAgczR2AAAAAJA5GjsAAAAAyByNHQAAAABkjsYOAAAAADJHYwcAAAAAmaOx\nAwAAAIDM0dgBAAAAQOZo7AAAAAAgczR2AAAAAJA5GjsAAAAAyByNHQAAAABkjsYOAAAAADJ3URGD\n2L5H0k2SXoqIq5s8f62kByV9q7HoVET8ahGxAQAAqsj2GyQ9Jun12jpmOxkRd3Y67uxiXYtn1nRu\nY1Pj0/OanBjVsaMjnQ67b7yZuWWtrK1reKhGvExiEa878bq57xXS2En6lKS7JH16n3X+S0TcVFA8\nAACAqvuepOsi4ju2ByV9yfbnIuLxCx1wdrGuqVNLOrexKUmqr61r6tSSJHXlgHY73vr5DeJlFIt4\n3YvXzX2vkMYuIh6zfaSIsQAAACBFREj6TuPhYONPdDLmzNzyzoHstvXzG5qZW+7KwWyreMdPntZ9\nXzlTeLztsyFVjFfluaUUr+x9och4ZV5jd43tr9n+nO2/32ol27fYXrC9sLq6WmJ6AAAAabE9YPtp\nSS9JejQintjz/KGOm1bW1g+1vFOtxt17QF2UVuNWIV6V55ZSvLL3hSLjFfVRzIM8JenvNj5KcKOk\nWUlXNVsxIk5IOiFJY2NjHf1WCgAAIGcRsSHprbaHJD1g++qIeGbX84c6bhoeqqne5EByeKhWXNJt\nxBsZqun+W68pPN749Hxl41V5binFK3tfKDJeKWfsIuLbEfGdxr8fkTRo++IyYgMAAOQuItYkfVHS\nDZ2MMzkxqtrgwKuW1QYHNDkx2smwxCshXpXnRrxilHLGzvalkv57RITtt2mrofyLMmIDAADkyPYl\nks5HxJrtmqTrJf16J2NuX8tz/ORpndvY1EiX7wTYq3hl3emwzHhVnlsv41VpXyjq6w7uk3StpItt\nn5V0p7Yu8FVE/Lakd0v6OduvSFqX9N7GBcEAAABo7k2Sftf2gLZ+Kf77EfEHnQ567OjIzs0ouvER\ntxTidfOW9b2MV+W59SpelfaFou6K+b4Dnr9LW1+HAAAAgDZExGlJR3udB4A8lHlXTAAAAABAF9DY\nAehrti+3/Ye2n7P9rO1f7HVOAAAAh1XW1x0AQKpekfTLEfGU7TdKetL2oxHx9U4GnV2s73z56fj0\nfFcvyD5MTmVdlJ57XuSUd14p7n8A0G00dgD6WkS8KOnFxr//yvZzkkYkXXBjN7tY19SppZ0vP62v\nrWvq1JIk9ezgcjun9fMbyeSUal7klHdeKe5/AFAGGjsAaLB9RFs3Kniik3Fm5pZ3DnS3rZ/f0Mzc\ncs8OLFvldPzk6Z07dPXC9lmV3XqdFzm1r1VeKW7rvcwJAMrANXYAIMn2D0j6rKRfiohvN3n+FtsL\nthdWV1f3HWtlbf1Qy8vQKvbeg/KytYrfy7zIqX2t4qe4rfcyJwAoA2fsAPQ924PaaurujYhTzdaJ\niBOSTkjS2NjYvt/DOTxUU73JQeTwUK3zZC9Qq5xGhmqlfHdPK+PT88nlRU7ta5VXitt6L3MCgDJw\nxg5AX7NtSZ+U9FxE/EYRY05OjKo2OPCqZbXBAU1OjBYx/AVJMScpzbzIqX0p5pViTgBQBs7YAeh3\n45J+UtKS7acbyz4SEY9c6IDb1/EcP3la5zY2NZLAnQJTzGl3XindVZGcDp9XSttVijkBQBlo7AD0\ntYj4kiQXPe6xoyM7N7Xo5UfldksxJ2krr9QOusmpfSluVynmBADdxkcxAQAAACBzNHYAAAAAkDka\nOwAAAADIHI0dAAAAAGSOxg4AAAAAMkdjBwAAAACZo7EDAAAAgMzR2AEAAABA5mjsAAAAACBzNHYA\nAAAAkDkaOwAAAADIHI0dAAAAAGTuoiIGsX2PpJskvRQRVzd53pI+LulGSd+V9MGIeKqI2LOLdS2e\nWdO5jU2NT89rcmJUx46OFDF0EmYX65qZW9bK2rqGh2rMLzP9ML8q738A0Eu2L5f0aUmXStqUdCIi\nPt7puGXX7l7EK/Nnb5nxqjy3XsWr0r5QSGMn6VOS7tJW8Wnm7ZKuavz5YUn/rvF3R2YX65o6taRz\nG5uSpPrauqZOLUlSJQ4ut+e3fn5DEvPLTb/Mr6r7HwAk4BVJvxwRT9l+o6QnbT8aEV+/0AHLrt29\nilfWz94y41V5br2MV6V9oZDGLiIes31kn1XeIenTERGSHrc9ZPtNEfFiJ3Fn5pZ33vxt6+c3NDO3\nXIkDy1bzO37ytO77ypkeZVWc7d9Y7NYP86v69lmV+QFArzWOk15s/PuvbD8naUTSBTd2ZdfuVOJ1\n69iizGOZso+bUolX9W2zyHhlXWM3IumFXY/PNpa9hu1bbC/YXlhdXd130JW19UMtz02reezd6HPV\nah5Vn1/Vt8+qzA8AUtL4BfpRSU/sWd72cZNUfu1OJV63ji3KPJYp+7gplXhV3zaLjFfURzEP4ibL\notmKEXFC0glJGhsba7rOtuGhmupNXozhodoFpJieVvMbGarp/luv6UFGxRqfnu/L+VV9+6zK/AAg\nFbZ/QNJnJf1SRHx793OHOW6Syq/dqcTr1rFFmccyZR83pRKv6ttmkfHKOmN3VtLlux5fJmml00En\nJ0ZVGxx41bLa4IAmJ0Y7HToJzC9vzA8A0Cnbg9pq6u6NiFOdjld27SZenrGIl2e8ss7YPSTpNtuf\n0dZNU/6y0+vrpL++0PD4ydM6t7GpkYrddbBf5lfVu0b2y/tX1fkBQK817ir+SUnPRcRvFDFm2bW7\nX+KVcSxT9nFTr+JVfVvpZryivu7gPknXSrrY9llJd0oalKSI+G1Jj2jrqw6e19bXHfxUEXGlrRdp\n+wLOKnx8b69+mF+VG4F+eP+qPD8A6LFxST8pacn2041lH4mIRzoZtOza3Q/xyjqWKfu4qRfxqr6t\ndDNeUXfFfN8Bz4ekny8iFgAAQD+IiC+p+X0KAOA1yrrGDgAAAADQJTR2AAAAAJA5GjsAAAAAyByN\nHQAAAABkjsYOAAAAADJHYwcAAAAAmaOxAwAAAIDM0dgBAAAAQOZo7AAAAAAgczR2AAAAAJA5GjsA\nAAAAyByNHYC+Z/se2y/ZfqbXuQAAAFwIGjsAkD4l6YYiB5xdrGvxzJqe+NbLGp+e1+xivcjhK5OT\ntJXX+PS8rrz94WTyIqf2pbhdpZgTAHTbRb1OAAB6LSIes32kqPFmF+uaOrWkcxubkqT62rqmTi1J\nko4dHSkqTPY57c5r/fxGMnmR0+HzSmm7SjEnACgDjR0AFGxmbnnnAHzb+vkNzcwt9+zAMsWcpNZ5\nHT95Wvd95UxPclo8s7bTFKSeU6rvH9s6AJSPj2ICQBts32J7wfbC6urqvuuurK0fankZUsxpv/h7\nm5gytYqdYk6pvn9s6wBQPs7YAUAbIuKEpBOSNDY2FvutOzxUU73JQeTwUK07ybUhxZy24zfLa2So\npvtvvaYHGUnj0/PZ5JTq+8e2DgDl44wdABRscmJUtcGBVy2rDQ5ocmK0RxmlmZOUZl7k1L4U80ox\nJwAoA2fsAPQ92/dJulbSxbbPSrozIj55oeNtX8dz/ORpndvY1MhQTZMToz29vifFnFLNazv2zNyy\nVtbWNZxQTim9TqnmlWJOAFAGGjsAfS8i3lf0mMeOjuzcaKNXH9/bK8WcpDTzOnZ0JLlGIMXXSUoz\nrxRzAoBu46OYAAAAAJA5GjsAAAAAyFwhjZ3tG2wv237e9u1Nnv+g7VXbTzf+/GwRcQEAAKrK9j22\nX7L9TJHjzi7WtXhmTU9862WNT89rdrFe5PB9GW98el5X3v5w1+OVGatX8aq+rXQzXsfX2NkekPQJ\nST8q6aykr9p+KCK+vmfV+yPitk7jAQAA9IlPSbpL0qeLGnB2sa6pU0s7341YX1vX1KklSerKdaX9\nEm/9/EbX45UZq5fxqr6tdDNeETdPeZuk5yPim5Jk+zOS3iFpb2MHAACANkXEY7aPFDnmzNzyzoH6\ntvXzG5qZW+7KwWy/xjt+8vTODXyKsnhmbacp6Has/eJV/b3LOV4RH8UckfTCrsdnG8v2+he2T9s+\nafvyVoPZvsX2gu2F1dXVAtIDAACopsMeN600+fL2/ZZ3ql/j7W2IitBqzG7E2m/cqr93Occr4oyd\nmyyLPY//o6T7IuJ7tj8k6XclXddssIg4IemEJI2Nje0dBwAAAA2HPW4aHqqp3uRAcnioVnxyfRxv\nZKhW+FdtjE/PlxZrv3hVf+9yjlfEGbuzknafgbtM0sruFSLiLyLie42H/6+k/6OAuAAAADiEyYlR\n1QYHXrWsNjigyYlR4iUer8pzI14xijhj91VJV9m+UlJd0nsl/cTuFWy/KSJebDy8WdJzBcQFAADA\nIWxfy3P85Gmd29jUyFBNkxOjXbmmiHjdiTUzt6yVtXUNV2huxCtGx41dRLxi+zZJc5IGJN0TEc/a\n/lVJCxHxkKRfsH2zpFckvSzpg53GBQAAqDLb90m6VtLFts9KujMiPtnpuMeOjuzcbKMbH+EjXndj\ndavxaBWvqq9lFeMVccZOEfGIpEf2LPvorn9PSZoqIhYAAEA/iIj39ToHAPko5AvKAQAAAAC9Q2MH\nAAAAAJmjsQMAAACAzNHYAQAAAEDmaOwAAAAAIHM0dgAAAACQORo7AAAAAMgcjR0AAAAAZI7GDgAA\nAAAyR2MHAAAAAJmjsQMAAACAzNHYAQAAAEDmaOwAAAAAIHM0dgAAAACQORo7AAAAAMgcjR0AAAAA\nZI7GDgAAAAAyR2MHAAAAAJmjsQMAAACAzNHYAQAAAEDmaOwAAAAAIHM0dgAAAACQuUIaO9s32F62\n/bzt25s8/3rb9zeef8L2kSLiStLsYl2LZ9b0xLde1vj0vGYX60UNnYR+mN/49LyuvP3hys6v6u9f\nFeZ3UA27ECm+NinmJKWZV4q1KcXXSUozrxRzulBVqE/EKzZWmbWpyq9lFeN13NjZHpD0CUlvl/Rm\nSe+z/eY9q/2MpP8RET8k6d9K+vVO40pbL87UqSWd29iUJNXX1jV1ainrAr5bv8yvvrauUHXnV/X3\nL/f5tVnDDiXF1ybFnFLNK8XalOLrlGpeKeZ0oapQn4hXfKyyalOVX8uqxnNEdDaAfY2kfx0RE43H\nU5IUEf9m1zpzjXW+bPsiSf9N0iVxQPCxsbFYWFho+fz49Lzqa+uvWT4yVNMf3X7dhUwnKf06v9cN\nfJ+OXjHUg4yKtXhmbWfn3a3q799B87P9ZESMdTO3w2inhu2VY21KMScpzbxSrE2p1pOc3r/capN0\n+Pp0UG2Syn/PiNf9WN2qTWXXnSq/d53Ga7c+FfFRzBFJL+x6fLaxrOk6EfGKpL+U9LebDWb7FtsL\nthdWV1f3DbzS5MXZb3lu+nV+zYpIjlrNo+rvX4bza6eGZV+bUsxpv/gpvla9rE2p1pOc3r9ev1YX\n6MD6dJjaJJX/+hCv+7G6VZvKrjtVfu/KindRAWO4ybK9Z+LaWWdrYcQJSSekrd887Rd4eKjWtPMd\nHqrt99+y0a/zGxmq6f5br+lBRsVq9ZuZqr9/Gc6vrfqUe21KMaft+KnllWJtSrWe5PT+9fq1ukAH\n1qfD1Cap/NeHeN2P1a3aVHbdqfJ7V1a8Is7YnZV0+a7Hl0laabVO46OY/6uklzsNPDkxqtrgwKuW\n1QYHNDkx2unQSWB+eWN+2Winhh1Kiq9NijlJaeZFTu1LMa8Uc+pA9vWJeHnGIl6e8Yo4Y/dVSVfZ\nvlJSXdJ7Jf3EnnUekvQBSV+W9G5J8wddX9eOY0e3Po1w/ORpndvY1MhQTZMTozvLc9cv85uZW9bK\n2rqGmV9WKrR9tlPDDiXF1ybFnFLNK8V9N8WcdueV4vuXUk4dyL4+Ea/4WGXVgV7Fq+J7V1a8jm+e\nIkm2b5T0m5IGJN0TER+z/auSFiLiIdtvkPTvJR3V1pm690bENw8at52LgCXpx+/+siRV4uN7zVR9\nfsjbYbfPRG9Q8Joatt/6OdemFHOS0s0L7Unx/atCbZIOV5/arU1S+e8Z8dCuqr93FxKv3fpUxBk7\nRcQjkh7Zs+yju/79PyW9p4hYAFC0ZjUMAFJAfQLQrkK+oBwAAAAA0Ds0dgAAAACQORo7AAAAAMgc\njR0AAAAAZI7GDgAAAAAyR2MHAAAAAJmjsQMAAACAzNHYAQAAAEDmaOwAAAAAIHM0dgAAAACQORo7\nAAAAAMgcjR0AAAAAZI7GDgAAAAAyR2MHAAAAAJmjsQMAAACAzNHYAQAAAEDmaOwAAAAAIHM0dgAA\nAACQORo7AAAAAMgcjR0AAAAAZI7GDgAAAAAy11FjZ/tv2X7U9n9t/P03W6y3Yfvpxp+HOokJAABQ\ndbbfY/tZ25u2x3qdD4D0dXrG7nZJ/zkirpL0nxuPm1mPiLc2/tzcYUwAAICqe0bSuyQ9VvTAs4t1\nLZ5Z0xPfelnj0/OaXawXHYJ4XYw1Pj2vK29/uLS5lR2vqu9dGfEu6vD/v0PStY1//66kL0r6cIdj\nAgAA9LWIeE6SbBc67uxiXVOnlnRuY1OSVF9b19SpJUnSsaMjhcYiXrHxtmOtn9/oeqxexqvie1dW\nvE4bu78TES9KUkS8aPsHW6z3BtsLkl6RNB0Rsx3GBQAAwCHNzC3vHKhvWz+/oZm55a4czPZrvOMn\nT+u+r5wpNNbimbWdpqDbsVKKV/Vtpch4BzZ2tr8g6dImT91xiDhXRMSK7f9N0rztpYj4kxbxbpF0\niyRdccUVhwgBAACQj/2OsSLiwTbHONRx08ra+qGWd6pf4+1tUIrQasxuxEopXtW3lSLjHdjYRcT1\nrZ6z/d9tv6lxtu5Nkl5qMcZK4+9v2v6ipKOSmjZ2EXFC0glJGhsbiwNnAAAAkKH9jrEOMcahjpuG\nh2qqNzmQHB6qdZoK8XYZGarp/luvKTTW+PR8abFSilf1baXIeJ3ePOUhSR9o/PsDkl7z2yXbf9P2\n6xv/vljSuKSvdxgXAAAAhzQ5Mara4MCrltUGBzQ5MUq8xONVeW7EK0an19hNS/p92z8j6Yyk90hS\n47a8H4qIn5X09yTdbXtTW43kdETQ2AEAALRg+52SfkvSJZIetv10REx0Ou72tTzHT57WuY1NjQzV\nNDkx2pVrivop3szcslbW1jXcxXhlxuqneFXaNjtq7CLiLyT9SJPlC5J+tvHv/0/SP+gkDgAAQD+J\niAckPdCNsY8dHdm5+UU3PlLXj/G61Qz0Mla/xKvSttnpRzEBAAAAAD1GYwcAAAAAmaOxA9C3bL/H\n9rO2NxvXBhdmdrGuxTNreuJbL2t8el6zi/Uih69MTlKaec0u1jU+Pa8rb3+YnA6Q6vuXWk4A0G2d\n3jwFAHL2jKR3Sbq7yEFnF+uaOrW085089bV1TZ1akqRSrx1IPadU89rOafuLZMnp4LxSfP9SygkA\nykBjB6BvRcRzkmS70HFn5pZ3DsC3rZ/f0Mzccs8OLFPMSWqd1/GTp3cuMC/b4pm113xRLjk11yov\ntnUAKB8fxQSANti+xfaC7YXV1dV9111p8gWk+y0vQ4o57Rd/b7NQplaxyan9+GzrAFA+ztgBqDTb\nX5B0aZOn7oiIB9sdJyJOSDohSWNjY7HfusNDNdWbHEQOD9XaDVe4FHPajt8sr5GhWim3nm5mfHqe\nnNrUKi+2dQAoH2fsAFRaRFwfEVc3+dN2U3dYkxOjqg0OvGpZbXBAkxOj3Qp5oBRzktLMi5zal2Je\nKeYEAGXgjB0AFGz7Op7jJ0/r3MamRoZqmpwY7en1PSnmtDuvmbllraytaziBvMgp77xS3dYBoNto\n7AD0LdvvlPRbki6R9LDtpyNiooixjx0d2bmpRS8/KrdbijlJW3mldtBNTu1LMa9Ut3UA6CYaOwB9\nKyIekPRAr/MAAADoFNfYAQAAAEDmaOwAAAAAIHM0dgAAAACQORo7AAAAAMgcjR0AAAAAZI7GDgAA\nAAAyR2MHAAAAAJmjsQMAAACAzNHYAQAAAEDmaOwAAAAAIHM0dgAAAACQuY4aO9vvsf2s7U3bY/us\nd4PtZdvP2769k5gAAABVZ3vG9jdsn7b9gO2hXucEIG2dnrF7RtK7JD3WagXbA5I+Ientkt4s6X22\n39xh3B2zi3UtnlnTE996WePT85pdrBc1dBL6YX7j0/O68vaHmV+Gqr59AkAPPSrp6oh4i6Q/ljRV\n1MBl1+5+iFfWz/qyjyv6IV6Vts2LOvnPEfGcJNneb7W3SXo+Ir7ZWPczkt4h6eudxJa2XpypU0s6\nt7EpSaqvrWvq1JIk6djRkU6H77l+md/6+Q1JzC83Vd8+AaCXIuLzux4+LundRYxbdu3ul3hl/Kwv\n+7iiX+JVadvsqLFr04ikF3Y9Pivph4sYeGZueefN37Z+fkMzc8uVOLBsNb/jJ0/rvq+c6VFWxVk8\ns7azcW9jfvloNb+q7H8AkJCflnR/EQOVfeyUSrxu/ewt82d92ccV/Rov533hwMbO9hckXdrkqTsi\n4sE2YjQ7nRf7xLtF0i2SdMUVV+w78Mra+qGW56bVPPZuhLlqNQ/ml4dW86jK/gcA3dbOMZbtOyS9\nIuneFmO0fdwklX/slEq8bv3sLfNnfdnHFf0aL+d94cDGLiKu7zDGWUmX73p8maSVfeKdkHRCksbG\nxlo2gJI0PFRTvcmLMTxUu6BEU9NqfiNDNd1/6zU9yKhY49PzzC9jreZXlf0PALrtoGMs2x+QdJOk\nH4mIpsdEhzlukso/dkolXrd+9pb5s77s44p+jZfzvlDG1x18VdJVtq+0/TpJ75X0UBEDT06MqjY4\n8KpltcEBTU6MFjF8zzG/vDE/AMCFsn2DpA9LujkivlvUuGXXbuLlGYt4ecbr6Bo72++U9FuSLpH0\nsO2nI2LC9rCk34mIGyPiFdu3SZqTNCDpnoh4tuPM9dcXGh4/eVrnNjY1MlTT5MRoZa7v2Z7HzNyy\nVtbWNcz8ssL8AAAduEvS6yU92rhJ3eMR8aFOBy372KlX8cr62VRmvCrPrZ/idXNfcIsz+0kYGxuL\nhYWFA9d01gvmAAAPc0lEQVT78bu/LEmV+HgbUHW2n4yIlt97mYOca1OKOQHdcNhtvZ9qk1R+LaD2\nAFsuZF9otz6V8VFMAAAAAEAX0dgBAAAAQOZo7AAAAAAgczR2AAAAAJA5GjsAAAAAyByNHQAAAABk\njsYOAAAAADJHYwcAAAAAmaOxAwAAAIDM0dgBAAAAQOZo7AAAAAAgczR2AAAAAJC5i3qdAAD0iu0Z\nSf9c0jlJfyLppyJirYixZxfrWjyzpnMbmxqfntfkxKiOHR0pYuhK5bSd18zcslbW1jU8VEsiL3LK\nO69Ut3UA6CbO2AHoZ49Kujoi3iLpjyVNFTHo7GJdU6eWdG5jU5JUX1vX1KklzS7Wixi+Mjntzqu+\ntq5IJC9yyjuvVLd1AOg2ztgB6FsR8fldDx+X9O4ixp2ZW9b6+Y1XLVs/v6GZueWenTVoldPxk6d1\n31fO9CQnSTtnVXbrdV7k1L4U82qVUy/3PwAoA2fsAGDLT0v6XKsnbd9ie8H2wurq6r4DraytH2p5\nGVrF3nsAXLZW8XuZFzm1L8W8WsXu5f4HAGXgjB2ASrP9BUmXNnnqjoh4sLHOHZJekXRvq3Ei4oSk\nE5I0NjYW+8UcHqqp3uQgcnio1n7iBWuV08hQTfffek0PMtoyPj2fXF7k1L4U82qVUy/3PwAoA2fs\nAFRaRFwfEVc3+bPd1H1A0k2S3h8R+zZs7ZqcGFVtcOBVy2qDA5qcGC1i+AuSYk5SmnmRU/tSzCvF\nnACgDJyxA9C3bN8g6cOS/mlEfLeocbev4zl+8rTObWxqJIE7BW7HTu3uhSnmRU5555ViTgBQBho7\nAP3sLkmvl/SobUl6PCI+VMTAx46O7Nw8opcfldvt2NGRJA9uU8yLnNqXYl4p5gQA3UZjB6BvRcQP\n9ToHAACAInCNHQAAAABkrqPGzvZ7bD9re9P22D7r/antJdtP217oJCYAAEDV2f4126cbx06ftz3c\n65wApK3Tj2I+I+ldku5uY91/FhF/3mE8AACAfjATEf9Kkmz/gqSPSirkGuDZxfrOF7mPT893/eYy\nvYhX5s1zyoxX5bn1S7xu7gsdNXYR8ZwkNW46AAAAgAJExLd3Pfx+SYV8HcvsYl1Tp5Z2vsi9vrau\nqVNLktSVA9pexVs/v1G5eFWeWz/F6+a+UNbNU0LS522HpLsbX/QLAACAFmx/TNL/JekvJf2zIsac\nmVveOZDdtn5+QzNzy105mG0V7/jJ0zt3Di7S9tmQKsar8tz6OV6R+96B19jZ/oLtZ5r8ecch4oxH\nxD+U9HZJP2/7n+wT7xbbC7YXVldXDxECAAAgHwcdY0XEHRFxuaR7Jd3WYoxDHTetrK0fanmnWo27\n9wC3KK3GrUK8Ks+tn+MVue8deMYuIq7vNEhErDT+fsn2A5LeJumxFuuekHRCksbGxgr52AEAAEBq\nDnGM9XuSHpZ0Z5MxDnXcNDxUU73JgeTwUK3NVA6nVbyRoVpXvuNzfHq+svGqPLd+jlfkvtf1rzuw\n/f2237j9b0k/pq2brgAAAKAJ21ftenizpG8UMe7kxKhqgwOvWlYbHNDkxGgRwxOvi/GqPDfiFaOj\na+xsv1PSb0m6RNLDtp+OiInGLXl/JyJulPR3JD3QuMHKRZJ+LyL+U4d5AwAAVNm07VFJm5L+TAXd\nEXP7Wp7jJ0/r3MamRrp8J8Dtccu682CV41V5bsQrhiPS/bTj2NhYLCwc/LV3P373lyWpK6dNARTL\n9pMR0fJ7L3NAbQKqp59qk0R9AnLSbn3q+kcxAQAAAADdRWMHAAAAAJmjsQMAAACAzNHYAQAAAEDm\naOwAAAAAIHM0dgAAAACQORo7AAAAAMgcjR0AAAAAZI7GDgAAAAAyR2MHAAAAAJmjsQMAAACAzNHY\nAQAAAEDmaOwAAAAAIHM0dgAAAACQORo7AAAAAMgcjR0AAAAAZI7GDgAAAAAyR2MHAAAAAJmjsQMA\nAACAzNHYAQAAAEDmaOwAAAAAIHM0dgAAAACQuYs6+c+2ZyT9c0nnJP2JpJ+KiLUm690g6eOSBiT9\nTkRMdxJ3t9nFuhbPrOncxqbGp+c1OTGqY0dHihq+52YX65qZW9bK2rqGh2rMLzPML222f03SOyRt\nSnpJ0gcjYqWIsVOsTam+XynmRU5555ViThfK9q9ImpF0SUT8eRFjll2fyn4/qhyvynMjXuc6auwk\nPSppKiJesf3rkqYkfXj3CrYHJH1C0o9KOivpq7Yfioivdxhbs4t1TZ1a0rmNTUlSfW1dU6eWJCnb\nAr7b9vzWz29IYn65YX5ZmImIfyVJtn9B0kclfajTQVOsTam+XynmRU5555ViThfK9uXaOn46U9SY\nZdenst+PKser8tyIV0w8R0QxA9nvlPTuiHj/nuXXSPrXETHReDwlSRHxbw4ac2xsLBYWFlo+Pz49\nr/ra+muWv27g+3T0iqHDTSBB279N24v55aFf5zcyVNMf3X5dy/9n+8mIGOtmbheiUZuuiIifO2jd\nHGtTqttjinmRU/tSzKtKtcn2SUm/JulBSWMHnbE7qDZJ5densreRKser8tz6Od5BtUlqvz4VeY3d\nT0v6XJPlI5Je2PX4bGNZU7Zvsb1ge2F1dXXfgCtNCpOkpi9ajlrNg/nloV/n12q/TJXtj9l+QdL7\ntXXGrtV6WdemVLfHFPMip/almFeFatPNkuoR8bUD1mu7Nknl16eyt5Eqx6vy3Po5XpG16cCPYtr+\ngqRLmzx1R0Q82FjnDkmvSLq32RBNlrU8TRgRJySdkLZ+87RfbsNDtaa/dRoZqun+W6/Z779modVv\n1ZhfHvp1fsNDtR5k09pBNSwi7pB0R+OM3W2S7mw2Tu61KdXtMcW8yKl9KeaVS22S9q9Pkj4i6ccO\nGuMwtUkqvz6VvY1UOV6V59bP8YqsTQeesYuI6yPi6iZ/tpu6D0i6SdL7o/nnOs9KunzX48skFXJz\ngsmJUdUGB161rDY4oMmJ0SKG7znmlzfml4aDatguvyfpXxQRM8XXJsWcpDTzIqf2pZhXijm10qo+\nSfqmpCslfc32n2rr2Okp282awEMp+/UhXp6xiJdnvE7vinmDtm6W8k8j4rstVvuqpKtsXympLum9\nkn6ik7jbti80rMqdr/ZifnljfumzfVVE/NfGw5slfaOIcVN8bVLMKdW8yCnvvFLM6bAiYknSD24/\nbjR3B15j146yXx/i5RmLeHnG6+jmKbafl/R6SX/RWPR4RHzI9rC2vtbgxsZ6N0r6TW193cE9EfGx\ndsZv5yJgAHlJ6QYFtj8raVRbX3fwZ5I+FBH1g/4ftQmonpRq017tNnbUJqCa2q1PHZ2xi4gfarF8\nRdKNux4/IumRTmIBQNEiopCPXgJAN0XEkV7nACB9Rd4VEwAAAADQAzR2AAAAAJA5GjsAAAAAyByN\nHQAAAABkjsYOAAAAADJHYwcAAAAAmaOxAwAAAIDMdfQF5d1me1VbXxrcjosl7fvFnZljfnljfn/t\n70bEJd1MptsqUJtSzElKMy9yal+KeVGb9pfie1akKs+vynOTmN9ebdWnpBu7w7C90M43sueK+eWN\n+fWvFF+bFHOS0syLnNqXYl4p5pSSqr8+VZ5flecmMb8LxUcxAQAAACBzNHYAAAAAkLkqNXYnep1A\nlzG/vDG//pXia5NiTlKaeZFT+1LMK8WcUlL116fK86vy3CTmd0Eqc40dAAAAAPSrKp2xAwAAAIC+\nRGMHAAAAAJmrTGNne8b2N2yftv2A7aFe51Qk2++x/aztTduVuf2r7RtsL9t+3vbtvc6naLbvsf2S\n7Wd6nUvRbF9u+w9tP9fYNn+x1zmlyvavNWrT07Y/b3s4gZySrJkp1brU6lOK9STVOmD7Dba/Yvtr\njbz+n17nlDLbv2I7bF/c61yKlGqd61RqtalIqdaUotkesL1o+w+KHLcyjZ2kRyVdHRFvkfTHkqZ6\nnE/RnpH0LkmP9TqRotgekPQJSW+X9GZJ77P95t5mVbhPSbqh10l0ySuSfjki/p6kfyTp5yv4/hVl\nJiLeEhFvlfQHkj7a64SUbs1MotYlWp8+pfTqSap14HuSrouI/13SWyXdYPsf9TinJNm+XNKPSjrT\n61y6INU6d8ESrU1FSrWmFO0XJT1X9KCVaewi4vMR8Urj4eOSLutlPkWLiOciYrnXeRTsbZKej4hv\nRsQ5SZ+R9I4e51SoiHhM0su9zqMbIuLFiHiq8e+/0laBGultVmmKiG/vevj9knp+16pUa2ZCtS65\n+pRiPUm1DsSW7zQeDjb+9Hy/S9S/lXRcFXx9Uq1zHUquNhUp1ZpSJNuXSfo/Jf1O0WNXprHb46cl\nfa7XSeBAI5Je2PX4rCq28/YL20ckHZX0RG8zSZftj9l+QdL7lcYZu92oma9FfTqk1OpA46NOT0t6\nSdKjEZFEXimxfbOkekR8rde5lKAqda5valNqNaVAv6mtX6ZsFj3wRUUP2E22vyDp0iZP3RERDzbW\nuUNbp3HvLTO3IrQzv4pxk2WV+41h1dn+AUmflfRLe85M9ZWD9t+IuEPSHbanJN0m6c5e59RYp/Sa\nmUmtoz4dQop1ICI2JL21cV3VA7avjohkrk8sy377m6SPSPqxcjMqVqp1rov6ojalWFOKYPsmSS9F\nxJO2ry16/Kwau4i4fr/nbX9A0k2SfiQy/IK+g+ZXQWclXb7r8WWSVnqUCy6A7UFtFd57I+JUr/Pp\npUPsv78n6WGV0NilWjMzqXXUpzalXgciYs32F7V1fWLfNXat9jfb/0DSlZK+Zlva2safsv22iPhv\nJabYkVTrXBdVvjalXlM6NC7pZts3SnqDpL9h+z9ExL8sYvDKfBTT9g2SPizp5oj4bq/zQVu+Kukq\n21fafp2k90p6qMc5oU3eOhL4pKTnIuI3ep1PymxftevhzZK+0atctlEzD0R9akOqdcD2Jdt3QLRd\nk3S9EtjvUhIRSxHxgxFxJCKOaKth+Ic5NXUHqWidq3RtSrWmFCUipiLissY+915J80U1dVKFGjtJ\nd0l6o6RHG7cU/+1eJ1Qk2++0fVbSNZIetj3X65w61big+TZJc9q6OPb3I+LZ3mZVLNv3SfqypFHb\nZ23/TK9zKtC4pJ+UdF1jn3u68RsovNa07Wdsn9bWx55SuH1zkjUzlVqXYn1KtJ6kWgfeJOkPG/vc\nV7V1jV2htxVHFpKsc51IsTYVLNWakgVX46w0AAAAAPSvKp2xAwAAAIC+RGMHAAAAAJmjsQMAAACA\nzNHYAQAAAEDmaOwAAAAAIHM0dgAAAACQORo7AAAAAMjc/w9WwcKFHliCtQAAAABJRU5ErkJggg==\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "fig, axes = plt.subplots(figsize=(15, 5), ncols=3)\n", "for ax, r in zip(axes.ravel(), [2, 3, 4]):\n", " spiral = generate_spiral(r)\n", " ax.plot(np.real(spiral), np.imag(spiral), '-o')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Ok, let's now generate the spiral and check when it's bigger than the input." ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "spiral = generate_spiral(400)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(1+0j)" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "spiral[1]" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(-267-285j)" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "spiral[input-1]" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "552.0" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "abs(spiral[input-1].real) + abs(spiral[input-1].imag)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Second part " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "New approach: build the sequence incrementally and add the numbers above and below by looking them up." ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "spiral = generate_spiral(400)\n", "\n", "values = {(0 + 0j) : 1}\n", "for next_coord in spiral[1:]:\n", " neighbours = 0\n", " for delta in [1+0j, 1+1j, 1-1j, 0+1j, 0-1j, -1+0j, -1-1j, -1+1j]:\n", " if next_coord + delta in values:\n", " neighbours += values[next_coord + delta]\n", " values[next_coord] = neighbours" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{0j: 1,\n", " (1+0j): 1,\n", " (1+1j): 2,\n", " 1j: 4,\n", " (-1+1j): 5,\n", " (-1+0j): 10,\n", " (-1-1j): 11,\n", " -1j: 23,\n", " (1-1j): 25,\n", " (2-1j): 26,\n", " (2+0j): 54,\n", " (2+1j): 57,\n", " (2+2j): 59,\n", " (1+2j): 122,\n", " 2j: 133,\n", " (-1+2j): 142,\n", " (-2+2j): 147,\n", " (-2+1j): 304,\n", " (-2+0j): 330,\n", " (-2-1j): 351,\n", " (-2-2j): 362,\n", " (-1-2j): 747,\n", " -2j: 806,\n", " (1-2j): 880,\n", " (2-2j): 931,\n", " (3-2j): 957,\n", " (3-1j): 1968,\n", " (3+0j): 2105,\n", " (3+1j): 2275,\n", " (3+2j): 2391,\n", " (3+3j): 2450,\n", " (2+3j): 5022,\n", " (1+3j): 5336,\n", " 3j: 5733,\n", " (-1+3j): 6155,\n", " (-2+3j): 6444,\n", " (-3+3j): 6591,\n", " (-3+2j): 13486,\n", " (-3+1j): 14267,\n", " (-3+0j): 15252,\n", " (-3-1j): 16295,\n", " (-3-2j): 17008,\n", " (-3-3j): 17370,\n", " (-2-3j): 35487,\n", " (-1-3j): 37402,\n", " -3j: 39835,\n", " (1-3j): 42452,\n", " (2-3j): 45220,\n", " (3-3j): 47108,\n", " (4-3j): 48065,\n", " (4-2j): 98098,\n", " (4-1j): 103128,\n", " (4+0j): 109476,\n", " (4+1j): 116247,\n", " (4+2j): 123363,\n", " (4+3j): 128204,\n", " (4+4j): 130654,\n", " (3+4j): 266330,\n", " (2+4j): 279138,\n", " (1+4j): 295229,\n", " 4j: 312453,\n", " (-1+4j): 330785,\n", " (-2+4j): 349975,\n", " (-3+4j): 363010,\n", " (-4+4j): 369601,\n", " (-4+3j): 752688,\n", " (-4+2j): 787032,\n", " (-4+1j): 830037,\n", " (-4+0j): 875851,\n", " (-4-1j): 924406,\n", " (-4-2j): 975079,\n", " (-4-3j): 1009457,\n", " (-4-4j): 1026827,\n", " (-3-4j): 2089141,\n", " (-2-4j): 2179400,\n", " (-1-4j): 2292124,\n", " -4j: 2411813,\n", " (1-4j): 2539320,\n", " (2-4j): 2674100,\n", " (3-4j): 2814493,\n", " (4-4j): 2909666,\n", " (5-4j): 2957731,\n", " (5-3j): 6013560,\n", " (5-2j): 6262851,\n", " (5-1j): 6573553,\n", " (5+0j): 6902404,\n", " (5+1j): 7251490,\n", " (5+2j): 7619304,\n", " (5+3j): 8001525,\n", " (5+4j): 8260383,\n", " (5+5j): 8391037,\n", " (4+5j): 17048404,\n", " (3+5j): 17724526,\n", " (2+5j): 18565223,\n", " (1+5j): 19452043,\n", " 5j: 20390510,\n", " (-1+5j): 21383723,\n", " (-2+5j): 22427493,\n", " (-3+5j): 23510079,\n", " (-4+5j): 24242690,\n", " (-5+5j): 24612291,\n", " (-5+4j): 49977270,\n", " (-5+3j): 51886591,\n", " (-5+2j): 54256348,\n", " (-5+1j): 56749268,\n", " (-5+0j): 59379562,\n", " (-5-1j): 62154898,\n", " (-5-2j): 65063840,\n", " (-5-3j): 68075203,\n", " (-5-4j): 70111487,\n", " (-5-5j): 71138314,\n", " (-4-5j): 144365769,\n", " (-3-5j): 149661137,\n", " (-2-5j): 156221802,\n", " (-1-5j): 163105139,\n", " -5j: 170348396,\n", " (1-5j): 177973629,\n", " (2-5j): 186001542,\n", " (3-5j): 194399801,\n", " (4-5j): 203081691,\n", " (5-5j): 208949088,\n", " (6-5j): 211906819,\n", " (6-4j): 429827198,\n", " (6-3j): 445061340,\n", " (6-2j): 463911304,\n", " (6-1j): 483650112,\n", " (6+0j): 504377559,\n", " (6+1j): 526150757,\n", " (6+2j): 549023076,\n", " (6+3j): 572904288,\n", " (6+4j): 597557233,\n", " (6+5j): 614208653,\n", " (6+6j): 622599690,\n", " (5+6j): 1262247784,\n", " (4+6j): 1305411751,\n", " (3+6j): 1358749904,\n", " (2+6j): 1414491696,\n", " (1+6j): 1472899472,\n", " 6j: 1534125748,\n", " (-1+6j): 1598327474,\n", " (-2+6j): 1665648769,\n", " (-3+6j): 1735829031,\n", " (-4+6j): 1808194091,\n", " (-5+6j): 1857049072,\n", " (-6+6j): 1881661363,\n", " (-6+5j): 3813299996,\n", " (-6+4j): 3939776148,\n", " (-6+3j): 4095896357,\n", " (-6+2j): 4258788564,\n", " (-6+1j): 4429173742,\n", " (-6+0j): 4607457470,\n", " (-6-1j): 4794055770,\n", " (-6-2j): 4989349711,\n", " (-6-3j): 5192600241,\n", " (-6-4j): 5401925245,\n", " (-6-5j): 5543175046,\n", " (-6-6j): 5614313360,\n", " (-5-6j): 11372992489,\n", " (-4-6j): 11738157709,\n", " (-3-6j): 12188406417,\n", " (-2-6j): 12657394495,\n", " (-1-6j): 13147069832,\n", " -6j: 13658496996,\n", " (1-6j): 14192820563,\n", " (2-6j): 14751195535,\n", " (3-6j): 15334678569,\n", " (4-6j): 15941109149,\n", " (5-6j): 16565046747,\n", " (6-6j): 16985902654,\n", " (7-6j): 17197809473,\n", " (7-5j): 34825446144,\n", " (7-4j): 35912241501,\n", " (7-3j): 37251041343,\n", " (7-2j): 38643664099,\n", " (7-1j): 40095603074,\n", " (7+0j): 41609781502,\n", " (7+1j): 43189332894,\n", " (7+2j): 44837411015,\n", " (7+3j): 46556895612,\n", " (7+4j): 48341565786,\n", " (7+5j): 50175931362,\n", " (7+6j): 51412739705,\n", " (7+7j): 52035339395,\n", " (6+7j): 105332926574,\n", " (5+7j): 108523185799,\n", " (4+7j): 112449595238,\n", " (3+7j): 116528248589,\n", " (2+7j): 120774389661,\n", " (1+7j): 125195906577,\n", " 7j: 129801259271,\n", " (-1+7j): 134599361262,\n", " (-2+7j): 139599166536,\n", " (-3+7j): 144808838427,\n", " (-4+7j): 150209910621,\n", " (-5+7j): 155756815147,\n", " (-6+7j): 159495525582,\n", " (-7+7j): 161377186945,\n", " (-7+6j): 326567673886,\n", " (-7+5j): 336202411393,\n", " (-7+4j): 348051383894,\n", " (-7+3j): 360345844963,\n", " (-7+2j): 373129703626,\n", " (-7+1j): 386425123402,\n", " (-7+0j): 400255810384,\n", " (-7-1j): 414646673335,\n", " (-7-2j): 429622679057,\n", " (-7-3j): 445206554254,\n", " (-7-4j): 461344254786,\n", " (-7-5j): 477903668437,\n", " (-7-6j): 489061156843,\n", " (-7-7j): 494675470203,\n", " (-6-7j): 1000723932895,\n", " (-5-7j): 1029449396453,\n", " (-4-7j): 1064748953068,\n", " (-3-7j): 1101332911689,\n", " (-2-7j): 1139325782433,\n", " (-1-7j): 1178788743756,\n", " -7j: 1219787131147,\n", " (1-7j): 1262389644241,\n", " (2-7j): 1306668338908,\n", " (3-7j): 1352695322161,\n", " (4-7j): 1400536156626,\n", " (5-7j): 1450028215176,\n", " (6-7j): 1500776974050,\n", " (7-7j): 1534960686177,\n", " (8-7j): 1552158495650,\n", " (8-6j): 3139142437444,\n", " (8-5j): 3227077934562,\n", " (8-4j): 3335066663550,\n", " (8-3j): 3446873610493,\n", " (8-2j): 3562863919009,\n", " (8-1j): 3683212967684,\n", " (8+0j): 3808107685154,\n", " (8+1j): 3937744210565,\n", " (8+2j): 4072327850086,\n", " (8+3j): 4212063722499,\n", " (8+4j): 4357138115259,\n", " (8+5j): 4507068352112,\n", " (8+6j): 4660692362574,\n", " (8+7j): 4764140441674,\n", " (8+8j): 4816175781069,\n", " (7+8j): 9737684488712,\n", " (6+8j): 10003575940480,\n", " (5+8j): 10329881648091,\n", " (4+8j): 10667382677717,\n", " (3+8j): 11017134911205,\n", " (2+8j): 11379633456032,\n", " (1+8j): 11755405011541,\n", " 8j: 12145001538651,\n", " (-1+8j): 12549001325720,\n", " (-2+8j): 12968008691945,\n", " (-3+8j): 13402626607529,\n", " (-4+8j): 13853402171724,\n", " (-5+8j): 14318864423074,\n", " (-6+8j): 14795493950748,\n", " (-7+8j): 15116366663275,\n", " (-8+8j): 15277743850220,\n", " (-8+7j): 30882055374326,\n", " (-8+6j): 31706202646550,\n", " (-8+5j): 32717024115723,\n", " (-8+4j): 33761623755973,\n", " (-8+3j): 34843150688456,\n", " (-8+2j): 35963051360447,\n", " (-8+1j): 37122861997859,\n", " (-8+0j): 38324189604980,\n", " (-8-1j): 39568714767756,\n", " (-8-2j): 40858190674402,\n", " (-8-3j): 42194364162499,\n", " (-8-4j): 43578818639976,\n", " (-8-5j): 45007127720042,\n", " (-8-6j): 46468768015525,\n", " (-8-7j): 47452504642571,\n", " (-8-8j): 47947180112774,\n", " (-7-8j): 96895084158443,\n", " (-6-8j): 99419932957994,\n", " (-5-8j): 102514855240410,\n", " (-4-8j): 105710386501620,\n", " (-3-8j): 109015794148810,\n", " (-2-8j): 112435241586688,\n", " (-1-8j): 115973143244024,\n", " -8j: 119634108763168,\n", " (1-8j): 123422953877464,\n", " (2-8j): 127344707182774,\n", " (3-8j): 131404607000469,\n", " (4-8j): 135607866694432,\n", " (5-8j): 139959208040284,\n", " (6-8j): 144444973915687,\n", " (7-8j): 149032870071564,\n", " (8-8j): 152119989253391,\n", " (9-8j): 153672147749041,\n", " (9-7j): 310483437935526,\n", " (9-6j): 318401816803182,\n", " (9-5j): 328103103838738,\n", " (9-4j): 338112122047343,\n", " (9-3j): 348456926240395,\n", " (9-2j): 359149876737581,\n", " (9-1j): 370204061309428,\n", " (9+0j): 381633126172831,\n", " (9+1j): 393451305918636,\n", " (9+2j): 405673441701786,\n", " (9+3j): 418314971389630,\n", " (9+4j): 431391241579500,\n", " (9+5j): 444916140409445,\n", " (9+6j): 458848041565805,\n", " (9+7j): 473089050151122,\n", " (9+8j): 482669366373865,\n", " (9+9j): 487485542154934,\n", " (8+9j): 984708768798580,\n", " (7+9j): 1009266205008841,\n", " (6+9j): 1039337347086124,\n", " (5+9j): 1070338187352412,\n", " (4+9j): 1102352586589425,\n", " (3+9j): 1135416737634379,\n", " (2+9j): 1169568911013157,\n", " (1+9j): 1204848951019381,\n", " 9j: 1241298358895293,\n", " (-1+9j): 1278960370451609,\n", " (-2+9j): 1317880007076803,\n", " (-3+9j): 1358104044548001,\n", " (-4+9j): 1399678937750328,\n", " (-5+9j): 1442646698295874,\n", " (-6+9j): 1486877423332971,\n", " (-7+9j): 1532067027797214,\n", " (-8+9j): 1562461138310709,\n", " (-9+9j): 1577738882160929,\n", " (-9+8j): 3186359819696184,\n", " (-9+7j): 3264225821567280,\n", " (-9+6j): 3359531103703879,\n", " (-9+5j): 3457715954222125,\n", " (-9+4j): 3559037752782277,\n", " (-9+3j): 3663605578587153,\n", " (-9+2j): 3771534642633915,\n", " (-9+1j): 3882944745597201,\n", " (-9+0j): 3997960511967796,\n", " (-9-1j): 4116711607014934,\n", " (-9-2j): 4239332876619591,\n", " (-9-3j): 4365964250096468,\n", " (-9-4j): 4496744560618985,\n", " (-9-5j): 4631799274994528,\n", " (-9-6j): 4770727675372666,\n", " (-9-7j): 4912596128143536,\n", " (-9-8j): 5007995812898881,\n", " (-9-9j): 5055942993011655,\n", " (-8-9j): 10208781070181753,\n", " (-7-9j): 10453043267410964,\n", " (-6-9j): 10751873139767811,\n", " (-5-9j): 11059518314467835,\n", " (-4-9j): 11376759350358675,\n", " (-3-9j): 11703920772595793,\n", " (-2-9j): 12041344951575315,\n", " (-1-9j): 12389387445169195,\n", " -9j: 12748417651053851,\n", " (1-9j): 13118819420877257,\n", " (2-9j): 13500991688937964,\n", " (3-9j): 13895348869815639,\n", " (4-9j): 14302320551550824,\n", " (5-9j): 14722332600201227,\n", " (6-9j): 15155769652228762,\n", " (7-9j): 15601367485469404,\n", " (8-9j): 16056192492543400,\n", " (9-9j): 16361984629545832,\n", " (10-9j): 16515656777294873,\n", " (10-8j): 33341796992525272,\n", " (10-7j): 34124354395013021,\n", " (10-6j): 35081342753590467,\n", " (10-5j): 36065959796279730,\n", " (10-4j): 37080631948406206,\n", " (10-3j): 38126350873431525,\n", " (10-2j): 39204161737718929,\n", " (10-1j): 40315148801938769,\n", " (10+0j): 41460437295339664,\n", " (10+1j): 42641195169132917,\n", " (10+2j): 43858634888142969,\n", " (10+3j): 45114014542813885,\n", " (10+4j): 46408636896192460,\n", " (10+5j): 47743792319747210,\n", " (10+6j): 49120645551873582,\n", " (10+7j): 50535252009964374,\n", " (10+8j): 51978495968644295,\n", " (10+9j): 52948650877173094,\n", " (10+10j): 53436136419328028,\n", " (9+10j): 107856981607454636,\n", " (8+10j): 110338442123416991,\n", " (7+10j): 113371754444310536,\n", " (6+10j): 116490696183757913,\n", " (5+10j): 119702724304785874,\n", " (4+10j): 123010831816362090,\n", " (3+10j): 126418170051599051,\n", " (2+10j): 129928004651265968,\n", " (1+10j): 133543720872193799,\n", " 10j: 137268828552560082,\n", " (-1+10j): 141106967288983787,\n", " (-2+10j): 145061911711060200,\n", " (-3+10j): 149137574700435332,\n", " (-4+10j): 153338004381029535,\n", " (-5+10j): 157667207440408708,\n", " (-6+10j): 162128798589834767,\n", " (-7+10j): 166710204179275661,\n", " (-8+10j): 171382471227544513,\n", " (-9+10j): 174522671248016151,\n", " (-10+10j): 176100410130177080,\n", " (-10+9j): 355387180080050344,\n", " (-10+8j): 363415504603474737,\n", " (-10+7j): 373225621348442080,\n", " (-10+6j): 383307094227935364,\n", " (-10+5j): 393683379038643645,\n", " (-10+4j): 404363738324235200,\n", " (-10+3j): 415357916298238545,\n", " (-10+2j): 426676001265056814,\n", " (-10+1j): 438328441165255726,\n", " (-10+0j): 450326058029835657,\n", " (-10-1j): 462680063025437978,\n", " (-10-2j): 475402071759168971,\n", " (-10-3j): 488504113446504015,\n", " (-10-4j): 501998621532213996,\n", " (-10-5j): 515897893043200175,\n", " (-10-6j): 530213016121710905,\n", " (-10-7j): 544904335738125988,\n", " (-10-8j): 559880870672180060,\n", " (-10-9j): 569944809478090596,\n", " (-10-10j): 575000752471102251,\n", " (-9-10j): 1160210286012386255,\n", " (-8-10j): 1185928053342990627,\n", " (-7-10j): 1217341750820351155,\n", " (-6-10j): 1249606185541997765,\n", " (-5-10j): 1282794336346592086,\n", " (-4-10j): 1316934534784014389,\n", " (-3-10j): 1352056559858544172,\n", " (-2-10j): 1388191213027884475,\n", " (-1-10j): 1425370363075682836,\n", " -10j: 1463626987592783139,\n", " (1-10j): 1502995216353652211,\n", " (2-10j): 1543510376333283071,\n", " (3-10j): 1585209037443587498,\n", " (4-10j): 1628129039465155188,\n", " (5-10j): 1672309462269136001,\n", " (6-10j): 1717788932007035394,\n", " (7-10j): 1764602261637276960,\n", " (8-10j): 1812621806244835596,\n", " (9-10j): 1861555640144219701,\n", " (10-10j): 1894433281551060406,\n", " (11-10j): 1910948938328355279,\n", " (11-9j): 3855239673649235830,\n", " (11-8j): 3939221481814068996,\n", " (11-7j): 4041768975955197756,\n", " (11-6j): 4147040632900080974,\n", " (11-5j): 4255268567398357377,\n", " (11-4j): 4366541510016474838,\n", " (11-3j): 4480952654576031498,\n", " (11-2j): 4598598315989120721,\n", " (11-1j): 4719578063824118083,\n", " (11+0j): 4843994845090529433,\n", " (11+1j): 4971955112443144983,\n", " (11+2j): 5103568957043234754,\n", " (11+3j): 5238950243370384068,\n", " (11+4j): 5378216687129137623,\n", " (11+5j): 5521489761896950875,\n", " (11+6j): 5668889451778536041,\n", " (11+7j): 5820523845309018292,\n", " (11+8j): 5975986244164800055,\n", " (11+9j): 6134349527429945472,\n", " (11+10j): 6240734314726446594,\n", " (11+11j): 6294170451145774622,\n", " (10+11j): 12696197883899003880,\n", " (9+11j): 12967829444049203535,\n", " (8+11j): 13299396622224385698,\n", " (7+11j): 13639597514975871138,\n", " (6+11j): 13989162689908725461,\n", " (5+11j): 14348366942213631338,\n", " (4+11j): 14717498668386378353,\n", " (3+11j): 15096855674905605462,\n", " (2+11j): 15486745570480664280,\n", " (1+11j): 15887486124556684129,\n", " 11j: 16299405641270421797,\n", " (-1+11j): 16722843348823025866,\n", " (-2+11j): 17158149802523505185,\n", " (-3+11j): 17605687293316030252,\n", " (-4+11j): 18065830079837903827,\n", " (-5+11j): 18538964090249176837,\n", " (-6+11j): 19025470300458695973,\n", " (-7+11j): 19525691774455350914,\n", " (-8+11j): 20038307121110187239,\n", " (-9+11j): 20560312673715924983,\n", " (-10+11j): 20910935755094118214,\n", " (-11+11j): 21087036165224295294,\n", " (-11+10j): 42529459510528640932,\n", " (-11+9j): 43424362605342343093,\n", " (-11+8j): 44516390911374310254,\n", " (-11+7j): 45636339131554162435,\n", " (-11+6j): 46786555226169183524,\n", " (-11+5j): 47967909437759997733,\n", " (-11+4j): 49181314471421115123,\n", " (-11+3j): 50427712127308645682,\n", " (-11+2j): 51708074486037196767,\n", " (-11+1j): 53023404986497344964,\n", " (-11+0j): 54374739548717874325,\n", " (-11-1j): 55763147741532316931,\n", " (-11-2j): 57189733989763427895,\n", " (-11-3j): 58655638796501314877,\n", " (-11-4j): 60162039424523233063,\n", " (-11-5j): 61710148955220358139,\n", " (-11-6j): 63301164200123395207,\n", " (-11-7j): 64936162422655412160,\n", " (-11-8j): 66610892438543808804,\n", " (-11-9j): 68315718871165181711,\n", " (-11-10j): 69460664433114374558,\n", " (-11-11j): 70035665185585476809,\n", " (-10-11j): 141231540657183339873,\n", " (-9-11j): 144152679749009819006,\n", " (-8-11j): 147716159839185547043,\n", " (-7-11j): 151369035828890886590,\n", " (-6-11j): 155118778101599827596,\n", " (-5-11j): 158968113158272431836,\n", " (-4-11j): 162919898589261582483,\n", " (-3-11j): 166977080896932025519,\n", " (-2-11j): 171142699032894137002,\n", " (-1-11j): 175419887596590487452,\n", " -11j: 179811880163612605638,\n", " (1-11j): 184322012743892324059,\n", " (2-11j): 188953727374022846839,\n", " (3-11j): 193710575827264872596,\n", " (4-11j): 198596223366442751283,\n", " (5-11j): 203614450800184077866,\n", " (6-11j): 208769151456097526221,\n", " (7-11j): 214064164455986674171,\n", " (8-11j): 219502944164013006428,\n", " (9-11j): 225071554891953122131,\n", " (10-11j): 230738492751976757517,\n", " (11-11j): 234543874971856173202,\n", " (12-11j): 236454823910184528481,\n", " (12-10j): 476764887494018292792,\n", " (12-9j): 486470297587809952897,\n", " (12-8j): 498306527719228455479,\n", " (12-7j): 510434558809897803205,\n", " (12-6j): 522878636986151439312,\n", " (12-5j): 535647487696466352501,\n", " (12-4j): 548750250428457216214,\n", " (12-3j): 562196342909038843271,\n", " (12-2j): 575995471943428113573,\n", " (12-1j): 590157643168331881810,\n", " (12+0j): 604693171189689674309,\n", " (12+1j): 619612690104266583479,\n", " (12+2j): 634927164417123347284,\n", " (12+3j): 650647900304666103729,\n", " (12+4j): 666786556997062576295,\n", " (12+5j): 683355152897867200834,\n", " (12+6j): 700366055956851706042,\n", " (12+7j): 717831455498104060430,\n", " (12+8j): 735762315115007824249,\n", " (12+9j): 754113385201329016370,\n", " (12+10j): 772782639494631183058,\n", " (12+11j): 785317544260503404274,\n", " (12+12j): 791611714711649178896,\n", " (11+12j): 1595919627307197361672,\n", " (10+12j): 1627877825086291343709,\n", " (9+12j): 1666841249036463936822,\n", " (8+12j): 1706748072617713397193,\n", " (7+12j): 1747676229444822379490,\n", " (6+12j): 1789653356591920607427,\n", " (5+12j): 1832708384892429342579,\n", " (4+12j): 1876871106177934957732,\n", " (3+12j): 1922172206091707605827,\n", " (2+12j): 1968643293461650559698,\n", " (1+12j): 2016316930797958329904,\n", " 12j: 2065226665912608461696,\n", " (-1+12j): 2115407064705225414544,\n", " (-2+12j): 2166893745149887975847,\n", " (-3+12j): 2219723412325565415111,\n", " (-4+12j): 2273933893788968526027,\n", " (-5+12j): 2329564158259514302664,\n", " (-6+12j): 2386654284424677526388,\n", " (-7+12j): 2445243753620701760514,\n", " (-8+12j): 2505368065189983223650,\n", " (-9+12j): 2566877620739903454086,\n", " (-10+12j): 2629435905333937792577,\n", " (-11+12j): 2671433877254256206085,\n", " (-12+12j): 2692520913419480501379,\n", " (-12+11j): 5427571286349489643690,\n", " (-12+10j): 5534612144630584923009,\n", " (-12+9j): 5665082357657830217288,\n", " (-12+8j): 5798659450306101033070,\n", " (-12+7j): 5935598735575198689283,\n", " (-12+6j): 6075989539370682032975,\n", " (-12+5j): 6219925318506032329355,\n", " (-12+4j): 6367502254542522087893,\n", " (-12+3j): 6518819355627289045465,\n", " (-12+2j): 6673978547227132232878,\n", " (-12+1j): 6833084766248384648934,\n", " (-12+0j): 6996246058525132185154,\n", " (-12-1j): 7163573679805145804305,\n", " (-12-2j): 7335182200332942864008,\n", " (-12-3j): 7511189612543730839843,\n", " (-12-4j): 7691717439719975745922,\n", " (-12-5j): 7876890792299842732331,\n", " (-12-6j): 8066838267877841897837,\n", " (-12-7j): 8261686486939164514008,\n", " (-12-8j): 8461549260671528916683,\n", " (-12-9j): 8665936536414352281756,\n", " (-12-10j): 8873748584904217314834,\n", " (-12-11j): 9013244914522917166201,\n", " (-12-12j): 9083280579708502643010,\n", " (-11-12j): 18307792700074188625893,\n", " (-10-12j): 18663212585665967261581,\n", " (-9-12j): 19096312965911345967503,\n", " (-8-12j): 19539550841328432220142,\n", " (-7-12j): 19993754815098108481371,\n", " (-6-12j): 20459210742186871627393,\n", " (-5-12j): 20936217532036005469308,\n", " (-4-12j): 21425082624680471509146,\n", " (-3-12j): 21926122303199559254150,\n", " (-2-12j): 22439661970725975904123,\n", " (-1-12j): 22966036437519073134215,\n", " -12j: 23505590218023168551364,\n", " (1-12j): 24058677838304696327900,\n", " (2-12j): 24625664154249876371394,\n", " (3-12j): 25206924680817606842112,\n", " (4-12j): 25802845930811498543857,\n", " (5-12j): 26413825756434222899227,\n", " (6-12j): 27040273523146491177485,\n", " (7-12j): 27682609783222588384305,\n", " (8-12j): 28341248446734541187035,\n", " (9-12j): 29016561438542484073111,\n", " (10-12j): 29706915361158270125961,\n", " (11-12j): 30408652552792287585161,\n", " (12-12j): 30879651251674328286844,\n", " (13-12j): 31116106075584512815325,\n", " (13-11j): 62708977038663043923442,\n", " (13-10j): 63908667047655056697612,\n", " (13-9j): 65370208760456113398780,\n", " (13-8j): 66865420144573049610361,\n", " (13-7j): 68397039868088327308357,\n", " (13-6j): 69966000551580842903375,\n", " (13-5j): 71573276926691917911402,\n", " (13-4j): 73219871007725880323388,\n", " (13-3j): 74906813073006804496446,\n", " (13-2j): 76635162531027603335100,\n", " (13-1j): 78406008817329053004792,\n", " (13+0j): 80220472321791341144390,\n", " (13+1j): 82079705347502420749462,\n", " (13+2j): 83984893102328476783954,\n", " (13+3j): 85937254724047328811262,\n", " (13+4j): 87938044334246924692120,\n", " (13+5j): 89988552100098706175291,\n", " (13+6j): 92090104764451529142597,\n", " (13+7j): 94244064591021492733318,\n", " (13+8j): 96451771746835933634367,\n", " (13+9j): 98714430086646901658044,\n", " (13+10j): 101026643655603365261746,\n", " (13+11j): 103376355554070149027974,\n", " (13+12j): 104953284813042301611144,\n", " (13+13j): 105744896527753950790040,\n", " (12+13j): 213085712682815098941752,\n", " (11+13j): 217101121849920236826029,\n", " (10+13j): 221991760551350189468232,\n", " (9+13j): 226993227698090658145956,\n", " (8+13j): 232114493249189657859461,\n", " (7+13j): 237358570907844114243571,\n", " (6+13j): 242728608878773286573067,\n", " (5+13j): 248227841726435571480805,\n", " (4+13j): 253859593423597643386943,\n", " (3+13j): 259627280029328936510200,\n", " (2+13j): 265534412459680253005629,\n", " (1+13j): 271584599349852470356927,\n", " 13j: 277781550011268262563071,\n", " (-1+13j): 284129077487035984415158,\n", " (-2+13j): 290631101709216663220660,\n", " (-3+13j): 297291652760481085137645,\n", " (-4+13j): 304114874224855133381447,\n", " (-5+13j): 311105026561328293736526,\n", " (-6+13j): 318266488757633187326092,\n", " (-7+13j): 325603754860868549836644,\n", " (-8+13j): 333121244300419138274894,\n", " (-9+13j): 340822925891682962745207,\n", " (-10+13j): 348690673295011060197955,\n", " (-11+13j): 356684063991018734697996,\n", " (-12+13j): 362048018781692471405460,\n", " (-13+13j): 364740539695111951906839,\n", " (-13+12j): 734908650676573393457368,\n", " (-13+11j): 748563355020972948525446,\n", " (-13+10j): 765190620809610853309433,\n", " (-13+9j): 782188974762205369482800,\n", " (-13+8j): 799588315305744499422441,\n", " (-13+7j): 817398563030996481177769,\n", " (-13+6j): 835630076624448394229382,\n", " (-13+5j): 854293493736867630679605,\n", " (-13+4j): 873399740665543474142318,\n", " (-13+3j): 892960040822940417508554,\n", " (-13+2j): 912985923492043223435831,\n", " (-13+1j): 933489232864043872502797,\n", " (-13+0j): 954482137368622535141190,\n", " (-13-1j): 975977139307285755994657,\n", " (-13-2j): 997987084799967575502813,\n", " (-13-3j): 1020525174052564224952586,\n", " (-13-4j): 1043604971897127774270682,\n", " (-13-5j): 1067240418397025434646772,\n", " (-13-6j): 1091445833944142283790948,\n", " (-13-7j): 1116235907959630819119476,\n", " (-13-8j): 1141625080243655864831923,\n", " (-13-9j): 1167626314625645963345196,\n", " (-13-10j): 1194179244661487450107987,\n", " (-13-11j): 1221149518740623087232032,\n", " (-13-12j): 1239246044234854507041243,\n", " (-13-13j): 1248329324814563009684253,\n", " (-12-13j): 2514966442329200207994399,\n", " (-11-13j): 2561020728194648866524883,\n", " (-10-13j): 2617088046446300368379860,\n", " (-9-13j): 2674387122839206113829086,\n", " (-8-13j): 2733016741461544000498102,\n", " (-7-13j): 2793009257860157412827008,\n", " (-6-13j): 2854398440949478398405080,\n", " (-5-13j): 2917218951848381747010927,\n", " (-4-13j): 2981506374308297783243531,\n", " (-3-13j): 3047297241206903789910950,\n", " (-2-13j): 3114629061918348398203438,\n", " (-1-13j): 3183540350544616615793140,\n", " -13j: 3254070655038463553806619,\n", " (1-13j): 3326260587249041295057277,\n", " (2-13j): 3400151853922413474598683,\n", " (3-13j): 3475787288688292456356046,\n", " (4-13j): 3553210885056355784641242,\n", " (5-13j): 3632467830266747997261811,\n", " (6-13j): 3713604539329551299722828,\n", " (7-13j): 3796668671082654920471653,\n", " (8-13j): 3881709090751154534116104,\n", " (9-13j): 3968773815997589829502211,\n", " (10-13j): 4057905945350082871286444,\n", " (11-13j): 4148901164515707757284410,\n", " (12-13j): 4241305574395758885971740,\n", " (13-13j): 4303301331723017727073909,\n", " (14-13j): 4334417437798602239889234,\n", " (14-12j): 8731543852635867523701910,\n", " (14-11j): 8889277602797770137138289,\n", " (14-10j): 9081265455644544351158123,\n", " (14-9j): 9277409751597228570864876,\n", " (14-8j): 9478042420370346061182374,\n", " (14-7j): 9683270880934588281004467,\n", " (14-6j): 9893207198280949369127601,\n", " (14-5j): 10107966346766948010265766,\n", " (14-4j): 10327666307774372612997002,\n", " (14-3j): 10552428154386132901151936,\n", " (14-2j): 10782376138807496361988274,\n", " (14-1j): 11017637782477644359472556,\n", " (14+0j): 11258343968964267174371200,\n", " (14+1j): 11504629039735889413049006,\n", " (14+2j): 11756630892909767639393684,\n", " (14+3j): 12014491085070390369681020,\n", " (14+4j): 12278354936228783329359693,\n", " (14+5j): 12548371637427580489369701,\n", " (14+6j): 12824694358883152217420907,\n", " (14+7j): 13107480299985461172931189,\n", " (14+8j): 13396890566409965500956918,\n", " (14+9j): 13693083411899051701511075,\n", " (14+10j): 13996200841195372117458839,\n", " (14+11j): 14305557125218087933359703,\n", " (14+12j): 14619631662112954334788861,\n", " (14+13j): 14830329843453750587190045,\n", " (14+14j): 14936074739981504537980085,\n", " (13+14j): 30085235192645824174901922,\n", " (12+14j): 30621166923706313461459743,\n", " (11+14j): 31273345518790398986695756,\n", " (10+14j): 31939431628889760071135973,\n", " (9+14j): 32620531110388390576609622,\n", " (8+14j): 33316997402243515006858610,\n", " (7+14j): 34029199075279322065534709,\n", " (6+14j): 34757514096792375037832152,\n", " (5+14j): 35502330140821181539272967,\n", " (4+14j): 36264044856000543690650915,\n", " (3+14j): 37043066141913150523553687,\n", " (2+14j): 37839812433752012183426443,\n", " (1+14j): 38654712995572813169352070,\n", " 14j: 39488208222420969886687226,\n", " (-1+14j): 40340749951628490796886115,\n", " (-2+14j): 41212801783585224529659578,\n", " (-3+14j): 42104839412279777411399330,\n", " (-4+14j): 43017350965826441923654948,\n", " (-5+14j): 43950837355370258538099013,\n", " (-6+14j): 44905812625550088568998275,\n", " (-7+14j): 45882804113469009444435905,\n", " (-8+14j): 46882352038521980095292650,\n", " (-9+14j): 47904986882009093256510706,\n", " (-10+14j): 48951184545186806014151864,\n", " (-11+14j): 50018607301254528280453275,\n", " (-12+14j): 51102079923722351438463570,\n", " (-13+14j): 51828868482199155861775869,\n", " (-14+14j): 52193609021894267813682708,\n", " (-14+13j): 105122126694465109020822784,\n", " (-14+12j): 106970339239857767314712437,\n", " (-14+11j): 109219001866364924510004684,\n", " (-14+10j): 111514944816957713681322363,\n", " (-14+9j): 113861912727835274403537037,\n", " (-14+8j): 116261088580934220753620047,\n", " (-14+7j): 118713705535895410128449639,\n", " (-14+6j): 121221027669287722634536395,\n", " (-14+5j): 123784350980314582133587700,\n", " (-14+4j): 126405004255539933655918177,\n", " (-14+3j): 129084349960520460771004880,\n", " (-14+2j): 131823785157699488284452062,\n", " (-14+1j): 134624742451424197915531880,\n", " (-14+0j): 137488690960964150079170524,\n", " (-14-1j): 140417137322440025945809184,\n", " (-14-2j): 143411626720599843502259240,\n", " (-14-3j): 146473743951349503076985321,\n", " (-14-4j): 149605114515696220510855361,\n", " (-14-5j): 152807405739934516003563763,\n", " (-14-6j): 156082327900235314541120959,\n", " (-14-7j): 159431634722382743508863306,\n", " (-14-8j): 162857122025211676156159901,\n", " (-14-9j): 166360552664742465434445007,\n", " (-14-10j): 169943507742770221935130222,\n", " (-14-11j): 173598082550407186979511484,\n", " (-14-12j): 177306807438197227583469012,\n", " (-14-13j): 179794382807246645100194508,\n", " (-14-14j): 181042712132061208109878761,\n", " (-13-14j): 364600390706451616427751921,\n", " (-12-14j): 370924707201790028511955456,\n", " (-11-14j): 378617782418760177954854598,\n", " (-10-14j): 386470278316240333303588427,\n", " (-9-14j): 394494770226987383786295475,\n", " (-8-14j): 402695183349148291313449671,\n", " (-7-14j): 411075607789419471125179861,\n", " (-6-14j): 419640234440077488683422876,\n", " (-5-14j): 428393358207183646612082414,\n", " (-4-14j): 437339380774547229932247822,\n", " (-3-14j): 446482813451980779903605741,\n", " (-2-14j): 455828280105650648707513269,\n", " (-1-14j): 465380520173152077275316466,\n", " -14j: 475144391765984198739973502,\n", " (1-14j): 485124874862194117063436081,\n", " (2-14j): 495327074592053864289448087,\n", " (3-14j): 505756224619720926005044058,\n", " (4-14j): 516417690623732322243303157,\n", " (5-14j): 527316973878384977324929038,\n", " (6-14j): 538459714919063931542385330,\n", " (7-14j): 549851697220227292296695915,\n", " (8-14j): 561498848798058691580785883,\n", " (9-14j): 573407237650157518815690642,\n", " (10-14j): 585582818576020899273763707,\n", " (11-14j): 598030931260282448788306301,\n", " (12-14j): 610724439330916933158636360,\n", " (13-14j): 623603463674834312011571243,\n", " (14-14j): 632241182444355931978534386,\n", " (15-14j): 636575599882154534218423620,\n", " (15-13j): 1281882743616944935960549150,\n", " (15-12j): 1303837982510177175861278583,\n", " (15-11j): 1330540069421255357873276905,\n", " (15-10j): 1357788022231294900932438193,\n", " (15-9j): 1385624739858907019915643566,\n", " (15-8j): 1414063462911809182828695283,\n", " (15-7j): 1443117983411395066540009725,\n", " (15-6j): 1472802427837377552200407559,\n", " (15-5j): 1503131267690199822192797928,\n", " (15-4j): 1534119328499127275717212632,\n", " (15-3j): 1565781799100095277593349844,\n", " (15-2j): 1598134241175766551215962610,\n", " (15-1j): 1631192599066015959111794640,\n", " (15+0j): 1664973209857193760058687402,\n", " (15+1j): 1699492813758803684285501292,\n", " (15+2j): 1734768564776519731707625002,\n", " (15+3j): 1770818041690728673046059399,\n", " (15+4j): 1807659259349455427234469813,\n", " (15+5j): 1845310680281994943270620114,\n", " (15+6j): 1883791226578291137150341911,\n", " (15+7j): 1923120291803569716041650925,\n", " (15+8j): 1963317746081864194417050107,\n", " (15+9j): 2004403920901368583736976939,\n", " (15+10j): 2046398762279681095489306556,\n", " (15+11j): 2089320151908207509874913959,\n", " (15+12j): 2133075670538992302730252568,\n", " (15+13j): 2177461706784540512190211559,\n", " (15+14j): 2207228111367975767315381689,\n", " (15+15j): 2222164186107957271853361774,\n", " (14+15j): 4474413607408560367881625470,\n", " (13+15j): 4550056084264894010055967220,\n", " (12+15j): 4642035831900036546679024641,\n", " (11+15j): 4735869775971423019198316113,\n", " (10+15j): 4831703084229491568832757464,\n", " (9+15j): 4929580044371013234487361669,\n", " (8+15j): 5029546771958924462136364610,\n", " (7+15j): 5131650482533239674246590081,\n", " (6+15j): 5235939525846132552889229909,\n", " (5+15j): 5342463414939746653156985943,\n", " (4+15j): 5451272856078481528910463512,\n", " (3+15j): 5562419779510147235308094557,\n", " (2+15j): 5675957371081385211184426757,\n", " (1+15j): 5791940104733131006423892496,\n", " 15j: 5910423775902753280276817907,\n", " (-1+15j): 6031465535860387965490050826,\n", " (-2+15j): 6155123927007881458227995849,\n", " (-3+15j): 6281458919169572902092709705,\n", " (-4+15j): 6410531946903049379965862996,\n", " (-5+15j): 6542405947849796168996615232,\n", " (-6+15j): 6677145401944185525548148425,\n", " (-7+15j): 6814816370721726603656875255,\n", " (-8+15j): 6955486513755726686453114516,\n", " (-9+15j): 7099225037221444565819069736,\n", " (-10+15j): 7246099815949894993370185581,\n", " (-11+15j): 7396171687720058679103254290,\n", " (-12+15j): 7549121243427234714683947004,\n", " (-13+15j): 7704245800855050489797869151,\n", " (-14+15j): 7808268278359143913473327728,\n", " (-15+15j): 7860461887381038181287010436,\n", " (-15+14j): 15826045901456541471594843656,\n", " (-15+13j): 16090331976412758615744061585,\n", " (-15+12j): 16411643444213446416589601490,\n", " (-15+11j): 16739347730136626822095640974,\n", " (-15+10j): 17073943589547784734690505058,\n", " (-15+9j): 17415581535673511943528984505,\n", " (-15+8j): 17764418242518176848814591228,\n", " (-15+7j): 18120614064304294202331197309,\n", " (-15+6j): 18484333148489791917227771043,\n", " (-15+5j): 18855743531394934155651813315,\n", " (-15+4j): 19235017236591309132212324072,\n", " (-15+3j): 19622330375965069014923699191,\n", " (-15+2j): 20017863253534713161894688013,\n", " (-15+1j): 20421800472104800998173842479,\n", " (-15+0j): 20834331042839629372114354067,\n", " (-15-1j): 21255648497843633391641593015,\n", " (-15-2j): 21685951005838022764166646760,\n", " (-15-3j): 22125441491025668331256746682,\n", " (-15-4j): 22574327755232648570848151127,\n", " (-15-5j): 23032822603388514621903691210,\n", " (-15-6j): 23501143971751067195957239238,\n", " (-15-7j): 23979515056398896930163383404,\n", " (-15-8j): 24468164365811233815262851618,\n", " (-15-9j): 24967325548243958178788586748,\n", " (-15-10j): 25477227691201878053137673461,\n", " (-15-11j): 25998076088933252689635784179,\n", " (-15-12j): 26528775361729103749298959183,\n", " (-15-13j): 27066919264106608830092501464,\n", " (-15-14j): 27427756359045916683302574733,\n", " (-15-15j): 27608799071177977891412453494,\n", " (-14-15j): 55582198533062407399252658909,\n", " (-13-15j): 56498766343102710252302245047,\n", " (-12-15j): 57612909223429712075196807022,\n", " (-11-15j): 58748921991366502614967205503,\n", " (-10-15j): 59908504822328490510011944003,\n", " (-9-15j): 61092165054220866518415277576,\n", " (-8-15j): 62300430615586421664640202583,\n", " (-7-15j): 63533841641165066915762254991,\n", " (-6-15j): 64792950841601747522182940142,\n", " (-5-15j): 66078323815023555887410693254,\n", " (-4-15j): 67390539367457267543858629231,\n", " (-3-15j): 68730189841789446202401996063,\n", " (-2-15j): 70097881455520229708288431539,\n", " (-1-15j): 71494234647565016633011234776,\n", " -15j: 72919884434366347026089960825,\n", " (1-15j): 74375480775586579206182818495,\n", " (2-15j): 75861688949660548113540746721,\n", " (3-15j): 77379189939496055226078542023,\n", " (4-15j): 78928680828617893451651818276,\n", " (5-15j): 80510875208039074682762435801,\n", " (6-15j): 82126503594056750883926446084,\n", " (7-15j): 83776313854994100799346313212,\n", " (8-15j): 85461071638662544302039485652,\n", " (9-15j): 87181560543686781411709725884,\n", " (10-15j): 88938581531173242278587486534,\n", " (11-15j): 90732919720340462559808192902,\n", " (12-15j): 92565278554606496253766706806,\n", " (13-15j): 94431847640056603430915448795,\n", " (14-15j): 96324267886057948209123978044,\n", " (15-15j): 97593084668384458675320936050,\n", " (16-15j): 98229660268266613209539359670,\n", " (16-14j): 197741203280150171355039268490,\n", " (16-13j): 200963499606159448001079519843,\n", " (16-12j): 204879760401707825470774624481,\n", " (16-11j): 208871926475870552905441618162,\n", " (16-10j): 212945879307382010184162976826,\n", " (16-9j): 217103355532384021287839753868,\n", " (16-8j): 221346161718566132557124102442,\n", " (16-7j): 225676145592726714358693215009,\n", " (16-6j): 230095197271665686799626430221,\n", " (16-5j): 234605250295692391449736848340,\n", " (16-4j): 239208282690981813825240208744,\n", " (16-3j): 243906318059756802929766733830,\n", " (16-2j): 248701426699098680717687840924,\n", " (16-1j): 253595726749197656988074285576,\n", " (16+0j): 258591385371879670391530268910,\n", " (16+1j): 263690619960272187567582082606,\n", " (16+2j): 268895699380498239656621268299,\n", " (16+3j): 274208945246314943488609422513,\n", " (16+4j): 279632733227637122532160571839,\n", " (16+5j): 285169494393846864039816003677,\n", " (16+6j): 290821716592510719836278616627,\n", " (16+7j): 296591945856974444883887659570,\n", " (16+8j): 302482787815761247378083337541,\n", " (16+9j): 308496908245024161251726671143,\n", " (16+10j): 314637031080113418440827868597,\n", " (16+11j): 320905825664840299348922341680,\n", " (16+12j): 327305683194072039673717719766,\n", " (16+13j): 333823448682763548255953565582,\n", " (16+14j): 340430302687024021807312520604,\n", " (16+15j): 344859694984499954846481264067,\n", " (16+16j): 347081859170607912118334625841,\n", " (15+16j): 698638131948624384604550877152,\n", " (14+16j): 709884765826405796254341831616,\n", " (13+16j): 723551271349979287178958448947,\n", " (12+16j): 737479233042115640754891756921,\n", " (11+16j): 751688841734216591889601855139,\n", " (10+16j): 766185994638788519712120290385,\n", " (9+16j): 780976824539347948977576774128,\n", " ...}" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "values" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "330785\n" ] } ], "source": [ "for key in values:\n", " if values[key] > input:\n", " print(values[key])\n", " break" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 4 (passphrases)" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [], "source": [ "passphrases = \"\"\"kvvfl kvvfl olud wjqsqa olud frc\n", "slhm rdfm yxb rsobyt rdfm\n", "pib wzfr xyoakcu zoapeze rtdxt rikc jyeps wdyo hawr xyoakcu hawr\n", "ismtq qwoi kzt ktgzoc gnxblp dzfayil ftfx asscba ionxi dzfayil qwoi\n", "dzuhys kfekxe nvdhdtj hzusdy xzhehgc dhtvdnj oxwlvef\n", "gxg qahl aaipx tkmckn hcsuhy jsudcmy kcefhpn kiasaj tkmckn\n", "roan kqnztj edc zpjwb\n", "yzc roc qrygby rsvts nyijgwr xnpqz\n", "jqgj hhgtw tmychia whkm vvxoq tfbzpe ska ldjmvmo\n", "nyeeg omn geyen ngyee rcjt rjuxh\n", "qpq udci tnp fdfk kffd eyzvmg ufppf wfuodj toamfn tkze jzsb\n", "rrcgxyp rbufd tfjmok vpyhej hcnz ftkojm\n", "jnmomfc jnmomfc bkluz izn ovvm flsch bkluz\n", "odisl hzwv hiasrhi hez ihihsra qpbmi ltwjj iknkwxf nbdtq gbo\n", "gjtszl gjtszl fruo fruo\n", "rdapv gaik cqboix sxnizhh uxmpali jdd usqnz advrp dze\n", "flooz flooz qad tcrq yze bnoijff qpqu vup hyagwll\n", "lnazok dze foi tqwjsk hpx qcql euzpj mwfrk\n", "ilb fmviby ivybmf gtx xtg\n", "rpauuu timere gyg wcolt ireetm safi\n", "croe szwmq bbhd lciird vhcci pdax\n", "hnc ykswt qqqmei goe bri wmyai hnc qpgqc pberqf bzs\n", "hsnrb wdvh iezzrq iezzrq rdbmpta iezzrq kemnptg alkjnp wymmz\n", "ngw don ddvyds nlhkoa aaf gptumum ugtpmmu\n", "vmccke qbpag kvf kvf tgrfghb kvf bhpd sglgx\n", "obomgk bkcgo yso ttft vbw ckl wjgk\n", "fli qvw zhin dfpgfjb udsin nihz ovr tiewo\n", "tgmzmph hauzieo jmg tdbtl lvfr qpaayq qapaqy ausioeu jun piygx\n", "jkp guqrnx asdqmxf vmfvtqb tloqgyo ioix gajowri tmek ilc puhipb\n", "uycn zxqm znft ayal znacus kvcyd ekv qqfpnh\n", "fqghur xtbtdd ztjrylr bpuikb ziyk\n", "rvakn uqbl ozitpdh uqbl dsej xehj\n", "laxp haz jyd xnkrb ijldth woy xapl iqgg alpx gnupa ukptmmh\n", "dyiy dyiy ihb qcyxr\n", "wbwkd hdwu zvgkn hdwu wjc sakwhn zxujdo npllzp uyr uyr\n", "fxczpmn cininu akcxs ggslxr riyxe ojisxe\n", "ppbch sampq dnct afikor dnct edsqy pnzyzmc afikor\n", "jnvygtn hijqjxl vsd jnvygtn nqcqv zns odq gkboxrv kolnq wrvd\n", "mroq mroq flsbu flsbu\n", "fyshor xvpaunj qmktlo xoce wkiyfu ukcl srndc ugwylwm ozcwdw mtqcste kpokr\n", "cfh cxjvx cfh cfh uewshh\n", "bpspbap bpspbap fquj mxmn bwls iirhvuk dmpkyt exrn mxmn\n", "tvyvzk ezszod ntxr xtnr och\n", "knfxhy kbnyl knfxhy xhkssx lxru uprh nkxpbx oodolxr tpvyf\n", "nblmysu iwoffs upgof tyagwf aan vovji ajk ywzq oyfi sfulz\n", "aushzkm lcaeki mkuzsah ynxvte rsntd refk pcm\n", "mgguob gobmug dzenpty gmogbu\n", "yvq eepof rgnree nerger fpb stfrln ernger\n", "hrgkbl mzwvswk rsrsbk ieru holco pajvvn ztgsr qkyp fyeg owpcmoj\n", "fowda gmsqdca yugj mcrroxv mqcbojd fjnqfji qdfsc jqs\n", "qnc rvjfz vvxk sjd xrma ucdjvq sbw zydyt dfzww\n", "ocajazv cozaajv tqunkla udwf ecnnmbz lsakqg bki njnda zsdu ccfqw rxpc\n", "qqm qdfya qxyx qmq qfday uqnfttt\n", "rnbirb iapor qet iapor hxkhz dfvzig pedl ybyb\n", "mkgamxg xkniv meb hbzmxjn dhbj zhbxjmn hdjb\n", "ilteux pyutyfx mau lrr bacak\n", "sjjonmn dbbbgs crxyuu jztstgd ezb uiabyaa\n", "tra fle ufzlvf nnaw kec hiwnnlj tei wld iyt syk hjdczb\n", "qmd jtlud dgh dbanock fzp dsjgqru wwvo jwvxwgv xlemfij jcacd\n", "rpkx oxesil snazcgx fly miiyc ikmtmp oefyyn egbw\n", "ypfpeu wldnyd acchppb yqwcaw wldnyd turbz megci nbgxq xkc ypfpeu\n", "iqqv iqqv neui iqqv\n", "ypsxm icqyup zyetrwq nbisrv\n", "viommi toszx dpueq eyy cunjou ffcjc jaeez djefra pxvkj liudlig yye\n", "fhnacbg jghchh ghjhhc iue hwqmo\n", "vbjw lpn cizba ltnsfpz tzoweml irewlc uzckhpd mszal obd\n", "yeos utxkft hflxkfe fxczge qpgigkc ksgr vuumql vhlvv\n", "xzmkv xzmkv krecdi klpem jsbu nwcmik emfzxf cjmpgnj\n", "vtkjo pmiv zou gxo qdiyxsf hwyinjk jhkgf rjq\n", "dyuoc ywiyvch irfgl ywiyvch fxb fxb\n", "tuz onhr syu rqya abkaf bcfx mbknex juwoor zmksl\n", "oheg spjorx ksdy vwtq fxz phvtazk tcze lrxg\n", "hew lbup botaj ltr jpd\n", "dxgc tzinkej gnz hxvvub adsqmc dxgc asgpp rqbdcra goy pmamdua bhiacva\n", "xqv ygb kihxqz vyv pjcny vmyvsdv cgsi nfyx\n", "tqga ssshrw ndq qlbvwh huyd pxbgj qbxk dkkbf jxy chsobw pph\n", "hxl iwph iwph xnr otifm ljhre\n", "zlgvpd kapxpoc dve rklk ogh hgnp rbrmc zzkz hhmcx aklmo\n", "sar gfor nkf hek nkf aql shc aql\n", "dtcrw kfjzcjx qyhi bldson whwdayo mqtgt xhqzp ttqmg\n", "omspdml isze jdl nvwo qrkm wztfg ssfgyh dryj jhp unsmty\n", "jxt cszylng ifht ixtuna azoi xutqlv jtx tjx\n", "usgm azuayp fgkby ezpyq jqwl ezofj\n", "tnhvil nrvg moyrpqs sldx qymoff megflxh pyhqwms xmdw\n", "zomy zcquwnv lzx bvcna yods mjp dgsez\n", "blklyf xokd gpit tiysj yrwfhm tofx\n", "dtig vhdp omuj vhpd\n", "fogwxim qvdwig emdiv jvhl euwbzkg xvxb hwmqo ujdmlp epmykj\n", "sjxll sjxll pedvgb sjxll\n", "drvay gtzhgtx yrt okz nqf\n", "haxfazn pvkovwb pgu tgshw mxcjf pbe nwoymzc mxcjf pbe hydwy jradcr\n", "prjsloa ahylvj okbsj qbdcdjt pmfo pagyoeg vkmhjzt khzmjvt opfm xfrji gyjqyel\n", "lzypt jdbtrad ogr jdbtrad heink\n", "rcoucuq gdxewa rcoucuq whlw zhhm rcoucuq azaqohe mzyli rdvaf\n", "yuag ebcf yuag nsotg qqzuxr jfmao vyucw wmoye\n", "qwvk xemm hgqrr wyxkpp tojndm xlvzypw jus bgnu bgnu nklfwhs\n", "daqi knenmku ccm xkiuy vkexsbc kvvdagx umopitw yaocnx yoakqql mllmsp\n", "mrxgl gywit mfopia ncnsvw vdxek axuiot rsejua nei prndudz mnu\n", "egqn gaa qgen urs mix zbn rhn\n", "ewharq aihy udkdaob kgrdd kgrdd kugbjtj fcef llqb pduxaq wcexmm\n", "dwtiw nelq hppad algxgf gcc upou akm efnb mxmhrud\n", "yxqaa ups okbhgt iet qns tqn rnjqxgp\n", "npmhdm cgds ldexvr typi jyivoqk zkgq vfyxu xgfo\n", "dkwnmr umm dkwnmr okpjw wqx jpztebl eqsib dkwnmr\n", "dxbild wpbup evscivq dxbild dxbild geqp ojfbpl jshvqej\n", "cxdntxs csfocjd pyy tuhws teb boyloz xfw scxh pxhonky\n", "lteucke xrgwy hszgzu hnyrcvb\n", "pfgsgwg dxzh fworek qbstod\n", "usemcrf psczxu gcjtr brls\n", "hjol efxczux bqdn gvrnpey yyoqse gbam ndzyj lbwb bhzn unsezg\n", "bapw xifz blupk qqdk bofvqpp wnbuwyt rnwocu lzwgtt zucag pov\n", "xkre lqvd juf lqvd xio xyg xyg\n", "tzdao ztheib aymcf aorg iyawrch hetcxa iyawrch czdymc ccv\n", "ucgl azlppu jvxqlj pest\n", "dvwlw fuuy mnhmm okrp ualnqlm uyuznba fzyejk yaq crl ctprp\n", "odfq knox mkbcku pxucmuf lpjpol phl\n", "ixongh hfs ruorbd auy qyssl kykwcix aytsm rlj aytsm duq segpqhk\n", "izufsk wedpzh podjkor eamo vqvev ifnz podjkor xrnuqe\n", "twyfps bmdbgtu qye qkwjms\n", "wlav htym vhsnu cocphsj mdsuq vhsnu jflgmrp\n", "opajag itwjhfu purnnvk opajag\n", "hpkopqp vnj aialpt lzrkzfs nwucez nwuezc\n", "mcx hzcjxq zbxr dsx tpknx fva\n", "rlvgm xrejsvn ghawxb efyos xty wdzdgh olahbtn rga efyos vhtm nsr\n", "cni mbab qtgeiow ulttn rckc kmiaju jvbq emyvpew cdlxldn ulttn brhkprx\n", "eykpffp rapik qki fhjgdyu tome ehjuy bibjk htxd vexvag\n", "wrk dpxt gwkuiov gbkif ike gbkif pcd wpj toywyf qzsa aol\n", "yqwzh uujn ujun ujnu\n", "srs ralwxrz yxvvmgp sjhbhk waasid cqtxoxf whcladv jkmaq khjbsh dlavcwh\n", "mdvsjh xaj etvxlsy fxgiy rgjesel rlegesj ptriz ebdyhkp kugxm dxv egljser\n", "lhehwrs mqevb ygmv gri izop qgb ivm\n", "loqqam alojlwg hgen hbyw qlwpun loqqam worgnwk kope\n", "phozre todsknr todsknr ibj mvllsar\n", "wuripy ruwlfbh wukbkey qhq iishw tvtvci xawvxc vxacwx hsiwi ogq\n", "xryq vxwupqa zhqex aquxpwv bnvxrba dtbxki\n", "yvvwh zvsm vqskhp vqskhp ggqqlw bpn wbuv\n", "kqz tdy goqwge ygn jgd\n", "szjjhdk zkpoo nxexz ebicc\n", "wzuemcj oyd qupulju iaakzmt vzkvz\n", "nppahov umm wpzev wxkgfxd owgekp bhhb bbhh dgviiw kdfgxwx wryb\n", "bnc rhes lmbuhhy kwbefga bnc rtxnvz bnc\n", "ani mggxf mcoixh zdd nai hbhzl mes bdpqr\n", "mjn uinoty jjegvze bjgqg yhqsxbt coj obylb hddude xqi rhfbhha alood\n", "cbjzj drmihy tfkrhsd nuhav hihzx bvblqpl tdd szmp gjgfv box\n", "uumhdxd cmwgyf vepr rwqdkj exwk\n", "hwvr ydvw bqefu kghes gvbhp awms iqsqes khgse\n", "mrey jqfw fwvzhps komj dayvs fbui zmtd cofn mrey\n", "dsjds fdpx irjj usndok qcctsvf fgk wvg txwxcl dxs llp zyilwtq\n", "xmkelgk fdukc cye legkxkm wwly\n", "enlny eynln cccku brkz dpof mwfoxcd yftmnqh wpebvyc\n", "ggdn jnysl dsacffw ukj hdae cmzxku\n", "uqhm gcachmn kxndfrl htmfis jfnajz fiqiypr kekho kekho ndcw ckrndub dejfna\n", "keazuq ertql rauwl keazuq obmh rauwl ksrotm\n", "jppp poigqhv repfsje grjk xwkyuh pkx ayzcj hoxzv\n", "yhjw pcuyad icie icie icie hwcsuy wcd yihjh jnrxs\n", "gaug ivvx ceb xujonak hbtfkeb ttciml cctoz\n", "dggyyi dggyyi gqlyumf yasu fwdfa cbb nncn verhq\n", "rhgcw gpcyct kiuhbg kiuhbg gpcyct jlmleo nhumm\n", "wulxxu jyjek hclcp ogob viex wiqcupq\n", "tthu nxgzpid kcnj mss ukapgkp nnc bxjocv qwxs oejwsif aywqtu brahkb\n", "dtde bgvb smu vbbg zhlu\n", "lyo nwjjmep ldbok wgxhto wwuh qfgjknk wnsl\n", "lleyr onha hkwulbm jfg\n", "bybjwd uoxvbh mvj iqfpnxs bybjwd zqtszp wvc lbazjr zkzenja cev\n", "rbuyyr divtslq yuqmyt ajyveb smxsjb nlk tzqhq ims fewg wpjhr gqh\n", "kpewfd beq klilis klisli eeezut\n", "euqh hueq ldoo crqurv lvrwh tmaewp oodl\n", "bqi lzrf jyhvxfh bqi jyhvxfh nbztd lwpdn cuzi\n", "srjylou phavzjd wost uxkaq byh sluryoj\n", "ihrdk bcegkpq nygrs qbcq wyjg dvzme pgzhjl vibg kvv\n", "ijsx iedemek ktlz gtga tbal lbki gtga\n", "vmiaxn kefig kefig vngxz\n", "vrdmfvi qts vlvhq vlvhq dihmq\n", "cfz dyrz zlw qnt vok fwvahg skshbqf hbwozdc ntana jdb uflp\n", "rimbj bxemw sfps krtk umta vnk ewmbx nrlje ymrtqrz mxewb kjxunbt\n", "egnuti ozat eltl ngueti\n", "qtcwoxq rmaf qtcwoxq qtcwoxq\n", "zws gcoa pydruw qsrk lrkybdf ugr wkrxoj nyvf vitwn\n", "tmr hhd dojid zwrj bhsim righ keqlep flzunou\n", "lwoquvy acjowxk tqudk oenvioh nyavyl\n", "rgh dfhgyke iff cpxhuz hui koe iff hui dmukrei\n", "bjiumig lcbmbgh vleipx sfawua rnf\n", "gftfh qwb tfdroe xbno qhgofm vqfoe mux\n", "ljdrr gyfggai iun nju xrucbis mhrcrh fukr obvuqc whlalfe xrucbis nju\n", "nxjmjr egqwg arllu xqaahri lzc ivt uhsti\n", "sqiepba rcmts kvesv nvp\n", "tiksw tiksw rjni gbhvzm ctbq zuqfyvz\n", "ibsnm kfka aoqigwo sqouih rxz\n", "jmymq lxio adtmk umyu sxvzquq bporqnb heol fow\n", "mepa eckq rqviawv dkqoei ifmngpp jiava rtklseu\n", "yuycd jiufjci yuycd uowg yuycd udq izkicbr csxobh\n", "nwu tfsjavb rruoxbn oepcov elxf rruoxbn rruoxbn azglwth jcjm ksqiqpv\n", "dthfwip zqnwa zqnwa zqnwa\n", "gso wruece ufl crgnlxv vllsm dpyfm wpa ctxko\n", "wvpze seodz lpq lpq pmtp wsxs ffppx\n", "yfxquj phvjn rtwieq rtwieq kgxztyu vbjvkc prqqd lyzmdo ojbrt ojbrt qiqjz\n", "esaezr rpggiy jey kbzrhu uthus osr xxaiijd qfxlf auhzbx gkigoqw\n", "yfhcj uvgck cds gjhhrg cmempgj yfhcj cjb\n", "yxi voxvtuw unwg jqqm\n", "igvjr ljz rus sru gbjtjt qfeg ztu zjl\n", "leof ocxns hbkoysh hbkoysh leof\n", "hab lyxmf yhh qeks fwhfxki xmbcak okqjii nfgzyg bhtfgdj lpmjn\n", "mgognh tad herere lvwnzx ixwqs zphmuuc etdjz kczsf\n", "mtej rlolsnn zbl uykek dpkan gmz etxtgj\n", "mihuieo emjgbp jgks mihuieo iexrfw mjdnr bvp mcuzea xkbusvi\n", "jvqpj bwt jvqpj bwt gxr\n", "qpnd fpt tpor bibbpcg hmvguez wqc afl ckviua gpi\n", "dntmcg jglm sxtnu sxtnu sxtnu\n", "fzkbptw cbfwo ozvwov wbv gcdd izqo ovwzov lolewo xikqpw\n", "nkxyxzd kpn datf fki werq mwidqx oiibor zizcjph\n", "xvgyxym zor ijoy lvwsf fjuara idvvq rreit mqyyy ctio tzwqqhj rnpee\n", "maqkfpk maqkfpk xukg sfdmnlg xjopvr xjopvr irf\n", "liujcd vnlkouy dxkwc gto vhjvtw\n", "swhqhj cas aupsd swhqhj cas bvbooii jquck dtdm\n", "igh iqicicf ghi pcxt srcrjx gmf gyscphv\n", "drplj drplj wopgpnk wytag wopgpnk\n", "zexe ilcqoh qiefb txkuv lirfzv\n", "ovvpn ovvpn uqeurqx uwzn hgmucj ovvpn sjxulms\n", "rox silka irhsvym kutus otasof tdneav pcagds\n", "mkja omu tyshbfq onp trxs lxa tftbv bnpl djhnc zdqfs muo\n", "tjj rmmqas cbbkxs qio pikk ykyew gxlxt nhsyl ykyew\n", "frcprg njrz oaxcmhc qben pedm ecvtga nzxwpb ior gaklot dpem\n", "zyt kncau spoe qlchg sqys wkpbng yflju qlchg vkve bzadbpa\n", "qtq pkaicl qtq mfkfqvr dnleiq brrjxsx uoyxh pkaicl yvmlug\n", "firwy imtlp ywl qfa dqrbazz ztzb pcsbwhn zesmlag\n", "ivey ivey mtvc mtvc\n", "lhize acwf moa cdeoazd voktshy qmvqq jvmuvk ljfmq tsanygc\n", "xreiqkc aawrovl pofcsg xreiqkc xreiqkc\n", "cjbzvn ozds iniqu sdoz gqmki bablvll krs vjzcbn\n", "izsod htkeqz entxn qtns prpcwu omfnmoy\n", "kwfb tctzda aztctd tadtcz gyt wunbcub ydiwdin xxk\n", "epnl ijcp giq ltfk zjcabve zfksmz epnl giq xxxbsom\n", "ulyukpa mdjsbn dydko uhkdt qms aaaj hustlwu\n", "zlsbu ohx jcwovf egf zlvpqgx qhejm wrywdmw\n", "uhxqrzr mmu kjxcalj unuohiq rri yzngnb ikvlxry mfiym qbksdx\n", "khqciz som yklmm jceb khqciz jspy jceb\n", "ncwggv njvi nqox krtsn lnm\n", "bgtqme xaxcoq qbtgme obqual vorfk baoqul lgrb\n", "jli tsbb nlxjc pkwzmz dlxrj hmho gzguko ilj iyaasm\n", "wlmw grkumg dynwtyo emxhhqr huluk slpqu uhqcmd absmr ufirmwr\n", "pbs pcammxv dplfr tzvmav nccyy blvyq ffhnz bccutq\n", "hgge ghge vxmvz hqxgjdg zab guo gheg\n", "ylj bucoyoq udndc wpgyrbx ueh udndc gxdsdh hdoz wwgqlg\n", "cjdeh gttyqe kdkm ltzd lfeozse quvjq mnwhokm kdv oojxm nxt\n", "mfkzus knqxt saxkqww njx zumsfk sbmcyad cpt agvbuv\n", "tukn vyco yobvsn bzgnn klrnzy kea thzk pxpwq ryfff nxzm\n", "ylbm lxlz lybm lzxl\n", "wgtxoij zad slgsi cvnxfg iomswwl vmx\n", "hkm yinhnkj kmh kwkw kayknck chur styjif yknakck\n", "rtfwhkq rtfwhkq zsf zsf\n", "sldq zlntr ueegiw kajivqc ozcbm ceft snvugom pdyc elppeed nnqrp prwwf\n", "lhk xjonc muc tudag tsafx mmivb dvrjbp qgrew\n", "hnzer fbgqp aazta aazta lxaz lmgv aazta\n", "victgxu victgxu mlpd ummrnbx cazjgnw isxcyp efy zfa cyusj\n", "gyojxo onzq gyojxo uxufp awi ilhl wefwfxr gcjlt tmliynw uxufp pdcnxah\n", "wjwachn xkuhfbp oky oky ybaeqkr rbuix yreoaw wepmye brvon aasb\n", "kiidorw vxtxiqx wtqvbrv efdth isel qbom vcssyc vxtxiqx wtqvbrv riafzsw mqzsj\n", "eurpjd vkhdamt tmfx czeoot hiz ykz lmixzq tfur jhzr\n", "ipuftpj qbll sqkkdw fwncmiv bri oeeh lehd ioh wag\n", "suima nanngc imrmc krq atxdo woy atxdo akev qlr aezco qlr\n", "cfc efwbzck ozkmcxv moczkvx ccf\n", "bnekky iakrk sask uwgnjp iyi rynev bdnas ldh kass\n", "sicmw vvjbvv cap nsumc xgvrlm wsoo uoqdu psykckm\n", "ugg mtr wnzhmmh tjxc ehwnji lwhu mdsckk yvmk enubrqo\n", "grb oxmxz ohu ytetedv ssx apzlppg fdkamm sxofc jdt ynmu wyejok\n", "umoep rbyqm eqfk twqnog cptbbi dragna ngqs ffb cexxnc rbyqm\n", "utizi ormkel wvwur bdx ecelqbv xiccama aag glfvmj\n", "znb rsuqoa uxo svc\n", "obs lbifa cffi catpd\n", "qkxwian ajlzjz wewduzp bbyv qmt fsr qgiu epinp ghmf\n", "hatg bfgmb aght ghat\n", "kuq inp dun cknbun wmwsu drlmmg kyxc bdl\n", "bddybth swdbf jhi fva qpobio bjwm wjaztp jywi\n", "mgckz vhveu zkemhp zdf xtiqqew mlx wazgd\n", "umbjq pya lvvxf jeavij rhrxvew bwjqgpr piz\n", "xaycpwo vjcuc qksc yuixhni sfbfb dydyaq gdfvb tggg xidphvf bpjdrl goskxym\n", "agxfoip gguif wvo agxfoip ntkbaw fbyggy ooft zxih\n", "nzvsu ffwq uxvfbl qrql olhmhom qhdltg ymwz krtndtx olhmhom nfsv krtndtx\n", "qdp jqk ustz xjripzv mnk grnodk pjwdsj uug zqxjqj\n", "mufrcox zunisfs ocvcge acamm xua vor bsde kxr vor kxr orccxx\n", "ncycbp anvcxay bmm wndmeaw oso knmk mmb wamenwd kmkv ppdd\n", "motdcn xzagzwu vuzt utffrn yuqxzrh uvzt ujttq\n", "tauoqy coiy ybesz tauoqy wpmr trquyne ahxbj jzhems dsdy\n", "aczq ypw pgmzz srfn quatjgf\n", "cih ypapk bfxvr euvhkk gugru auhqui\n", "vyf pssgfvy dnhvbfl xpacme dnhvbfl mzdv iynq hcqu\n", "lbzvbu hhxiq hdfyiiz iyzihfd xhqih uzdqyxr\n", "iapbdll vdr cprmrkk vdr dfjqse mlry flpqk vdr\n", "grrfkq xcpxd grrfkq dxc bjpr prvwh swoc swoc\n", "bopo chvwuhf qhd ieesl xey ieesl fnjcbe\n", "kic fyq hsucnu agwyl pzzmd hqksh psw\n", "mxf uau iti lcoz lpg zbu ocre wqlocmh mxf nidqj lcoz\n", "bypmix ptzxgmf xmtzgpf hrvzzq\n", "lbfw zwusma lbfw tuyyy\n", "lrf uej unswvh obgsb npbl zajr kenea uej qnyjcu wzufim qpzkgya\n", "qcrxj llyu kligt hlm ehwtbx dda lgsvhdt xewfcv uikn\n", "nfzjx izqdbq mfbxs imiuc yqxb xlmvix izqdbq eflqfq wku omgtuu izqdbq\n", "lasdwg hiy btzt eefd eyoep icn nnmhg otml rek luixac nyzgn\n", "vekteds utsuxdx utsuxdx vekteds\n", "feyov qrij zbebwg ijrq seplram wttkwm zewbgb kzuhuh\n", "dmkgtv wohgqo ddtqmv zatahx mym hqowog tkmvdg\n", "vhha wjrmuyx kqh vyyrj xzchbi ejsdq orlxg vyyrj dlrc\n", "yetngqn zdtuqox hkarjei fqpsgh eaqwbg zsssog ghb gddqqzr hbg\n", "obldb zsrhz zxp uxphnev mwnbc pfjft fms xwslk vjm fxy\n", "nfij dbfykv ttq gyjgac igxuyqi gtiioqx ilhdex dbfykv uyp bdiwya gqf\n", "pffzruz vogfosh dcs wje\n", "pohhf fhpoh oon yyz\n", "xxuam afwm qxl lnt syyr bwxhhf sozauq shlhfmz kwnn milav ochq\n", "wefcqrt gejw cwerqtf fttf gjew\n", "jfsvnmr osca epwtle pgfif sxom\n", "exlfzmq nakp rgdnx rrcvth vhrrct aajjdrt ryyg dsozd jdqlqj pakn iruv\n", "rmcvo txszcs xxhyxz hbsozk wshkocf rmcvo rcbnt\n", "kitz yjgney yvkymef nauj hmllsgl kyhm kqr pzsu rcf pzsu qpte\n", "cdinpx bfur mkj naz ihkheyr nohhoe\n", "ylris xeqcgup wap bbfih tgfoj\n", "ina gnlnm zyeqhij cudfuf ipufae bvkdzni aat teqsg cudfuf bjokrbl teqsg\n", "aedx edax dnfwq qndwf\n", "rdngdy jde wvgkhto bdvngf mdup eskuvg ezli opibo mppoc mdup zrasc\n", "qcnc iaw grjfsxe gnf gnf\n", "zbjm snznt zelswrk gkhlnx dqxqn qqxnd dmro\n", "zisecvx ztezof uzbq otnrtj qsjzkwm ewvcp rlir bfghlq tgapdr qxmr\n", "ipnqj opjf vabyoe wkwnd\n", "wyf mfqxnrf apm snarf jqu aaghx pwecbv lvghayg\n", "acncv jmmbwlg oiphlm ifuo cvt\n", "pvmb egansnd zmh gcuzzci rrxpslv ubith\n", "uoleptg xbouzn xbmg cfh cpn wpqi xbouzn xtxis sxzpns\n", "rilybri kurbpq vfmjpck tjyogho hfyxad svfofx lfbbhxj khaerfs iqr\n", "seaebgz wlmtkre qguv qguv wlmtkre\n", "sgo edkxya zdqgwtt gxu nibuu rairqoq mzxli dci qsv\n", "tsol mdhzqr rmaqnru ggvcq arbwkn hlkcnj ljkcuof\n", "mmliphp ocup puoc eijjv\n", "gmajqpb ijki ijki kvz\n", "pmqss unhlpcj dlkll nuhlcjp expe tlurzmv nsy vlumtzr tgseozl\n", "gkvaoni hsba hsba viuedv phyoclp fdq phyoclp febld nqfs\n", "rxvdtw abn pntv qrqfzz slsvv abn lrxix mnu npot\n", "ghlfjp woy xwkbmv bkahpkj jve cncvk jvdype fwgvoju yrkwjp gwfvln mvkv\n", "kmluh mie bby fwer chsinb ojglqr nqk mie\n", "yzmiu igkgca ybnsqja jpfejtp yjddy xsosxfi ingx qwuhb emrkwpx idqjmmm\n", "btrllw mphm dkvo ewdl dchcul yah btrllw kmqi mtvgk wtb\n", "hxsgard yuikc lykt tdee adprp gpougod klnzk mzsmlb\n", "hdn znblw ifoblur bwzln dbv\n", "smofpbs vjuyiro llk lfzesga tybu tybu\n", "gffnpug xaup iqiyz fjkpnkz drrk fwyxw lwzfskz gslwpmv vjxylva tbkyo nib\n", "evydmb nhwuiiu fkerq nkgbuyy uclrs ydjgglh xhotwbm riirgzt\n", "bsub eavbt uvd dpzwyt rhn khrbptt xszckc djnfxju axofhat powmso nvdffrv\n", "xtuykl fjz mbikc xpnx hmey fjz fjz\n", "rkls nwdcsyx rkls rkls\n", "tygml untequ ybdfumz nqffbq uipc sove hfnqj\n", "ytecew vven koqn royynd qsn ksl qsn sdw\n", "hknlw qwho whoq oqwh\n", "lzmmtqu qvhyeo cnofuj utpwkjz gnirz yhhu aodbnd\n", "zsr axw kwtzcv tydzo kwtzcv lkxsm\n", "rbjtqe nihifd gvdxd bpxzy rxteky vgcgllv vbbua anygiup rqo\n", "dpd wblfwp wblfwp wblfwp ygahc tqjbaq\n", "gsw gsw pacgj xmrcz zmxhmch xmrcz\n", "pdq rhe xqmq lgpkhg fyffrot ovnqh wle\n", "tbjavke ypzzrj jizx gdxoh icjsat otfh fmygumv\n", "snch nxlgjgp jeyn sxoqfj jtage jtage iuice\n", "rtb coefuj grwg grwg rtb krhqnma vfhgbr\n", "vhegtl btorwxg szcev kbvkx itsk nlzpbed\n", "hiukrf ilzkm yllhh xsgwkdp zyy kjbv\n", "rfcg tdorci zcj wzftlv rfcg rfcg\n", "lgbc lzizat vsno pau nvv vsno bbr lzizat qhtb gwp\n", "sfwnio tcugjk bsfsz ykyfwg ibkap fsrvy mygk kzunawx zyhyh\n", "mpavlh qps bylh lttjkz rqabgk vewb bwev tlzkjt gzrbxga ktmso prpkj\n", "gpf ims ynh ffrs vpa iemp gofh cgbauje\n", "secys qks mcnfhwh drog kqs pajy zoltkw lfihnb myb ioxptu\n", "ytq nrta ouk ajqblf yuwwcd zdy blyoxbw dakk nvgi bzrhzaa\n", "nkoych sufiia xkdvw crtldee zycl qblab egqhr qblab\n", "nllno muxaf vds qjnitmw zkpj wskyhft kmqct xamuzpw qcai cdjtbt kaxv\n", "qzdytpe osr fuw osr qzdytpe whperd rydwdcl knoa\n", "zkdznhd peh duoygr zamrgl irnvj otpe pltpq jdkecg\n", "byzgw rece iigdug ehif tpgje\n", "ccnn foqdran gbctca tefdjxh ntcr rjciii xip xlss crl wvvhzqm twyohf\n", "dqyii milqqc qjgkojp qjgkojp ryde\n", "tdkyj tbrcud tsba vqtmb cjwxnf\n", "hqhmq wemvrce nagig pwnw nagig epg nagig vlsi\n", "tqgvw luoplw hccti npjm rytdruq cylrsun rytdruq vjsbjl rytdruq ppti\n", "itgt tuwc itgt rvp itgt tigns eipl ksmru\n", "pdw wdhtkn nbdbpn wff zhuuipg rvemv qxr\n", "qgkwdq cjilayh ymeks mrpuzai dwgs stfstgz ucvqhb yout oiq\n", "vpxik ypfr qytimvu qms oxbmw ppyfx\n", "fwwidn gdhd pyuexk snsz iwndfw\n", "lfcb sllxjna lfcb hpzahfg mmvgaa svny jhuzd\n", "unyg gicmzd fwc spkciy toyq wjupckd vzzx iuqgka ytqycb pxsufj\n", "goj tnrcml eyizngj txa xrkiw zvu igduz\n", "wek xrrlkna clyof rrlnxak\n", "cjm rmyuku vjom gtf\n", "buk cfae awstd dywgqp hxo wcxvf laihqw xdqfes wdbh qceh uzlwj\n", "sudguo dxwplto rlebdh bkamu dxwplto\n", "crwkyxm yuz kjtdhom crwkyxm\n", "trhc sduorxr aizfryh rsudxor gbyc\n", "pczkyl bptp qnn nxmpwsx udrg hhlb rubtrmx twzodlp xygnht\n", "jmqct cden yfajtkz fevcw sxonbxz sxonbxz qkzkm hhngr fbv\n", "sdsnm mwvicr wypfi cty ndbowr woiz mrauwzd qlno mwvicr\n", "vteyo fng lvr lxytn txpj milg\n", "wjx ahtmgo cgwcaj kaxae fhlvlqf\n", "ezj eetqhzu upwda iiefwlk vyvby\n", "imalvy yeghqe jwcu mvrod cwju\n", "bxnmsa yhfu npsdar tsbri hfuy sirbt oofxmy\n", "fkndt elbjtn vepqtxt elvpf fpelv bzkgag qttexpv prblwb\n", "rmq iqs yvprnyy iezqrzm wlqsrr\n", "yviovq lekxghj oey qwhzj lxknxw qiyovv ksnt jptz\n", "tyrg cifxt hugqf tyrg ffuiv jmax qyw fozfosq ffuiv\n", "nmg rsl jpzazd qbtlf yxqtsj czwmdfd bamge lbjdof uqy jssc\n", "cbx boozjip pwgvzlq rjz kxy kxy hszacok fvsq jhnir cnsba gafz\n", "sbcuxb wfur nnnfqjj fdwg huhe sbcuxb\n", "icwk qelbxs uevp qped zsnhh wpuok wddxsln ftnzupr ruxol cgxjb jbhh\n", "izcp htykj xxmndoq amnspe htykj\n", "vverol oixwlny vqd tvfzu henc gnyrwr\n", "ytxio etytsx choynep zqapo hfjit\n", "lkvgr oyzfa taiqr jok djatvy ckif tmdw oyzfa zroy\n", "jlgpyp kkqysg oqjki hjohoug hbhta muilz zft\n", "sumfyu wftcu bwwdcy lezimwa qwvxv zwh mqyv bmfot aii torcol rnt\n", "tpdj xrw ccsbnh fhptv fwkxjfm dmqaokd bjci\n", "zxi vmf vmf dpyg\n", "sfzxysw lcms bkojtv bkojtv\n", "opywo qll ipkitr mtwp tudrr svhyp huz bxsdpn xomfy\n", "gkod luo qrosbp orbd rpsjzyd rlh gdok tze\n", "nusiuq nusiuq zeys ahufexc\n", "veno jntg avtmtdn qojxru zegdcql odfcetz pgehau\n", "uqun vigjm ykac ozlelj danmji bibugox\n", "rpuozh ajwru rbvuevv uhzsq\n", "iawoe tyb aewio ymf byt inijv ctu fcys micsgzl pbby alt\n", "gktyxp ris mqpfm bkqsfl nrg idbbcxg jhcf\n", "qibt invvv qibt luitx rnm eby hrfbmwl wnap sgkzvb qlwc hrfbmwl\n", "jwkv qecsjbw lycgldd wjvk tjcp dycldgl pzrvr zrlcf kji\n", "nzsrmiq nmhse ilivrk kqv\n", "besmyzi imkgpt iekbjax abxeijk uvzs wwv\n", "jdocl uki ltswp tjkljc ymce iuepze qygqxzs tei lkry\n", "hhyfy gvzd mqksxlq czn afe mesnag eep frwgekg mqksxlq phpy\n", "ehg connnza ekt ddgokw\n", "mpbsoms uzhzl xevww ztt uzhzl\n", "lftybr firc awsud dsxdkk ltf ipjv dtx lcymth\n", "vkcpb gxtxq yioeq fexj xxgqt\n", "srvca fslnnvf nfmkpvt egw wemumq jie vznf dzsjw cukf kcvyir\n", "yxjkl lyjkx jyxlk kgc xtz\n", "tpoe xzov csp leleoqo noyre tdhf cyib sjgtdx raehdw nmcxp\n", "qvt uhznqe bpvos vtq ddlebtd tqv\n", "xlw utsxs gpia rvlvnts elkxr dddihy tnrslvv ibf wlx bxg\n", "cwqnnrt rkkqyf dye yde fzl pthanj\n", "boc rqjenpp xjqte jteqx pvoofc pidqe ruoucy gvnro ognrv\n", "qhalb gnazwc fhl iuti\n", "clnbjfo nnfs nnfs heymvr oarew oarew nxu\n", "lwtrotg hiaxwj ymzbly nvhzjhj zlsaheg nvhzjhj ymzbly\n", "rrvi tsjp tsjp tsjp killji\n", "rpx hiclj cmwq ibhj nfd\n", "pvwymn iebkd xmpw vuhhkap ksw zigzy mzzyyxy rmuh iwwhea cglfq\n", "rlwelgy sffml jin qsdzro xlsty mgqzuu etxjuo emzd jgnoyq tkjuy vfvb\n", "tkctdj hhkuc viskmy obw\n", "zvjkuj akeky ikj jqd hfhzbwe bkc\n", "btev nrdo hcyiuph stf qharfg vpmel mpfz nvs ytgbbc\n", "ieepn ndueuw svmdr tcvumw mceyrn mrjwhyl tbdj mgrgvz\n", "uxrs ckyi xpmqm czzrkl cjp\n", "nlliwd wrqkrkz yjmng nlliwd zirde hcjjn wco ysf mgl\n", "dxti lcahe ommare izlwf ramsfb nzgfvo ijvm fwymrdu bndq\n", "isxy jpvuzu tdduyhw dixp cfa fkzbteg ytoi kepk ysf yqcpi\n", "qmeprfj soqo ncgeor cqsuuj grzy wogxy vyblnbg slvtry vdols kka\n", "ltykfp gtzl olrp gxend vapee deq\n", "emywfbn dbfiut rkt wvwe dbfiut bwffhea yuzcxv gogpicp wvwe\n", "vqvmrp ofbk dlfabd jwllzxk obx vqpwjj umvng tqwis fstxy fstxy\n", "miha zgvyux rmraszo xwf\n", "kjaagk btm kjaagk wkewjrg kjaagk\n", "lbmli aizs omrdr gzktnx asiz ptanzpa xlo ljre ckyb wob\n", "svz dlk rijagg avxmg fkzwhk uro gegm\n", "dzplum temdw jqnm tvxcww bmg tftttpp deuw comxey xfimzjx caluczi nqn\n", "uwvhxa ztkd nlsdyt vihl julkwwv uzch dwakhs\n", "wkhuihh ycrc cxff vzcfhpp uegfd gaok kcnvz lhzogq lwa tyrypvu\n", "idp zmrrzp zmrrzp nktp xsnx rjsxn\n", "eybrnib ivgntl vaxsbpi eybrnib\n", "nzvnq xvbfa pbhwwh ylju runvsj imlx vztesn\n", "nfdohd nfdohd gtevnky pivjyct ihvd fzcsrq lko fmqk\n", "kwpkks ecikxu bcxswlt qvrxm sbcqmh\n", "kdjrmj piuh kdjrmj vnaf gyedkg vptxgm xezssxx zsg qjzpo zsg\n", "oqo sley aqx qmpqb fgmylbj egd zivj kepxizv kuakyn lunbnd\n", "hmcf hmcf xlhgc hmcf cdlm buofnx\n", "onjcj yluonz kzmk phqo phqo phqo\n", "ohaafy efl bnkkjww wwjnyoj dxeaig ywnjjwo slk hrbebw ohlyju elf\n", "msohiqz aunk njki bfktdgi htmyrj mgx\n", "numlzrl rmnlulz glb ltt fhbajz gqxpu\n", "gko hco oai ryq xwy sdqosft spjkiu cxfhg ycwpglh noy rah\n", "btzpjem brpk vqr atxu rhlh rqv jmg fvyus\n", "phmxxgj ejx xje qtk hsb kqt npwj gqt\n", "hujyjp nwmsd ant zipuya lrkahww uwqal vzlo qmbo twkjkse ufivi\n", "zfbnyz fwvh xrnrw usn zin daq iwjzj\n", "yykyg iwypfy hehqnl cjvk cevdrec\n", "gui muuto wsta glqmx gfo rdmbv mxwz gffzt eejpw gion\n", "lpng nduid iqbpu nduid knrqd\n", "xwxn oefpckv gjaua ugaaj gjuaa\n", "qxk aeql trqdmqc crzlinj crzlinj trqdmqc rijcne ewyf\n", "rfv qmbe fvr bmeq\n", "upqyfw lowzq wpen upqyfw gfskbil sljuzh wpen\n", "bdcara qyhx rtaez qyq gbyr\n", "evzls qxtxq clzd svbgqi zxlzgss vtrre fko eebo qjyl\n", "zaapeo kpwhz tygknau nyd pch trp xqe\n", "ypzcafg rnqmbh qtteg sncu ssojhhm zonfym thir xmgheb wqj gpjg ssojhhm\n", "wvcwyn xrf muozyya lasdp xpjgu kpqv zkiihiv ifje cbdlavg xbied hfnaa\n", "qqqb rettz rycukl ihpkhh\n", "dnxzxqv znb znb fbxj azxtezb xvxa\n", "peqkd xlzqkov esgnw ucku hrwpfxd xtd vnig vlmfp ajte qswr kqoj\n", "dpwy oavzkk dwyp ehij upqxgii pydw\n", "amfc hfv xmqa nqvn cal rqmcq oej amqx cla ntxj\n", "hqhhe qkbhwli wmhlcq xaczs peywuo\n", "vcr xfv xfv kymo qpszwzo xfv\n", "nmrbur tswo xbo ljlrzo bmhpgc pev zovkznz lok wbbhtkk\n", "tojj lxqgr rhjavrm ndsdup gdbjwaq cqpnl wfaxivl rfry ryfr udspnd\n", "beffod sknlph amb feobdf\n", "mldgn jxovw yuawcvz kzgzwht rxqhzev fsdnvu vluuo eycoh cugf qjugo\n", "tlnd qcxj ker fdir cgkpo nrqhyq raef uqadf iahy rxx\n", "mhvisju lhmdbs tcxied xeidtc ujry cditex gvqpqm\n", "cgc jazrp crgnna uvuokl uvuokl uoiwl sknmc sknmc\n", "rvbu czwpdit vmlihg spz lfaxxev zslfuto oog dvoksub\"\"\"" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "337" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "valid = 0\n", "for row in passphrases.split('\\n'):\n", " splitted = row.split()\n", " if len(set(splitted)) == len(splitted):\n", " valid += 1\n", "valid" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Part 2" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "231" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "valid = 0\n", "for row in passphrases.split('\\n'):\n", " splitted = row.split()\n", " if len(set(splitted)) == len(splitted):\n", " if len(set([\"\".join(sorted(item)) for item in splitted])) == len(splitted):\n", " valid += 1\n", "valid" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 5 (jumps)" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [], "source": [ "test_sequence = [0, 3, 0, 1, -3]" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [], "source": [ "def jump_until_out(mysequence):\n", " \"Returns the number of jumps needed to exit the sequence.\"\n", " sequence = mysequence[:]\n", " jumps = 0\n", " current = 0\n", " while current >= 0 and current < len(sequence):\n", " this_jump = sequence[current]\n", " sequence[current] += 1\n", " current += this_jump\n", " jumps += 1\n", " return jumps" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "jump_until_out(test_sequence)" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [], "source": [ "sequence = \"\"\"0\n", "1\n", "0\n", "0\n", "1\n", "-3\n", "0\n", "0\n", "2\n", "-2\n", "-6\n", "-3\n", "2\n", "-5\n", "-6\n", "-3\n", "-3\n", "0\n", "-8\n", "-12\n", "1\n", "-9\n", "-12\n", "-9\n", "0\n", "-7\n", "-17\n", "-6\n", "-18\n", "-7\n", "-6\n", "-21\n", "-28\n", "-14\n", "-23\n", "-14\n", "-17\n", "-5\n", "-35\n", "-17\n", "-26\n", "-14\n", "1\n", "-27\n", "-19\n", "-40\n", "-32\n", "-44\n", "2\n", "-14\n", "-15\n", "-12\n", "-35\n", "0\n", "-49\n", "-12\n", "-7\n", "-46\n", "-47\n", "-32\n", "-33\n", "-47\n", "-7\n", "-62\n", "-20\n", "-35\n", "-4\n", "-35\n", "-8\n", "-3\n", "-61\n", "-38\n", "-63\n", "-27\n", "-33\n", "-57\n", "-48\n", "-66\n", "-68\n", "-11\n", "-61\n", "-50\n", "-34\n", "-31\n", "-36\n", "-79\n", "-49\n", "-71\n", "1\n", "-34\n", "-65\n", "-61\n", "-91\n", "-12\n", "-21\n", "-82\n", "-85\n", "-51\n", "-89\n", "0\n", "-83\n", "-53\n", "-44\n", "-7\n", "1\n", "-19\n", "-39\n", "-27\n", "-94\n", "-36\n", "-31\n", "-35\n", "-97\n", "-45\n", "-90\n", "-15\n", "-106\n", "-30\n", "-79\n", "-18\n", "-25\n", "-105\n", "-30\n", "-63\n", "-109\n", "-32\n", "-91\n", "-96\n", "-87\n", "-121\n", "-116\n", "-103\n", "-71\n", "-1\n", "-113\n", "-10\n", "-47\n", "-109\n", "-107\n", "-38\n", "-66\n", "-26\n", "-8\n", "-38\n", "-31\n", "-129\n", "-42\n", "-91\n", "-89\n", "-107\n", "-125\n", "-75\n", "-118\n", "-81\n", "-45\n", "-111\n", "-27\n", "-63\n", "-106\n", "-110\n", "-64\n", "-63\n", "-80\n", "-44\n", "-33\n", "-130\n", "-55\n", "-90\n", "-144\n", "-15\n", "-132\n", "-122\n", "-155\n", "-122\n", "-94\n", "-159\n", "-5\n", "-89\n", "-6\n", "-97\n", "-129\n", "-159\n", "-15\n", "-44\n", "-156\n", "-124\n", "-113\n", "-154\n", "-95\n", "-96\n", "-29\n", "-121\n", "-30\n", "-73\n", "-118\n", "-57\n", "-76\n", "-141\n", "-138\n", "-108\n", "-185\n", "-56\n", "-136\n", "-161\n", "-138\n", "-192\n", "2\n", "-126\n", "-12\n", "-39\n", "-60\n", "-125\n", "-149\n", "-193\n", "-146\n", "-116\n", "-101\n", "-16\n", "-207\n", "-122\n", "-92\n", "-204\n", "-42\n", "-112\n", "-28\n", "-93\n", "-96\n", "-57\n", "-136\n", "-19\n", "-36\n", "-107\n", "-170\n", "-19\n", "-20\n", "-96\n", "-229\n", "-59\n", "-172\n", "-58\n", "-89\n", "-31\n", "-57\n", "-223\n", "-37\n", "-189\n", "-43\n", "-135\n", "-90\n", "-150\n", "-22\n", "-152\n", "-243\n", "-37\n", "-231\n", "-112\n", "-57\n", "-168\n", "-30\n", "-77\n", "-162\n", "-181\n", "-176\n", "-202\n", "-138\n", "-206\n", "-183\n", "-190\n", "-257\n", "-181\n", "-47\n", "-23\n", "-248\n", "-114\n", "-98\n", "-77\n", "-143\n", "-168\n", "-166\n", "-30\n", "-155\n", "-237\n", "-51\n", "-113\n", "-243\n", "-41\n", "-142\n", "-231\n", "-139\n", "-20\n", "-190\n", "-262\n", "-142\n", "-238\n", "-200\n", "-270\n", "-113\n", "-35\n", "-296\n", "-146\n", "-205\n", "-129\n", "-198\n", "-68\n", "-139\n", "-56\n", "-196\n", "-133\n", "-16\n", "-229\n", "-258\n", "-91\n", "-63\n", "-249\n", "-274\n", "-156\n", "-273\n", "-182\n", "-166\n", "-115\n", "-154\n", "-296\n", "-115\n", "-89\n", "-120\n", "-201\n", "-44\n", "-287\n", "-8\n", "1\n", "-260\n", "-297\n", "-282\n", "-114\n", "-323\n", "-326\n", "-166\n", "-241\n", "-109\n", "-21\n", "-236\n", "-280\n", "-19\n", "-80\n", "-77\n", "-271\n", "-292\n", "-340\n", "-300\n", "-206\n", "-308\n", "-99\n", "-156\n", "-277\n", "-245\n", "-132\n", "-56\n", "-172\n", "-53\n", "-271\n", "-32\n", "-5\n", "-235\n", "-329\n", "-1\n", "-150\n", "-247\n", "-268\n", "-133\n", "-341\n", "-221\n", "-2\n", "-43\n", "-229\n", "-190\n", "-337\n", "-40\n", "-71\n", "-72\n", "-149\n", "-25\n", "-253\n", "-44\n", "-113\n", "-164\n", "-370\n", "-284\n", "-235\n", "-9\n", "-234\n", "-291\n", "1\n", "-152\n", "-302\n", "-393\n", "-47\n", "-289\n", "-75\n", "-140\n", "-349\n", "-140\n", "-353\n", "-298\n", "-27\n", "-292\n", "-380\n", "-55\n", "-62\n", "-208\n", "-221\n", "-41\n", "-316\n", "-411\n", "-367\n", "-220\n", "-248\n", "-59\n", "-177\n", "-372\n", "-55\n", "-241\n", "-240\n", "-140\n", "-315\n", "-297\n", "-42\n", "-118\n", "-141\n", "-70\n", "-183\n", "-153\n", "-30\n", "-63\n", "-306\n", "-110\n", "-8\n", "-356\n", "-80\n", "-314\n", "-323\n", "-41\n", "-176\n", "-165\n", "-41\n", "-230\n", "-132\n", "-222\n", "-2\n", "-404\n", "-38\n", "-130\n", "2\n", "-16\n", "-141\n", "-136\n", "-336\n", "-245\n", "-6\n", "-348\n", "-172\n", "-267\n", "-208\n", "-291\n", "-285\n", "-67\n", "-219\n", "-216\n", "-136\n", "-325\n", "-27\n", "-382\n", "-242\n", "-50\n", "-284\n", "-149\n", "-454\n", "-336\n", "-346\n", "-293\n", "-402\n", "-76\n", "-324\n", "-219\n", "-336\n", "-24\n", "-446\n", "-123\n", "-185\n", "-196\n", "-295\n", "-173\n", "-400\n", "-137\n", "-414\n", "-14\n", "-104\n", "-62\n", "-252\n", "-17\n", "-398\n", "-490\n", "-440\n", "-89\n", "-347\n", "-101\n", "-142\n", "-228\n", "-301\n", "-396\n", "-320\n", "-52\n", "-508\n", "-122\n", "-436\n", "-311\n", "-344\n", "-240\n", "-434\n", "-220\n", "-197\n", "-31\n", "-295\n", "-44\n", "-452\n", "-269\n", "-430\n", "-373\n", "-409\n", "-438\n", "-365\n", "-13\n", "-241\n", "-418\n", "-20\n", "-24\n", "-141\n", "-1\n", "-148\n", "-307\n", "-63\n", "-423\n", "-254\n", "-8\n", "-438\n", "-326\n", "-19\n", "-135\n", "-109\n", "-394\n", "2\n", "-398\n", "-273\n", "-158\n", "-453\n", "-346\n", "-86\n", "-431\n", "-536\n", "-549\n", "-379\n", "-483\n", "-85\n", "-476\n", "-483\n", "-104\n", "-87\n", "-462\n", "-249\n", "-540\n", "-164\n", "-360\n", "-100\n", "-238\n", "-45\n", "-390\n", "-59\n", "-156\n", "-248\n", "-257\n", "-150\n", "-164\n", "-160\n", "-545\n", "-520\n", "-364\n", "-384\n", "-237\n", "-456\n", "-28\n", "-366\n", "-147\n", "0\n", "-303\n", "-583\n", "-420\n", "-370\n", "-299\n", "-154\n", "-380\n", "-188\n", "-491\n", "-258\n", "-598\n", "-429\n", "-349\n", "-333\n", "-569\n", "-4\n", "-556\n", "-421\n", "-182\n", "-441\n", "-407\n", "-542\n", "-364\n", "-370\n", "-384\n", "1\n", "-529\n", "-45\n", "-319\n", "-395\n", "-279\n", "-160\n", "-575\n", "-193\n", "-25\n", "-565\n", "-548\n", "-445\n", "-266\n", "-304\n", "-361\n", "-348\n", "-303\n", "-159\n", "-39\n", "-75\n", "-437\n", "-608\n", "-622\n", "-556\n", "-108\n", "-343\n", "-283\n", "-68\n", "-632\n", "-393\n", "-68\n", "-140\n", "-126\n", "-531\n", "-87\n", "-519\n", "-334\n", "-56\n", "-70\n", "-275\n", "-247\n", "-370\n", "-439\n", "-118\n", "-497\n", "-630\n", "-594\n", "-612\n", "-541\n", "-161\n", "-646\n", "-397\n", "-100\n", "-284\n", "-313\n", "0\n", "-59\n", "-200\n", "-601\n", "-663\n", "-529\n", "-676\n", "-610\n", "-7\n", "-228\n", "-50\n", "-494\n", "-382\n", "-250\n", "-306\n", "-274\n", "-163\n", "-110\n", "-375\n", "-124\n", "-237\n", "-98\n", "-645\n", "-692\n", "-495\n", "-593\n", "-647\n", "-178\n", "-531\n", "-336\n", "-697\n", "-646\n", "-671\n", "-633\n", "-542\n", "-461\n", "-200\n", "-658\n", "-525\n", "-389\n", "-643\n", "-258\n", "-329\n", "-656\n", "-400\n", "-692\n", "-557\n", "-506\n", "-594\n", "-67\n", "-623\n", "-113\n", "-459\n", "-211\n", "-713\n", "-115\n", "-602\n", "-131\n", "-181\n", "-30\n", "-227\n", "-53\n", "-719\n", "-631\n", "-641\n", "-434\n", "-552\n", "-716\n", "-368\n", "-19\n", "-439\n", "-443\n", "-552\n", "-85\n", "-79\n", "-449\n", "-254\n", "-620\n", "-474\n", "-121\n", "-210\n", "-285\n", "-608\n", "-456\n", "-513\n", "-496\n", "-13\n", "-418\n", "-399\n", "-437\n", "-258\n", "-15\n", "-623\n", "-178\n", "-336\n", "-379\n", "-721\n", "-299\n", "-729\n", "-742\n", "-64\n", "-13\n", "-438\n", "-603\n", "-666\n", "-278\n", "-767\n", "-200\n", "-686\n", "-497\n", "-256\n", "-541\n", "-491\n", "-360\n", "-615\n", "-326\n", "-682\n", "-759\n", "-524\n", "-580\n", "-323\n", "-578\n", "-793\n", "-478\n", "-107\n", "-440\n", "-657\n", "-790\n", "-605\n", "-21\n", "-163\n", "-392\n", "-560\n", "-336\n", "-430\n", "-613\n", "-182\n", "-15\n", "-782\n", "-607\n", "-281\n", "-269\n", "-25\n", "-699\n", "-89\n", "-593\n", "-280\n", "-269\n", "-438\n", "-103\n", "-359\n", "-387\n", "-157\n", "-747\n", "-619\n", "-176\n", "-772\n", "-500\n", "-735\n", "-691\n", "-797\n", "-612\n", "-573\n", "-36\n", "-617\n", "-630\n", "-357\n", "-718\n", "-210\n", "-48\n", "-185\n", "-20\n", "-556\n", "-206\n", "-722\n", "-559\n", "-416\n", "-578\n", "-745\n", "-564\n", "-273\n", "-62\n", "-300\n", "-218\n", "-711\n", "-744\n", "-805\n", "-277\n", "-522\n", "-346\n", "-280\n", "-762\n", "-438\n", "-381\n", "-379\n", "-198\n", "-737\n", "-555\n", "-466\n", "-218\n", "-511\n", "-334\n", "-353\n", "-259\n", "-225\n", "-675\n", "-350\n", "-585\n", "-647\n", "-52\n", "-395\n", "-324\n", "-106\n", "-826\n", "-279\n", "-81\n", "-396\n", "-611\n", "-312\n", "-529\n", "-291\n", "-129\n", "-594\n", "-437\n", "-188\n", "-649\n", "-820\n", "-237\n", "-673\n", "-6\n", "-387\n", "-195\n", "-503\n", "-350\n", "-83\n", "-88\n", "-626\n", "-30\n", "-313\n", "-13\n", "-633\n", "-403\n", "-319\n", "-832\n", "-185\n", "-146\n", "-839\n", "-9\n", "-557\n", "-799\n", "-841\n", "-700\n", "-465\n", "-669\n", "-769\n", "-235\n", "-849\n", "-863\n", "-819\n", "-76\n", "-912\n", "-931\n", "-909\n", "-762\n", "-607\n", "-522\n", "-64\n", "-769\n", "-377\n", "-133\n", "-414\n", "-772\n", "-206\n", "-746\n", "-730\n", "-393\n", "-901\n", "-72\n", "-33\n", "-811\n", "-372\n", "-298\n", "-835\n", "-637\n", "-302\n", "-481\n", "-958\n", "-878\n", "-867\n", "-25\n", "-260\n", "-448\n", "-21\n", "-930\n", "-903\n", "-581\n", "-547\n", "-664\n", "-843\n", "-140\n", "-337\n", "-383\n", "-513\n", "-368\n", "-221\n", "-474\n", "-169\n", "-673\n", "-728\n", "-266\n", "-862\n", "-753\n", "-815\n", "-647\n", "-106\n", "-15\n", "-728\n", "-912\n", "-147\n", "-828\n", "-6\n", "-694\n", "-434\n", "-737\n", "-335\n", "-183\n", "-732\n", "-841\n", "-364\n", "-155\n", "-116\n", "-966\n", "-822\n", "-65\n", "-22\n", "-853\n", "-208\n", "-326\n", "-826\n", "-472\n", "-491\n", "-436\n", "-771\n", "-1009\n", "-98\n", "-401\n", "-915\n", "-275\n", "-574\n", "-313\n", "-884\n", "-648\n", "-935\n", "-94\n", "-326\n", "-553\n", "-744\n", "-723\n", "-782\n", "-719\n", "-175\n", "-868\n", "-190\n", "-153\n", "-48\n", "-218\n", "-414\n", "-721\n", "-715\n", "-995\n", "-991\n", "-575\n", "-264\n", "-70\n", "-366\n", "-381\n", "-130\n", "-409\n", "-817\n", "-258\n", "-1028\n", "-552\n", "-878\n", "-449\n", "-138\n", "-900\n", "-45\n", "-119\n", "-677\n", "-844\n", "-869\n", "-985\n", "-1019\n", "-60\n", "-649\n", "-915\n", "-93\n", "-1053\n", "-121\n", "-631\n", "-156\n", "-332\n", "-193\"\"\".split('\\n')\n", "sequence = [int(item) for item in sequence]" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "372139" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "jump_until_out(sequence)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Part 2 " ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [], "source": [ "def jump_until_out_part2(mysequence, debug=False):\n", " \"Returns the number of jumps needed to exit the sequence.\"\n", " sequence = mysequence[:]\n", " jumps = 0\n", " current = 0\n", " while current >= 0 and current < len(sequence):\n", " this_jump = sequence[current]\n", " if this_jump >= 3:\n", " sequence[current] -= 1\n", " else:\n", " sequence[current] += 1\n", " current += this_jump\n", " jumps += 1\n", " if debug: print(sequence)\n", " return jumps" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0, 3, 0, 1, -3]" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "test_sequence" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[1, 3, 0, 1, -3]\n", "[2, 3, 0, 1, -3]\n", "[2, 2, 0, 1, -3]\n", "[2, 2, 0, 1, -2]\n", "[2, 3, 0, 1, -2]\n", "[2, 3, 0, 2, -2]\n", "[2, 3, 0, 2, -1]\n", "[2, 3, 1, 2, -1]\n", "[2, 3, 2, 2, -1]\n", "[2, 3, 2, 3, -1]\n" ] }, { "data": { "text/plain": [ "10" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "jump_until_out_part2(test_sequence, debug=True)" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "29629538" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "jump_until_out_part2(sequence)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 6" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [], "source": [ "import operator" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [], "source": [ "bank = [0, 2, 7, 0]" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [], "source": [ "def iter_banks(mybank, debug=False):\n", " \"\"\"Iters over possible bank configurations.\"\"\"\n", " bank = mybank[:]\n", " seen = dict()\n", " hashit = lambda bank: \"-\".join([str(item) for item in bank])\n", " seen[hashit(bank)] = True\n", " while True:\n", " index, biggest = max(enumerate(bank), key=operator.itemgetter(1))\n", " if biggest % len(bank) == 0:\n", " step = biggest // len(bank)\n", " bank[index] = 0\n", " min_index = index + 1\n", " max_index = min_index + biggest // step\n", " for i in range(min_index, max_index):\n", " bank[i % len(bank)] += step\n", " else:\n", " step = biggest // len(bank) + 1\n", " bank[index] = 0\n", " min_index = index + 1\n", " max_index = min_index + biggest // step \n", " for i in range(min_index, max_index):\n", " bank[i % len(bank)] += step\n", " bank[(i+1) % len(bank)] += biggest - biggest // step * step\n", "\n", " if debug: print(bank)\n", "\n", " if hashit(bank) in seen:\n", " return len(seen)\n", " else:\n", " seen[hashit(bank)] = True\n", " " ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "iter_banks(bank)" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "4" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "iter_banks([2, 4, 1, 2])" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [], "source": [ "input = \"14\t0\t15\t12\t11\t11\t3\t5\t1\t6\t8\t4\t9\t1\t8\t4\".split('\\t')\n", "input = [int(item) for item in input]" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[14, 0, 15, 12, 11, 11, 3, 5, 1, 6, 8, 4, 9, 1, 8, 4]" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "input" ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "11137" ] }, "execution_count": 35, "metadata": {}, "output_type": "execute_result" } ], "source": [ "iter_banks(input)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Part 2 " ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [], "source": [ "def iter_banks_part2(mybank, debug=False):\n", " \"\"\"Iters over possible bank configurations.\"\"\"\n", " bank = mybank[:]\n", " seen = dict()\n", " niter = 1\n", " hashit = lambda bank: \"-\".join([str(item) for item in bank])\n", " init_hash = hashit(bank)\n", " seen[hashit(bank)] = True\n", " while True:\n", " index, biggest = max(enumerate(bank), key=operator.itemgetter(1))\n", " if biggest % len(bank) == 0:\n", " step = biggest // len(bank)\n", " bank[index] = 0\n", " min_index = index + 1\n", " max_index = min_index + biggest // step\n", " for i in range(min_index, max_index):\n", " bank[i % len(bank)] += step\n", " else:\n", " step = biggest // len(bank) + 1\n", " bank[index] = 0\n", " min_index = index + 1\n", " max_index = min_index + biggest // step \n", " for i in range(min_index, max_index):\n", " bank[i % len(bank)] += step\n", " bank[(i+1) % len(bank)] += biggest - biggest // step * step\n", "\n", " if debug: print(bank)\n", "\n", " if hashit(bank) in seen:\n", " return niter - seen[hashit(bank)]\n", " else:\n", " seen[hashit(bank)] = niter\n", " niter += 1\n", " " ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "4" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "iter_banks_part2(bank)" ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3" ] }, "execution_count": 38, "metadata": {}, "output_type": "execute_result" } ], "source": [ "iter_banks_part2([2, 4, 1, 2])" ] }, { "cell_type": "code", "execution_count": 39, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1037" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "iter_banks_part2(input)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 7 " ] }, { "cell_type": "code", "execution_count": 40, "metadata": {}, "outputs": [], "source": [ "input = \"\"\"wdysq (135) -> sxldvex, wiasj\n", "vjwuuft (33) -> inuci, neddz, rwamq\n", "oislgqy (77)\n", "lphki (233)\n", "wgbviwb (417)\n", "vikip (136) -> eofyk, dkexo, xzsxx\n", "elmieqh (19) -> dbziu, spefs, krtxpw\n", "tmzef (79)\n", "ectlgy (232) -> zmstcy, ncobxr\n", "sdatyo (91)\n", "uisri (11)\n", "smqimxg (132) -> husor, olzys\n", "pltzthr (82)\n", "szaqj (188) -> ptnndxj, fljpye\n", "jqdngi (58)\n", "uazwsu (15)\n", "xrrhso (79)\n", "gxeehd (68) -> iweii, rnqlzmv, hpmtom, vfzwqfr, xfzxrd, sgqhelx, hibjkps\n", "evkoenr (43) -> oecxbyt, qbthgst\n", "qivuzn (52)\n", "udeev (389) -> lphki, qthzk, hpgsb\n", "izgqzs (96) -> vbxzk, ubrrdtd\n", "naxtp (65)\n", "mvtkwn (42)\n", "sxldvex (34)\n", "tnlpmw (49)\n", "rzbrbmy (31) -> dvnqv, helyy\n", "esavxwq (81)\n", "yqgru (465) -> gfuyuz, elmieqh, xckzut, tmbhjxf\n", "ygypj (1303) -> ohcuki, ejdjxu, ytabct\n", "yggqq (855) -> gowlaq, ebtoxi, xpljwl\n", "ubaxya (92)\n", "pjkzokv (23)\n", "lvarp (76)\n", "yrysmsi (14)\n", "nofepy (23)\n", "apjeywv (132) -> kclmmu, exsugls\n", "licrtwb (56)\n", "gspffet (84) -> wqzxa, lptaikg\n", "gkrqba (82)\n", "mqreb (126) -> jvdoo, paykww\n", "xtidu (12)\n", "kjauagn (88)\n", "vvafqjs (56) -> qbvhefh, vfhgfb, iqtyv, ebdva, uxqkau, tydtcxc\n", "snuewn (118024) -> vvafqjs, mhaucon, kikva, mqnbmre\n", "gtkii (163) -> txcon, vuvwa\n", "oaoisa (61)\n", "ssqrs (24)\n", "ybditq (21)\n", "xgqxofa (119) -> bedzc, hdbkw, zwgsh\n", "wxfir (71)\n", "pxvse (19)\n", "xemcuk (23)\n", "paunv (28) -> zzvhmse, mubkcmk, vksephm, cbsdget, mellhhn\n", "couhjsv (11)\n", "tuzpls (58)\n", "puomwl (90) -> wtxjnc, jdjbnc\n", "wudlze (78)\n", "ibslyw (153) -> ksncpee, npvuz\n", "zzmczwl (54)\n", "kidvt (3136) -> tuzzzct, qtqhwon\n", "patlvg (20)\n", "yvvxtg (90)\n", "epxwjhy (22)\n", "epvyxld (17)\n", "xhecnbf (85) -> yituewe, wwhyd\n", "mqsrwsz (26)\n", "bhyzi (73)\n", "batky (18815) -> woctu, iykjtnw, tpiwftj\n", "sdponx (44)\n", "qhotyqx (95) -> vdwfz, agthd, tuwedv, ixkkdyc, lnlkwq, bvmhqar, rlwmfp\n", "nubqteb (89)\n", "zygfdu (70)\n", "tkerz (18)\n", "solqvvf (10)\n", "akiaxs (86)\n", "jsfqyd (70)\n", "aialff (68)\n", "uiilkiq (73)\n", "adlyhbs (46)\n", "tnljdhr (20)\n", "frctm (471) -> isqnx, euhgw, nrfqc, cmmnjch, zevrg\n", "jjklma (105) -> xrrhso, uyjor\n", "lpmnwh (56) -> orrfh, bqfzqra\n", "owxski (23)\n", "gqxyh (18)\n", "lpyntz (91)\n", "ivvyjos (81)\n", "qssjswr (268)\n", "jkbks (225)\n", "jwbdb (83)\n", "axqrke (119) -> mgoic, yivgs, bxggi, xamfjfv\n", "uwizlce (24)\n", "wuwhup (50)\n", "suawycj (60)\n", "wazvn (99)\n", "wtxjnc (53)\n", "ebtoxi (64) -> ttbns, voxychz, umsdpa, ajjmsnw\n", "uuhoydu (82) -> gvucdh, hesyq, glwsf\n", "tshyvej (1373) -> ebiovn, uvzpp, pblqb\n", "bhakbq (991) -> izqxal, nhhytw, flmma, isgky, coqek\n", "hcsjun (60) -> inelfwo, qcnstq, eymmhh, lpyntz\n", "otjbn (67) -> szaqj, kkhlzm, jtzdqn\n", "vtwud (10735) -> jldhlug, ikfzj, tsevkec\n", "heztht (86)\n", "rqonynk (65) -> olzqxap, oyhqsok\n", "esbdjah (61)\n", "hdinwud (1515) -> bdiftdg, ydtuje, aambg\n", "rbbjcq (71)\n", "kimffjc (155)\n", "wifrwut (91)\n", "hrlgs (9)\n", "ieowdj (76)\n", "vpqsjbj (147) -> eziosif, rptcpf\n", "rlurjca (51) -> gtbjtpi, ohpkkhx, zkwnhn, cagvlf, zvlobk, ahsqaob, iactix\n", "yzykfd (43) -> atqfhm, kazwz\n", "kikva (6131) -> gkpalaj, jafrv, uekzf\n", "lsoen (51)\n", "uexqjw (10923) -> dxczurt, omqhf, ylfxp, qofsaux\n", "nlnphv (117) -> vzlzrt, ypiwnt\n", "bemxocu (78)\n", "etcsuuv (312)\n", "ihwbmt (27)\n", "oorvvpt (63)\n", "dvnqv (88)\n", "ntlawn (60)\n", "jhaow (45)\n", "kccpv (17)\n", "kbybvzk (89)\n", "ctcmfv (49)\n", "ujqjrz (89)\n", "xekft (62)\n", "wihtv (1278) -> qgbbhdv, adlyhbs\n", "agthd (158) -> ucnehpw, hnutx\n", "vuytzn (21)\n", "svcqds (7)\n", "emqqf (5)\n", "uqddsal (17) -> trait, sdatyo\n", "uhwlk (252) -> sxtto, qyvsaxn\n", "ttbgzv (46) -> rokri, pygoqsv\n", "oecxbyt (71)\n", "xunvu (33)\n", "mvbtomp (35)\n", "uxqkau (693) -> qubhi, gneut, htmcpcy, qmncyu, wdysq\n", "ycrnaf (177) -> ssqrs, twimkx\n", "nlalji (28)\n", "dgvvo (37)\n", "niydqsy (33)\n", "pprvv (89)\n", "tmbhjxf (135) -> jutep, vkhiz\n", "iaftm (63)\n", "zjnrzph (81) -> gsxmqnw, gnxfwv\n", "ggzqccl (5)\n", "wwtiby (121) -> kytha, dgzywn\n", "zismp (58)\n", "hjbrfba (28)\n", "xnlkkx (79) -> puomwl, xnbvupf, hgksz\n", "bptaz (38)\n", "ozaogat (15)\n", "hxxml (27) -> emazu, kproiw\n", "xpptslq (76)\n", "ilohfvn (10)\n", "hadddf (128) -> geapi, ocltuv\n", "gtprqg (17)\n", "qofsaux (209) -> bbnjml, fwskxq\n", "xpljwl (128) -> ufust, aialff\n", "thhbhrm (41) -> smqkli, ovtfd\n", "xamfjfv (36)\n", "jdjbnc (53)\n", "kecpcmj (72)\n", "ixkkdyc (80) -> wutzrk, antev\n", "ysnbr (35)\n", "cyvwwa (190) -> jtqxxa, pgmtcg, btvsj\n", "uyjor (79)\n", "oztxmy (76)\n", "cancxr (213) -> ivdvlvq, ykxalh\n", "zlads (14)\n", "peokkb (167) -> mqkqtjo, qpchzkg, epssvr, yzose\n", "iauxpc (81)\n", "qbodszw (945) -> rgdvqu, oktgjb, abstvp\n", "dmwutl (73) -> desuqj, etjwno\n", "fcaht (134) -> ajidd, kigxtt\n", "fkgkcwd (51) -> mqwagy, gvtve, djvbdm, ckapp, ldiqm, ezspaq, pyrvg\n", "dqzkic (1032) -> inglhm, dgxdydd, hxhhhu\n", "ydtykm (75)\n", "zatfy (35)\n", "rmenjck (89)\n", "nrfqc (238) -> zgxjjm, fwide\n", "schexn (97)\n", "lrplxk (22)\n", "nroecsv (44)\n", "kiawm (64)\n", "zpfuxux (73)\n", "mvdkbch (28)\n", "sufdte (71) -> gfjeud, rbbjcq\n", "xmjunhp (45)\n", "wsnsqx (7)\n", "etyaxa (13)\n", "cfrqn (57)\n", "tslujme (60)\n", "bebuqpx (33)\n", "wwyuud (11)\n", "gtotarq (95)\n", "vtopekt (65)\n", "hxhhhu (230)\n", "aubvpzf (73)\n", "kllsasv (73) -> enuvuv, jlhipos, hittl, smyzyqg\n", "mgiuz (94)\n", "dsytvn (296) -> mxfonyo, yihru\n", "icsxziz (256)\n", "agflbq (73)\n", "amtrbok (12)\n", "qcebc (20)\n", "eymmhh (91)\n", "pbpva (95)\n", "rodxm (199) -> rzvlc, vnmml, rrmlgct\n", "ekblpi (97) -> flwbwcq, ecwpa, usgpgi, pknsw, gkjwl, zzfom\n", "ltpmtif (86)\n", "bkfnip (4873) -> murnoa, qhzem, udeev\n", "yhiab (249) -> sdponx, yvattv\n", "hbaai (70) -> rmnkup, dgtsic\n", "anazjn (225)\n", "zjjyjj (101) -> viwez, ihwbmt, qnwwjwt\n", "husly (98)\n", "jlhipos (20)\n", "xflsc (2516) -> qodow, vdkhvyp, masvpfj\n", "cenqs (156) -> jhaow, mivmhi\n", "rgrcla (84) -> nroecsv, pexfst\n", "pdddwgk (30)\n", "upefkx (75)\n", "abstvp (46) -> wqgoxl, gbwaobo\n", "glzmsn (93)\n", "bgtzw (37)\n", "flvrfdl (146) -> ybditq, vuytzn, yqdaz\n", "jmzpxql (47)\n", "wulvcf (89)\n", "mxfonyo (20)\n", "aambg (69)\n", "jfjvw (32)\n", "uslhk (8)\n", "wwzjdv (45)\n", "zwtsg (248) -> bjjtifj, ogbov\n", "mbxyf (56)\n", "xckzut (157) -> gaalz, upefkx\n", "trseebo (18)\n", "hbcpm (32)\n", "ggoaczz (88)\n", "zangrh (66)\n", "ktbto (55) -> pdqzfg, mfoismz, mkirruz\n", "rhpcgg (197) -> evkoenr, klpzhup, cigew\n", "kbbcau (25)\n", "porttu (92) -> haaqbj, lttlp\n", "gfsgzni (73)\n", "pyaqqhu (134) -> kdkobz, szvocp\n", "eiyiuq (54)\n", "fjgjfpc (17)\n", "lvvkjx (56)\n", "kinah (22)\n", "ivdvlvq (31)\n", "njerlzh (35)\n", "zzdae (63)\n", "rrkbjhn (78)\n", "hnutx (50)\n", "oqokji (198)\n", "voxychz (50)\n", "zovlqz (56)\n", "ulood (81)\n", "yzttfu (15)\n", "htmcpcy (203)\n", "jmytuxi (221) -> dvuctqv, sgilmx, fqdolnu, rdrncg\n", "rehhbv (17)\n", "ixkpaf (59) -> jqbdh, atvtit, qcebc\n", "antev (89)\n", "jfikdf (20)\n", "ykxalh (31)\n", "vqwclk (19) -> ewldimp, wkeqlvj, ouxuh\n", "hxeqn (528) -> kimffjc, qpgphk, vqfiq\n", "umsdpa (50)\n", "aodfzpi (69)\n", "wutzrk (89)\n", "jyjvpeb (81)\n", "ttbns (50)\n", "wmewl (977) -> yhiab, iordzi, uuhoydu\n", "ydejjeb (159) -> yvcanc, jrrubn\n", "bykuuwe (80)\n", "iesjhoq (336) -> bhzfx, sxexfai, mjounwc\n", "kdrhj (1832) -> rrkbjhn, gzpgvqq\n", "smyzyqg (20)\n", "kigxtt (80)\n", "rokvo (7)\n", "wpcng (50)\n", "koevsvb (97)\n", "yihru (20)\n", "krtglj (18)\n", "cmfwwv (40)\n", "jsaujq (1397) -> rgrcla, vqwclk, rxilrp\n", "gmjxxi (97)\n", "ekvmhd (49)\n", "lttlp (66)\n", "takbkro (200) -> ngjipr, inhfutj\n", "whvpgmw (54)\n", "lqaveh (97)\n", "qthzk (187) -> wntmkg, pjkzokv\n", "haaqbj (66)\n", "vxufrto (40)\n", "zseldo (181) -> hdvtd, papbxya\n", "psmgm (95)\n", "clwtgt (34)\n", "bpwxvvw (89)\n", "pmyrysb (77)\n", "gjclsl (75)\n", "olzys (57)\n", "woqoljk (99)\n", "ocodtdz (30) -> gjclsl, ogioyhi\n", "nbybi (54)\n", "veiaf (139) -> vlqqgb, iaftm\n", "uvzpp (165) -> mxvba, jjtafg\n", "qodow (63) -> oqxnfd, rpxaf, sybnvtp\n", "kouye (58)\n", "dlhuell (84) -> schexn, otzinx\n", "nlrlj (145) -> veknoj, lfpjfv, yrlnu, ugelox\n", "sambc (138) -> mnoinr, pkordz\n", "bypqww (50)\n", "rgkfzk (35)\n", "kiatxq (1232) -> dispgy, irnjtjo, iqpoc\n", "gigtu (60)\n", "xzsrv (89)\n", "dhafpel (636) -> vxddev, nxkpnt, zbuftv\n", "bqfzqra (71)\n", "rcbqqok (243) -> ofrogun, wwyuud\n", "oaqkk (69)\n", "dgxdydd (132) -> mudewqe, bazwto\n", "vxddev (128) -> bzpjiss, qmjamoi\n", "iqtyv (800) -> lvtotof, zddmrx, yzykfd, nlnphv\n", "vdcmrrr (93) -> xuoyxmc, amrcopl, fcnsfy\n", "jutep (86)\n", "cyanr (23)\n", "cxyxa (97)\n", "tuzkv (153) -> iflll, tipewrj\n", "cdegn (52)\n", "mvijo (35)\n", "xnbvupf (60) -> frlgjzf, wtorpp\n", "rwopuzo (15)\n", "uxfsb (76)\n", "qedyqs (157) -> bjzbqzq, alfqryh\n", "rwhgw (76)\n", "csmjozb (79) -> sasym, wmewl, kdrhj, btvmyff, sqkfgo, jcputh\n", "jbujmr (294)\n", "xvjfw (8)\n", "ekfwu (17)\n", "ebiovn (225) -> mnufo, rokvo\n", "ohcuki (197) -> alsfpfg, xsfryrh\n", "zavisuv (15)\n", "glwsf (85)\n", "vurdlqx (196) -> acfdkr, aefjv\n", "ihksnmq (95)\n", "ecwpa (248) -> soyta, ytomr\n", "jldhlug (234)\n", "oazfz (61)\n", "rdrncg (16)\n", "rrrmaka (51)\n", "qhgzopn (66) -> tmzef, iiiupn\n", "ifetn (86)\n", "plgjg (99)\n", "okjds (73)\n", "algkwbg (99)\n", "ugmhzm (56)\n", "vvnhm (135) -> ntrtfv, ihuqmbd\n", "csuywzh (1788) -> wgvpotf, fwtxvo, vikip, bpzhj, bomuft, otjbn, zsotrv\n", "pawpvkj (47)\n", "zzvkwsb (148) -> hjfucl, gxcft\n", "aivbhtz (78)\n", "nyckm (23)\n", "qwqpht (68)\n", "kbuurtb (62)\n", "ahexrp (19)\n", "dlikiv (247) -> kinah, sthtydb\n", "udiai (50)\n", "lopnwz (91)\n", "xbtvux (73)\n", "gvtve (222) -> typbqmw, vdsaccd, sdlta, uisri\n", "vczyhcg (8)\n", "edswttn (58)\n", "kqaua (89)\n", "lmnuii (536) -> rlwoz, gjvmrh, ukapl, lthoz, boahhv, ylpxahm, rqonynk\n", "kwlyw (193) -> hcruo, kecpcmj\n", "trskdr (322) -> hdrfo, bimxf\n", "clbmn (33)\n", "scffzsr (48)\n", "ewldimp (51)\n", "qhixu (21) -> roorbg, oruhqn, psmgm\n", "ypcup (94)\n", "vrszijz (56)\n", "vksephm (157) -> ngkax, tkerz\n", "sxtto (30)\n", "tkojiz (12)\n", "elygt (569) -> bixtvg, xsqbapj, ocodtdz\n", "vdctvf (84) -> iauxpc, cuyweja\n", "rktxkyb (108) -> xjbot, flwjj\n", "zckdwxe (54)\n", "vfzwqfr (54) -> mphzxio, clbmn, donnc, niydqsy\n", "iqpoc (260) -> zlads, jhapr\n", "pojst (51)\n", "ueitm (169) -> emqqf, qqstwmn\n", "dgzywn (39)\n", "ldcmzd (130) -> mertvs, ggoaczz\n", "xtgmmc (306)\n", "mjounwc (9)\n", "ftbiwxy (62)\n", "ogioyhi (75)\n", "fkitgnx (69)\n", "gvucdh (85)\n", "opsrep (43)\n", "olsycb (59)\n", "jiizacd (49)\n", "qbthgst (71)\n", "nxqvwm (69)\n", "rvrzp (113) -> xrqhewm, ifetn\n", "pkordz (84)\n", "vempqu (6)\n", "ulmwqtm (230)\n", "zwgsh (43)\n", "srgob (561) -> plrig, djbtbrk\n", "rmnkup (47)\n", "btvmyff (1442) -> mrqtrkq, zjjyjj, uqkskjn\n", "nrfyua (11)\n", "nuozixg (1064) -> nnelc, zmzobfp, oggljxs\n", "icrvj (22)\n", "vksphlf (1423) -> kdykksn, wwtiby, uqddsal\n", "xmnbar (58)\n", "ukapl (195)\n", "lijszmh (44)\n", "zzonk (28)\n", "jhapr (14)\n", "mrqtrkq (88) -> zaxbfog, pawpvkj\n", "aibtig (109) -> ggzqccl, hyxtojc\n", "vuvwa (87)\n", "ahysv (90)\n", "mqwagy (88) -> uxlisdh, rmenjck\n", "xpttnwd (95)\n", "oullg (25) -> dlhuell, imrwgqw, hadddf, rktxkyb, zwtsg, wllrov\n", "bwsgfa (22)\n", "vmiykci (153)\n", "jcgvp (18) -> mvbtomp, zatfy\n", "wetluzb (33)\n", "zvnzrr (37)\n", "sgilmx (16)\n", "geabygu (96)\n", "kakvi (41)\n", "fuujiy (92) -> xnfuz, urrhqwc, fmdfm\n", "ppvsy (285)\n", "nyuxiu (122) -> nzvqjrt, dhzsao\n", "tjwynpa (75)\n", "gowlaq (138) -> uwvfga, bnvlydl\n", "snywwu (26) -> snqey, aodfzpi\n", "cvude (41)\n", "snqey (69)\n", "ejqam (17)\n", "pgmtcg (47)\n", "rtcqml (85) -> zangrh, dspug\n", "ezspaq (215) -> rehhbv, epvyxld, oguxu\n", "ytabct (89) -> frfotet, zerxp\n", "nxkpnt (248)\n", "qubhi (107) -> lnznpq, scffzsr\n", "tfotbwz (424)\n", "wkgyfpp (824) -> ccbie, iesjhoq, kdffrsb\n", "wjsxcmb (95)\n", "ztdbvxb (53) -> zismp, dqoagdt, yxfjglq, givaxj\n", "ouxuh (51)\n", "xfzxrd (22) -> kakvi, mjlvx, wridnv, zeexkde\n", "rekerpj (7)\n", "redkli (81)\n", "qdkhjb (53)\n", "yituewe (95)\n", "ocnkhq (10)\n", "iaayhc (300) -> fwhhoz, ycrnaf, jkbks, anazjn, yhzjjgc, pocwgw\n", "mjlzzq (212) -> hwycny, gmzabjk\n", "rhaoo (36) -> kdzhiq, ydkhmp, dsytvn, wzezz\n", "fqkzcq (293) -> gztng, oiaxzp\n", "essijo (1248) -> wuqapgg, msmxf\n", "ckapp (94) -> clktah, akiaxs\n", "nktwwvp (159) -> qivuzn, cdegn\n", "qxwdzl (50)\n", "lfpjfv (48)\n", "lmfclbd (14)\n", "cglyptu (240) -> icrvj, epxwjhy, tpmqmg\n", "dhzsao (24)\n", "bckfa (16) -> ntlawn, tslujme, ccjze, woklobt\n", "mivmhi (45)\n", "bfjxeyo (24)\n", "plrig (53)\n", "ijlooi (1429) -> jcgvp, zvsgd, fzafkj\n", "pyhcj (64)\n", "gdvbtjk (71)\n", "fxrkz (70)\n", "husor (57)\n", "riiaj (44) -> lvvkjx, mbxyf\n", "lxmvg (4738) -> msjbv, ijoaqyv, yname\n", "wntmkg (23)\n", "helyy (88)\n", "muxvdx (57) -> veiaf, rcbqqok, gfnmx, zezeds, ktbto, qedyqs\n", "rroub (41)\n", "hnwfe (89)\n", "enuvuv (20)\n", "wzzlsg (18)\n", "hpgsb (81) -> xpptslq, jtoryw\n", "woklobt (60)\n", "jicyq (18)\n", "lybwr (64)\n", "ujgpnsy (12)\n", "mbtweib (86)\n", "vgzejbd (10) -> vuoqao, vwkkml, kmpfxl, snuewn, jjgjvki, fiprusz\n", "vgfveov (198)\n", "lvtotof (49) -> pprvv, gsckda\n", "ylpxahm (33) -> jyjvpeb, tytsynv\n", "glximrw (53)\n", "iykjtnw (542) -> dizqtw, oiozpzq, dmwutl\n", "xuoyxmc (51)\n", "wpvale (18626) -> wihtv, isbdm, gxeehd\n", "jruttt (28)\n", "urrhqwc (84)\n", "yfyaho (7)\n", "klpzhup (11) -> befwz, mypula, xmnbar\n", "kclmmu (49)\n", "qcnstq (91)\n", "sasym (13) -> vimnt, eoign, lusub, peokkb, mlhaxv\n", "mgoxhns (130) -> edswttn, ioycu\n", "stzzli (89)\n", "ltesfzf (44) -> sufdte, vpqsjbj, oghyxz, hxxml, mnhrjdv\n", "yxfjglq (58)\n", "fuhbay (82)\n", "gxcft (25)\n", "rwamq (86)\n", "qxqwmye (68)\n", "ketopn (42)\n", "tmsmb (84) -> pkxrm, pbbkg\n", "zerxp (75)\n", "zpbrw (95)\n", "wuqapgg (66)\n", "nmsats (82)\n", "vvzctek (9)\n", "cmoty (91)\n", "qkkhj (88)\n", "pocct (99)\n", "xyfvxng (45)\n", "mqnbmre (2069) -> vecnb, azhddw, muxvdx, qbodszw, yggqq\n", "msjbv (918) -> nktwwvp, qijleb, ttnoqm, ulaio, furlcyu\n", "mkirruz (70)\n", "mubkcmk (163) -> solqvvf, ocnkhq, wntitz\n", "lvzzwy (89)\n", "ypiwnt (55)\n", "bveilrx (306) -> pxvse, ahexrp\n", "shiaqps (45)\n", "mlhaxv (297) -> ctcmfv, ekvmhd\n", "eiohuhm (72)\n", "isqnx (122) -> azgohsw, pltzthr\n", "qqstwmn (5)\n", "fiwvclv (80)\n", "zobti (87)\n", "qbvhefh (53) -> ylazd, cyvwwa, sfkpzr, zsjlevq, zseldo\n", "xqgxel (54)\n", "yrlnu (48)\n", "rrmlgct (19)\n", "jtzdqn (178) -> lsoen, pojst\n", "nffvt (37)\n", "axtepsa (13)\n", "ngkax (18)\n", "viwez (27)\n", "kdykksn (7) -> geabygu, cfiqn\n", "zvlobk (419) -> mdfkbxa, wzzlsg\n", "xsqbapj (164) -> xqxvktz, xvjfw\n", "nzvqjrt (24)\n", "gbqbg (18)\n", "hskko (38)\n", "bgmntpq (6)\n", "zddmrx (227)\n", "dgtsic (47)\n", "iijfq (73)\n", "qytxu (71)\n", "mklcsj (54)\n", "jnwdraz (63) -> aubvpzf, zpfuxux\n", "hudde (1072) -> wyrfplr, rzbrbmy, ujmfmiu\n", "jcoyk (18)\n", "dspug (66)\n", "qgbbhdv (46)\n", "neddz (86)\n", "boahhv (195)\n", "ajjmsnw (50)\n", "lusub (209) -> nrloleu, lfwpqb\n", "bkgise (17)\n", "xsgyar (568) -> fesce, vfteg, thhbhrm, vvnhm\n", "mudewqe (49)\n", "trait (91)\n", "fljpye (46)\n", "xobszr (61)\n", "pkxrm (57)\n", "qrynkpt (22) -> kswafh, oztxmy, zejcp\n", "frlgjzf (68)\n", "aomksx (70) -> pmyrysb, robpw\n", "gjvmrh (167) -> xxtyban, mfjdb\n", "atvtit (20)\n", "ihuqmbd (34)\n", "mfjdb (14)\n", "rptcpf (33)\n", "ljitswv (89)\n", "zkujvlv (51)\n", "ydtuje (69)\n", "emazu (93)\n", "sqkfgo (1451) -> ueitm, okbtg, cnzynyj\n", "flmma (86) -> ygglox, ocvrlia\n", "jnqgs (76)\n", "ctken (72)\n", "kxdbyp (20)\n", "ktlkx (112) -> etyaxa, axygpr, rqsyc, axtepsa\n", "hesyq (85)\n", "tydtcxc (919) -> swcsd, nkclzqq, dhcopz\n", "sqbxzl (12)\n", "dispgy (52) -> olsycb, ynecxzo, esqvkcm, xclsj\n", "djbtbrk (53)\n", "svjnd (47)\n", "fizbyu (78)\n", "vqfiq (61) -> zdrhuz, jmzpxql\n", "tqsrg (70)\n", "dulrvcq (2086) -> apjeywv, vurdlqx, bwemy, ulmwqtm, qkxtwct\n", "gfjeud (71)\n", "xdzgwl (220) -> jicyq, prbbfe\n", "jcputh (196) -> xdzgwl, rodxm, piutfin, ezmot, bckfa, zyisjsj, icsxziz\n", "gbwaobo (94)\n", "mlyar (44)\n", "zsotrv (751) -> wudlze, hjmreq\n", "chxgqe (47)\n", "junva (83)\n", "fmdfm (84)\n", "ewwab (70)\n", "hdrfo (51)\n", "qijleb (111) -> qngug, voxemk\n", "qmjamoi (60)\n", "pyrvg (230) -> shcavm, trseebo\n", "joszidy (95)\n", "rxilrp (138) -> gtprqg, xqgqp\n", "ptnndxj (46)\n", "typbqmw (11)\n", "fesce (39) -> fuhbay, jozav\n", "oeixw (65)\n", "gjhfseh (20)\n", "zeexkde (41)\n", "ynecxzo (59)\n", "oqfpo (78)\n", "keazynv (68)\n", "gnsdn (51) -> njerlzh, rgkfzk, lhyzwtf\n", "sqljeh (20)\n", "dclmckh (93)\n", "rqsyc (13)\n", "wvwjep (70)\n", "ncobxr (8)\n", "builgr (78)\n", "xkdjbxo (81)\n", "bzpjiss (60)\n", "vfomix (95)\n", "wtorpp (68)\n", "pruui (1276) -> glaosn, xgqxofa, ggkael\n", "monhu (76)\n", "piutfin (156) -> wpcng, qxwdzl\n", "wrwim (10)\n", "jrrubn (52)\n", "vkdytw (24)\n", "vdtdmy (26)\n", "pbbkg (57)\n", "uwviodb (208) -> bkxfso, evrtfzj\n", "vfhgfb (1084) -> gnsdn, ttbgzv, pyaqqhu, riiaj\n", "iordzi (223) -> cfrqn, nzuhp\n", "biffdx (42)\n", "bpsesr (50)\n", "cglfuq (199) -> vempqu, noogeuk, bgmntpq\n", "bkxfso (19)\n", "oopnu (88)\n", "wlavb (92)\n", "gmzabjk (41)\n", "ehrfv (57) -> pruui, eondv, ygypj, vksphlf\n", "lpwuzn (89)\n", "cnzynyj (89) -> wwzjdv, xyfvxng\n", "dgmtgrv (12)\n", "hpmtom (50) -> zzpwgcd, qxqwmye\n", "jafrv (719) -> qhgzopn, aomksx, porttu\n", "msmxf (66)\n", "ldiqm (266)\n", "llydxxz (37)\n", "vdsaccd (11)\n", "cbsdget (81) -> licrtwb, zovlqz\n", "qgwhbwh (62)\n", "epuqu (17)\n", "loojs (43)\n", "ovshy (95)\n", "qhayeqe (86) -> opsrep, loojs, fvukbun\n", "amrcopl (51)\n", "tsncd (108) -> zygfdu, jsfqyd\n", "oguxu (17)\n", "skyaki (69)\n", "ufxfx (25)\n", "mpzyapm (19409) -> elygt, ltesfzf, dhqrk\n", "lthoz (150) -> rwopuzo, uazwsu, ozaogat\n", "xxtyban (14)\n", "ggkael (54) -> gmjxxi, koevsvb\n", "yuyhys (12)\n", "qngug (76)\n", "kazwz (92)\n", "owysb (71)\n", "eondv (25) -> uxggaix, ngfxax, ztdbvxb, jmytuxi, hkxfb, rvrzp, ppvsy\n", "oyhqsok (65)\n", "iflll (97)\n", "xjbot (85)\n", "tytsynv (81)\n", "rsyxcdq (157)\n", "vuoqao (102055) -> kahduw, lxmvg, vtwud, ktcffyf, ggdoqnl\n", "ocvrlia (48)\n", "cpuxdo (75) -> rroub, cvude\n", "tpiwftj (482) -> cancxr, xhecnbf, ilcmx\n", "eaoxb (2777) -> cfrbz, vmiykci, kllsasv\n", "alfqryh (54)\n", "gfnmx (214) -> ekfwu, ejqam, kccpv\n", "daerl (14)\n", "nvahhge (14)\n", "rzvlc (19)\n", "ktcffyf (1777) -> dhafpel, jtyljl, nmcewof, rhaoo, xsgyar, otetl, essijo\n", "pntvfpd (49)\n", "hkxfb (285)\n", "ngfcc (87)\n", "yqdaz (21)\n", "qzwauo (49)\n", "kdkobz (11)\n", "tslbp (224) -> mvijo, qolgxnd\n", "vlqqgb (63)\n", "zsjlevq (175) -> bemxocu, builgr\n", "xzsxx (79) -> zugkqyx, jubeqci\n", "yvattv (44)\n", "nhhytw (44) -> skyaki, nxqvwm\n", "zmzobfp (75) -> ntxtwk, yhvdjl, xzsrv\n", "sretj (240) -> wsnsqx, rekerpj, knciro, svcqds\n", "awwhgzp (70)\n", "adqnigs (72)\n", "oipscid (85)\n", "xsyqdlv (26)\n", "eoign (134) -> aujeia, ngfcc, zobti\n", "nfulfov (14) -> aivbhtz, exlwxxi, oqfpo\n", "fqehxv (168) -> lgonp, vxufrto\n", "impzr (70) -> lybwr, pyhcj\n", "bnvlydl (63)\n", "olzqxap (65)\n", "frfotet (75)\n", "ajidd (80)\n", "qyvsaxn (30)\n", "rlwoz (19) -> kjauagn, qkkhj\n", "hysssy (12)\n", "ptmsqz (81)\n", "kahduw (31) -> qhotyqx, xhxek, bhakbq, ivgpv, lmnuii, frctm\n", "ejdjxu (41) -> wazvn, algkwbg\n", "ylfxp (99) -> heztht, mbtweib\n", "isgky (80) -> kecckss, obakqyf\n", "xclsj (59)\n", "qhzem (47) -> fnkgp, ujipv, tuzkv\n", "zaxbfog (47)\n", "uekzf (1315) -> qjxikz, bptaz\n", "gkjwl (50) -> pucdapo, zckdwxe, xqgxel, vcprhe\n", "xqgqp (17)\n", "ntrtfv (34)\n", "ufust (68)\n", "yvcanc (52)\n", "jtqxxa (47)\n", "rfumv (92)\n", "qjxikz (38)\n", "sybnvtp (59)\n", "pugxio (62)\n", "olfwppt (154) -> bwsgfa, lrplxk\n", "ugelox (48)\n", "oruhqn (95)\n", "rlwmfp (158) -> bypqww, wuwhup\n", "qnwwjwt (27)\n", "hjmreq (78)\n", "paykww (22)\n", "aefjv (17)\n", "hvpess (1924) -> vaxtfaa, wbnmb\n", "dbziu (96)\n", "xnfuz (84)\n", "tpmqmg (22)\n", "qrinzet (69)\n", "ldrpjd (88)\n", "pocwgw (13) -> glximrw, bhmirp, rcqkas, qdkhjb\n", "sxexfai (9)\n", "euhgw (208) -> xrbkzmk, xsyqdlv, vdtdmy\n", "ulaio (203) -> pdddwgk, sakmm\n", "vnmml (19)\n", "ksncpee (28)\n", "pucdapo (54)\n", "ucnehpw (50)\n", "btvsj (47)\n", "veknoj (48)\n", "papbxya (75)\n", "sdzhsq (94)\n", "orrfh (71)\n", "gnxfwv (68)\n", "grthhzv (244) -> dgmtgrv, tkojiz\n", "dxcozh (35) -> phrpja, ahysv\n", "vekndsc (94)\n", "ujmfmiu (39) -> vrszijz, ugmhzm, sdrcc\n", "jctafp (62)\n", "bhmirp (53)\n", "tmqlkof (28)\n", "wyrfplr (109) -> qzwauo, pntvfpd\n", "shcavm (18)\n", "xmkegiw (28)\n", "ydkhmp (290) -> cyanr, nofepy\n", "ivkcc (70)\n", "ujipv (183) -> gkrqba, nmsats\n", "lnznpq (48)\n", "xqxvktz (8)\n", "wzezz (264) -> bfjxeyo, vkdytw, uwizlce\n", "nvgohm (26)\n", "ydqtt (158) -> oeabdth, bkgise, fjgjfpc\n", "nmcewof (1182) -> plgjg, imtzl\n", "bbnjml (31)\n", "iweii (8) -> lvzzwy, nubqteb\n", "kmpfxl (134829) -> csuywzh, ehrfv, bkfnip\n", "dbkxe (34)\n", "sfkpzr (76) -> lsszcka, manlcoz, oipscid\n", "bbyoqzx (14)\n", "uuavydd (43)\n", "hjehgnc (489) -> ujqjrz, wulvcf\n", "qmncyu (17) -> ofveqm, qgwhbwh, ftbiwxy\n", "zzfom (210) -> jruttt, mvdkbch\n", "cigew (185)\n", "nozgflw (89)\n", "trfjf (174) -> hskko, evbeo\n", "idqhx (12)\n", "noogeuk (6)\n", "ccjze (60)\n", "bedzc (43)\n", "uymju (8) -> ectlgy, pchapba, tsncd\n", "jvwvi (86)\n", "xrqhewm (86)\n", "ifijr (28)\n", "tuzzzct (50)\n", "zwrjdk (82)\n", "ekvzyod (11)\n", "vivco (626) -> okhisbv, biffdx, rbascuz\n", "atujmm (250)\n", "bdiftdg (69)\n", "wqzxa (82)\n", "jtoryw (76)\n", "sttlowq (207) -> xmkegiw, tmqlkof\n", "wqkoep (90)\n", "sdloeq (14)\n", "hzruk (47)\n", "mgoic (36)\n", "mqkqtjo (57)\n", "gsxmqnw (68)\n", "pexfst (44)\n", "ycfbxe (254) -> tnljdhr, jfikdf\n", "kenxmax (91)\n", "yhvdjl (89)\n", "gzpgvqq (78)\n", "inglhm (94) -> qwqpht, keazynv\n", "uytmyv (91)\n", "wqgoxl (94)\n", "yfxbu (32) -> jbujmr, mjlzzq, hcrys, mwfksx, fcaht, ycfbxe, tslbp\n", "mnhrjdv (185) -> lmfclbd, sdloeq\n", "gcasp (17)\n", "jjgjvki (99205) -> suuppr, csmjozb, uexqjw, cckrzh, yuzzsk\n", "zvqvvyp (39)\n", "bgpab (1781) -> qmqpbm, rdwxvvp, vjwuuft, dlikiv, acaqfng\n", "prbbfe (18)\n", "gaalz (75)\n", "robpw (77)\n", "rcqkas (53)\n", "axsimnf (403) -> yfyaho, qeyjc\n", "mypula (58)\n", "mnahxn (52) -> cxyxa, lqaveh\n", "smqkli (81)\n", "nkclzqq (44) -> bhyzi, okjds, gfsgzni\n", "soyta (9)\n", "cagvlf (267) -> ypcup, mbffei\n", "dvuctqv (16)\n", "hdvtd (75)\n", "lexqf (96)\n", "cuyweja (81)\n", "vfteg (17) -> dclmckh, iihwb\n", "fzuosl (94)\n", "ipctg (80) -> zzyxzr, rqdtsp, esbdjah\n", "yuzzsk (3542) -> ijlooi, yqgru, oullg, ekblpi, hudde\n", "tpvhe (42) -> sretj, grthhzv, luqqu, uwqee, qssjswr, kbrwk\n", "gpbdzes (96) -> dgvvo, zvnzrr\n", "cmfwvem (23)\n", "befwz (58)\n", "mellhhn (166) -> vvzctek, hrlgs, evqbli\n", "bmxolxn (20) -> bpwxvvw, sfnix, fxnap\n", "rnqlzmv (88) -> tnlpmw, hrfbh\n", "qeyjc (7)\n", "jozav (82)\n", "gjahajj (62)\n", "qyfzonc (89)\n", "ngjipr (24)\n", "sepmxir (33) -> uuavydd, xocoiqa\n", "qizpmf (98)\n", "mroft (77)\n", "lyeyx (61)\n", "gtgovt (134) -> gqxyh, gbqbg\n", "hrihd (50)\n", "pygoqsv (55)\n", "dxczurt (89) -> rupxxhm, lopnwz\n", "mdfkbxa (18)\n", "hcruo (72)\n", "ytomr (9)\n", "bhzfx (9)\n", "mbgapsj (39)\n", "omqhf (105) -> jwbdb, junva\n", "wntitz (10)\n", "zugkqyx (89)\n", "ntxtwk (89)\n", "phrpja (90)\n", "ilcmx (129) -> xbtvux, agflbq\n", "hhcoc (63)\n", "bxggi (36)\n", "obakqyf (51)\n", "xrbkzmk (26)\n", "sthtydb (22)\n", "xvljr (21744) -> nfulfov, takbkro, gspffet, fqehxv\n", "hofirm (33)\n", "okhisbv (42)\n", "uldgij (64)\n", "sakmm (30)\n", "zbuftv (62) -> glzmsn, oacnj\n", "jxevsc (57) -> wvwjep, jilzdse, fxrkz, vkgfrb\n", "ioycu (58)\n", "ysuttai (72)\n", "ttnoqm (133) -> vtopekt, naxtp\n", "ereyjs (54)\n", "hgksz (174) -> msuvilq, couhjsv\n", "luqqu (112) -> yfaihrb, fizbyu\n", "bixtvg (180)\n", "kswafh (76)\n", "fwide (24)\n", "ghgou (12)\n", "aujeia (87)\n", "lgqad (75)\n", "szvocp (11)\n", "yivgs (36)\n", "lnlkwq (216) -> nvahhge, bbyoqzx, daerl\n", "qtcck (137) -> lgqad, ngtdwvu\n", "wkeqlvj (51)\n", "vbxzk (75)\n", "uqkskjn (132) -> kbbcau, ufxfx\n", "gacpvy (26)\n", "ccbie (90) -> cmoty, uytmyv, dmiccse\n", "suuppr (9751) -> uymju, rhpcgg, vivco\n", "fqdolnu (16)\n", "vcprhe (54)\n", "iihwb (93)\n", "swcsd (91) -> ltpmtif, jvwvi\n", "nbwaei (61)\n", "zdgyktc (84) -> jnqgs, uxfsb, xkzcttf\n", "bimxf (51)\n", "pdqzfg (70)\n", "bomuft (785) -> xobszr, idpttp\n", "kytha (39)\n", "zyisjsj (58) -> woqoljk, pocct\n", "hwycny (41)\n", "ofveqm (62)\n", "oqxnfd (59)\n", "pnpsnjp (803) -> zpbrw, pbpva\n", "ysekeoo (126) -> suawycj, gigtu\n", "gneut (203)\n", "zdrhuz (47)\n", "qmqpbm (7) -> owysb, gdvbtjk, qytxu, wxfir\n", "imrwgqw (170) -> yhncv, mklcsj\n", "dymzl (72)\n", "vzlzrt (55)\n", "lfwpqb (93)\n", "dirhtk (65) -> hrihd, udiai, bpsesr\n", "donnc (33)\n", "iactix (293) -> ulood, xkdjbxo\n", "acaqfng (271) -> wrwim, ilohfvn\n", "tuwedv (150) -> eiyiuq, ereyjs\n", "mjlvx (41)\n", "fwhhoz (72) -> rrrmaka, zkujvlv, fyaco\n", "msuvilq (11)\n", "mxvba (37)\n", "smvskd (1262) -> cglfuq, rtcqml, zjnrzph\n", "ggdoqnl (9436) -> hjehgnc, xnlkkx, srgob\n", "aifpyc (61)\n", "vwkkml (148790) -> hvpess, nuozixg, tshyvej, yfxbu, kiatxq\n", "tipewrj (97)\n", "pblqb (7) -> kouye, ibydam, jqdngi, tuzpls\n", "oktgjb (70) -> lcbgeev, zwrjdk\n", "dqoagdt (58)\n", "xkzcttf (76)\n", "zevrg (108) -> stzzli, kbybvzk\n", "lomrivn (92)\n", "grkzvkj (124) -> xemcuk, cmfwvem\n", "uwvfga (63)\n", "frxshon (95)\n", "zzvhmse (157) -> ujgpnsy, idqhx, hysssy\n", "ahsqaob (75) -> gtotarq, joszidy, frxshon, vfomix\n", "jqbdh (20)\n", "kvzmie (69)\n", "oiaxzp (22)\n", "spefs (96)\n", "fxnap (89)\n", "azhddw (909) -> smqimxg, mgoxhns, izgqzs\n", "epssvr (57)\n", "kxhvvgi (8) -> ihksnmq, wjsxcmb\n", "etjwno (91)\n", "tlwxovy (91)\n", "capuc (91)\n", "evbeo (38)\n", "djvbdm (50) -> zzmczwl, whvpgmw, szqdapo, nbybi\n", "mbffei (94)\n", "uwqee (90) -> qyfzonc, nozgflw\n", "bpzhj (251) -> hbaai, gfsnz, snywwu, ktlkx\n", "dhcopz (207) -> hjbrfba, nlalji\n", "jilzdse (70)\n", "lgonp (40)\n", "zvsgd (58) -> yzttfu, zavisuv\n", "rdwxvvp (203) -> mlyar, lijszmh\n", "wridnv (41)\n", "ovtfd (81)\n", "kttsf (35)\n", "murnoa (238) -> gpbdzes, gtgovt, mqreb, grkzvkj, nyuxiu\n", "otzinx (97)\n", "bjjtifj (15)\n", "irnjtjo (12) -> ubaxya, lomrivn, rlhmcf\n", "zezeds (79) -> kbuurtb, pugxio, gjahajj\n", "ofrogun (11)\n", "bjzbqzq (54)\n", "qolgxnd (35)\n", "vdkhvyp (52) -> kfkfyx, mgiuz\n", "rlhmcf (92)\n", "okbtg (35) -> dymzl, eiohuhm\n", "kkhlzm (96) -> wlavb, rfumv\n", "dmiccse (91)\n", "esqvkcm (59)\n", "zzyxzr (61)\n", "tegtsu (72)\n", "kbrwk (124) -> tegtsu, adqnigs\n", "mertvs (88)\n", "awmmdn (49)\n", "pknsw (74) -> lexqf, pxadg\n", "fwtxvo (71) -> ibslyw, jnwdraz, ydqtt, flvrfdl\n", "flwjj (85)\n", "asbmk (76)\n", "sdlta (11)\n", "vdwfz (234) -> amtrbok, brpgc\n", "exsugls (49)\n", "yfaihrb (78)\n", "oghyxz (213)\n", "manlcoz (85)\n", "mnoinr (84)\n", "ibydam (58)\n", "hjfucl (25)\n", "lcbgeev (82)\n", "ygglox (48)\n", "xhxek (425) -> uwviodb, cenqs, mnahxn, ysekeoo, vdcmrrr, vdctvf\n", "krtxpw (96)\n", "zgxjjm (24)\n", "vkhiz (86)\n", "inhfutj (24)\n", "qkxtwct (166) -> jfjvw, hbcpm\n", "mfoismz (70)\n", "voxemk (76)\n", "inuci (86)\n", "wllrov (200) -> nvgohm, mqsrwsz, gacpvy\n", "fyaco (51)\n", "ngtdwvu (75)\n", "kfkfyx (94)\n", "iiiupn (79)\n", "gkpalaj (76) -> jjklma, ydejjeb, sttlowq, axqrke, ipctg\n", "ubrrdtd (75)\n", "fwskxq (31)\n", "nzuhp (57)\n", "npvuz (28)\n", "fnkgp (65) -> vekndsc, sdzhsq, fzuosl\n", "roorbg (95)\n", "cfiqn (96)\n", "fcnsfy (51)\n", "idpttp (61)\n", "vaxtfaa (83)\n", "jubeqci (89)\n", "uxggaix (195) -> shiaqps, xmjunhp\n", "vvlimno (63)\n", "txcon (87)\n", "ocltuv (75)\n", "kdffrsb (187) -> ldrpjd, oopnu\n", "imtzl (99)\n", "jvdoo (22)\n", "yhzjjgc (93) -> xunvu, bebuqpx, wetluzb, hofirm\n", "clktah (86)\n", "givaxj (58)\n", "fiprusz (88) -> bgydix, mpzyapm, xvljr, bnywvsx, snmey, batky, wpvale\n", "wgvpotf (115) -> tmsmb, zzvkwsb, olfwppt, impzr\n", "ohpkkhx (385) -> kttsf, ysnbr\n", "eofyk (41) -> ctken, jyrzc, ysuttai\n", "ubllty (91) -> qizpmf, husly\n", "aqgumo (47)\n", "zezbp (91)\n", "mphzxio (33)\n", "gfuyuz (209) -> jiizacd, awmmdn\n", "rpxaf (59)\n", "aewlgu (62) -> oazfz, aifpyc, oaoisa, nbwaei\n", "coqek (166) -> uslhk, vczyhcg\n", "kecckss (51)\n", "jqlbenn (65)\n", "jyrzc (72)\n", "azgohsw (82)\n", "qtqhwon (50)\n", "furlcyu (85) -> lpwuzn, hnwfe\n", "evqbli (9)\n", "zwvhgce (121) -> chxgqe, hzruk\n", "xsfryrh (21)\n", "jjtafg (37)\n", "acfdkr (17)\n", "rupxxhm (91)\n", "nnelc (342)\n", "hdbkw (43)\n", "usgpgi (182) -> ketopn, mvtkwn\n", "thxqmj (81)\n", "bgydix (16136) -> tpvhe, excdqtl, yjvfni, iaayhc\n", "pxadg (96)\n", "uiryg (2879) -> aibtig, sepmxir, ixkpaf\n", "exlwxxi (78)\n", "vecnb (897) -> atujmm, qrynkpt, trfjf\n", "zkwnhn (329) -> oorvvpt, zzdae\n", "ezmot (96) -> bykuuwe, fiwvclv\n", "vrxkr (37) -> jxevsc, gtkii, nlrlj, kwlyw, fqkzcq\n", "zmstcy (8)\n", "axygpr (13)\n", "yzose (57)\n", "kproiw (93)\n", "lptaikg (82)\n", "cmmnjch (6) -> ewwab, awwhgzp, tqsrg, ivkcc\n", "qpgphk (33) -> lyeyx, cqfsg\n", "hittl (20)\n", "wbnmb (83)\n", "tsevkec (54) -> yvvxtg, wqkoep\n", "mwfksx (216) -> mbgapsj, zvqvvyp\n", "bvmhqar (224) -> epuqu, gcasp\n", "oeabdth (17)\n", "pchapba (70) -> kqaua, ljitswv\n", "gsckda (89)\n", "gtbjtpi (265) -> ovshy, xpttnwd\n", "xocoiqa (43)\n", "woctu (56) -> qrorhfv, axsimnf, wgbviwb\n", "foxvut (77)\n", "zerhdhs (150) -> xtidu, yuyhys, ghgou, sqbxzl\n", "rqdtsp (61)\n", "dizqtw (103) -> ieowdj, vgkhk\n", "ebdva (718) -> vgfveov, zerhdhs, kxhvvgi, oqokji, lpmnwh\n", "ikfzj (212) -> nrfyua, ekvzyod\n", "hcrys (63) -> foxvut, oislgqy, mroft\n", "vkgfrb (70)\n", "bwemy (92) -> oaqkk, kvzmie\n", "yname (1373) -> qhayeqe, dxcozh, dirhtk, zwvhgce\n", "desuqj (91)\n", "bnywvsx (19757) -> pnpsnjp, paunv, hxeqn\n", "wiasj (34)\n", "lhyzwtf (35)\n", "gztng (22)\n", "szqdapo (54)\n", "flwbwcq (142) -> xekft, jctafp\n", "ijoaqyv (91) -> ldcmzd, sambc, aewlgu, wrkoi, xtgmmc, cglyptu, qhixu\n", "knyvyft (81)\n", "ngfxax (139) -> uiilkiq, iijfq\n", "atqfhm (92)\n", "masvpfj (184) -> ifijr, zzonk\n", "yhncv (54)\n", "wwhyd (95)\n", "oggljxs (314) -> awrbrc, yrysmsi\n", "sdrcc (56)\n", "sgqhelx (60) -> hhcoc, vvlimno\n", "snmey (84) -> bgpab, xflsc, kidvt, rlurjca, uiryg, eaoxb, dulrvcq\n", "qpchzkg (57)\n", "mhaucon (2652) -> smvskd, wkgyfpp, fkgkcwd, jsaujq\n", "brpgc (12)\n", "vimnt (91) -> rwhgw, asbmk, lvarp, monhu\n", "excdqtl (378) -> hcsjun, trskdr, tfotbwz\n", "uxlisdh (89)\n", "isbdm (1276) -> aqgumo, svjnd\n", "alsfpfg (21)\n", "zzpwgcd (68)\n", "glaosn (86) -> ptmsqz, ivvyjos\n", "fvukbun (43)\n", "rokri (55)\n", "qrorhfv (93) -> redkli, thxqmj, esavxwq, knyvyft\n", "eziosif (33)\n", "jqgfu (40)\n", "nbqaqp (298) -> owxski, nyckm\n", "hyxtojc (5)\n", "awrbrc (14)\n", "ogbov (15)\n", "rbascuz (42)\n", "kdzhiq (63) -> kenxmax, tlwxovy, zezbp\n", "geapi (75)\n", "oiozpzq (127) -> uldgij, kiawm\n", "fzafkj (88)\n", "zejcp (76)\n", "wrkoi (124) -> capuc, wifrwut\n", "dhqrk (173) -> zdgyktc, etcsuuv, uhwlk\n", "jtyljl (348) -> bveilrx, nbqaqp, fuujiy\n", "otetl (1340) -> patlvg, gjhfseh\n", "mnufo (7)\n", "cfrbz (117) -> krtglj, jcoyk\n", "lsszcka (85)\n", "rgdvqu (166) -> dbkxe, clwtgt\n", "yjvfni (1179) -> ofnqgn, rsyxcdq, cpuxdo\n", "gfsnz (14) -> ydtykm, tjwynpa\n", "knciro (7)\n", "sfnix (89)\n", "cqfsg (61)\n", "izqxal (142) -> kxdbyp, sqljeh\n", "ivgpv (1040) -> ubllty, qtcck, bmxolxn\n", "bazwto (49)\n", "twimkx (24)\n", "evrtfzj (19)\n", "ofnqgn (19) -> qrinzet, fkitgnx\n", "nrloleu (93)\n", "ylazd (201) -> jqlbenn, oeixw\n", "hrfbh (49)\n", "dkexo (146) -> nffvt, llydxxz, bgtzw\n", "hibjkps (106) -> cmfwwv, jqgfu\n", "oacnj (93)\n", "inelfwo (91)\n", "vgkhk (76)\n", "cckrzh (6841) -> hdinwud, dqzkic, vrxkr\"\"\"" ] }, { "cell_type": "code", "execution_count": 41, "metadata": {}, "outputs": [], "source": [ "test_input = \"\"\"pbga (66)\n", "xhth (57)\n", "ebii (61)\n", "havc (66)\n", "ktlj (57)\n", "fwft (72) -> ktlj, cntj, xhth\n", "qoyq (66)\n", "padx (45) -> pbga, havc, qoyq\n", "tknk (41) -> ugml, padx, fwft\n", "jptl (61)\n", "ugml (68) -> gyxo, ebii, jptl\n", "gyxo (61)\n", "cntj (57)\"\"\"" ] }, { "cell_type": "code", "execution_count": 42, "metadata": {}, "outputs": [], "source": [ "def parse(input):\n", " supported = {}\n", " supporters = {}\n", " weights = {}\n", " for row in input.split('\\n'):\n", " if '->' in row:\n", " a, b = row.split('->')\n", " supporter, supporter_weight = a.split()\n", " supporters[supporter] = 1\n", " weights[supporter] = int(supporter_weight[1:-1])\n", " if ',' in b:\n", " for item in b.split(','):\n", " supported[item.strip()] = 1\n", " else:\n", " supported[b] = 1\n", " else:\n", " supporter, supporter_weight = row.split()\n", " weights[supporter] = int(supporter_weight[1:-1])\n", " return supported, supporters, weights" ] }, { "cell_type": "code", "execution_count": 43, "metadata": {}, "outputs": [], "source": [ "supported, supporters, weights = parse(test_input)" ] }, { "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "tknk\n" ] } ], "source": [ "for item in supporters:\n", " if item not in supported:\n", " print(item)" ] }, { "cell_type": "code", "execution_count": 45, "metadata": {}, "outputs": [], "source": [ "supported, supporters, weights = parse(input)" ] }, { "cell_type": "code", "execution_count": 46, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "vgzejbd\n" ] } ], "source": [ "for item in supporters:\n", " if item not in supported:\n", " print(item)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Part 2 : weights " ] }, { "cell_type": "code", "execution_count": 47, "metadata": {}, "outputs": [], "source": [ "def parse_part2(input):\n", " supported = {}\n", " supporters = {}\n", " weights = {}\n", " children = {}\n", " for row in input.split('\\n'):\n", " if '->' in row:\n", " a, b = row.split('->')\n", " supporter, supporter_weight = a.split()\n", " supporters[supporter] = 1\n", " weights[supporter] = int(supporter_weight[1:-1])\n", " if ',' in b:\n", " children[supporter] = [item.strip() for item in b.split(',')]\n", " for item in b.split(','):\n", " supported[item.strip()] = 1\n", " \n", " else:\n", " children[supporter] = b.strip()\n", " supported[b] = 1\n", " else:\n", " supporter, supporter_weight = row.split()\n", " weights[supporter] = int(supporter_weight[1:-1])\n", " return supported, supporters, weights, children" ] }, { "cell_type": "code", "execution_count": 48, "metadata": {}, "outputs": [], "source": [ "supported, supporters, weights, children = parse_part2(test_input)" ] }, { "cell_type": "code", "execution_count": 49, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "pbga (66)\n", "xhth (57)\n", "ebii (61)\n", "havc (66)\n", "ktlj (57)\n", "fwft (72) -> ktlj, cntj, xhth\n", "qoyq (66)\n", "padx (45) -> pbga, havc, qoyq\n", "tknk (41) -> ugml, padx, fwft\n", "jptl (61)\n", "ugml (68) -> gyxo, ebii, jptl\n", "gyxo (61)\n", "cntj (57)\n" ] } ], "source": [ "print(test_input)" ] }, { "cell_type": "code", "execution_count": 50, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'fwft': ['ktlj', 'cntj', 'xhth'],\n", " 'padx': ['pbga', 'havc', 'qoyq'],\n", " 'tknk': ['ugml', 'padx', 'fwft'],\n", " 'ugml': ['gyxo', 'ebii', 'jptl']}" ] }, "execution_count": 50, "metadata": {}, "output_type": "execute_result" } ], "source": [ "children" ] }, { "cell_type": "code", "execution_count": 51, "metadata": {}, "outputs": [], "source": [ "def sum_of_children_and_self(node, weights, children):\n", " \"Sums the weight of children and that of the node itself.\"\n", " if node in children:\n", " return weights[node] + sum([sum_of_children_and_self(child, weights, children) for child in children[node]])\n", " else:\n", " return weights[node]" ] }, { "cell_type": "code", "execution_count": 52, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "778" ] }, "execution_count": 52, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sum_of_children_and_self('tknk', weights, children)" ] }, { "cell_type": "code", "execution_count": 53, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "251" ] }, "execution_count": 53, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sum_of_children_and_self('ugml', weights, children)" ] }, { "cell_type": "code", "execution_count": 54, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "243" ] }, "execution_count": 54, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sum_of_children_and_self('padx', weights, children)" ] }, { "cell_type": "code", "execution_count": 55, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "243" ] }, "execution_count": 55, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sum_of_children_and_self('fwft', weights, children)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Okay, we now have a way of doing this:\n", "\n", "- start on last layer\n", "- check everything matches\n", "- go back one layer" ] }, { "cell_type": "code", "execution_count": 56, "metadata": {}, "outputs": [], "source": [ "current_node_list = [['tknk']]\n", "layers = [] # list of lists\n", "layers.append(current_node_list)\n", "while True:\n", " current_layer = []\n", " for node_list in current_node_list:\n", " had_children = False\n", " for node in node_list:\n", " if node in children:\n", " had_children = True\n", " current_layer.append(children[node])\n", " if not had_children:\n", " break\n", " layers.append(current_layer)\n", " current_node_list = layers[-1]\n" ] }, { "cell_type": "code", "execution_count": 57, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[[['tknk']],\n", " [['ugml', 'padx', 'fwft']],\n", " [['gyxo', 'ebii', 'jptl'],\n", " ['pbga', 'havc', 'qoyq'],\n", " ['ktlj', 'cntj', 'xhth']]]" ] }, "execution_count": 57, "metadata": {}, "output_type": "execute_result" } ], "source": [ "layers" ] }, { "cell_type": "code", "execution_count": 58, "metadata": {}, "outputs": [], "source": [ "reversed_layers = reversed(layers)" ] }, { "cell_type": "code", "execution_count": 59, "metadata": {}, "outputs": [], "source": [ "for layer in reversed_layers:\n", " layer_weights = [[sum_of_children_and_self(node, weights, children) for node in node_list] for node_list in layer]\n", " if any([len(set(layer_weight)) > 1 for layer_weight in layer_weights]):\n", " break" ] }, { "cell_type": "code", "execution_count": 60, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[[251, 243, 243]]" ] }, "execution_count": 60, "metadata": {}, "output_type": "execute_result" } ], "source": [ "layer_weights" ] }, { "cell_type": "code", "execution_count": 61, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[['ugml', 'padx', 'fwft']]" ] }, "execution_count": 61, "metadata": {}, "output_type": "execute_result" } ], "source": [ "layer" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Okay, let's run this on the big example. We can do copy and pasting :)" ] }, { "cell_type": "code", "execution_count": 62, "metadata": {}, "outputs": [], "source": [ "supported, supporters, weights, children = parse_part2(input)" ] }, { "cell_type": "code", "execution_count": 63, "metadata": {}, "outputs": [], "source": [ "def build_layers(start):\n", " current_node_list = [[start]]\n", " layers = [] # list of lists\n", " layers.append(current_node_list)\n", " while True:\n", " current_layer = []\n", " for node_list in current_node_list:\n", " had_children = False\n", " for node in node_list:\n", " if node in children:\n", " had_children = True\n", " current_layer.append(children[node])\n", " if not had_children:\n", " break\n", " layers.append(current_layer)\n", " current_node_list = layers[-1]\n", " return layers" ] }, { "cell_type": "code", "execution_count": 64, "metadata": {}, "outputs": [], "source": [ "layers = build_layers('vgzejbd')" ] }, { "cell_type": "code", "execution_count": 65, "metadata": {}, "outputs": [], "source": [ "reversed_layers = layers" ] }, { "cell_type": "code", "execution_count": 66, "metadata": {}, "outputs": [], "source": [ "from collections import Counter" ] }, { "cell_type": "code", "execution_count": 67, "metadata": {}, "outputs": [], "source": [ "for ind, layer in enumerate(reversed_layers):\n", " layer_weights = [[sum_of_children_and_self(node, weights, children) for node in node_list] for node_list in layer]\n", " if any([len(set(layer_weight)) > 1 for layer_weight in layer_weights]):\n", " break" ] }, { "cell_type": "code", "execution_count": 68, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[['vuoqao', 'vwkkml', 'kmpfxl', 'snuewn', 'jjgjvki', 'fiprusz']]" ] }, "execution_count": 68, "metadata": {}, "output_type": "execute_result" } ], "source": [ "layer" ] }, { "cell_type": "code", "execution_count": 69, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "159246" ] }, "execution_count": 69, "metadata": {}, "output_type": "execute_result" } ], "source": [ "c = Counter(*layer_weights)\n", "different_value = c.most_common(n=2)[1][0]\n", "different_value" ] }, { "cell_type": "code", "execution_count": 70, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[[159240, 159246, 159240, 159240, 159240, 159240]]" ] }, "execution_count": 70, "metadata": {}, "output_type": "execute_result" } ], "source": [ "layer_weights" ] }, { "cell_type": "code", "execution_count": 71, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'vwkkml'" ] }, "execution_count": 71, "metadata": {}, "output_type": "execute_result" } ], "source": [ "layer[0][layer_weights[0].index(different_value)]" ] }, { "cell_type": "code", "execution_count": 72, "metadata": {}, "outputs": [], "source": [ "layers = build_layers('vwkkml')" ] }, { "cell_type": "code", "execution_count": 73, "metadata": {}, "outputs": [], "source": [ "for ind, layer in enumerate(layers):\n", " layer_weights = [[sum_of_children_and_self(node, weights, children) for node in node_list] for node_list in layer]\n", " if any([len(set(layer_weight)) > 1 for layer_weight in layer_weights]):\n", " break" ] }, { "cell_type": "code", "execution_count": 74, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[[2090, 2090, 2090, 2090, 2096]]" ] }, "execution_count": 74, "metadata": {}, "output_type": "execute_result" } ], "source": [ "layer_weights" ] }, { "cell_type": "code", "execution_count": 75, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2096" ] }, "execution_count": 75, "metadata": {}, "output_type": "execute_result" } ], "source": [ "c = Counter(*layer_weights)\n", "different_value = c.most_common(n=2)[1][0]\n", "different_value" ] }, { "cell_type": "code", "execution_count": 76, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'kiatxq'" ] }, "execution_count": 76, "metadata": {}, "output_type": "execute_result" } ], "source": [ "layer[0][layer_weights[0].index(different_value)]" ] }, { "cell_type": "code", "execution_count": 77, "metadata": {}, "outputs": [], "source": [ "layers = build_layers('kiatxq')" ] }, { "cell_type": "code", "execution_count": 78, "metadata": {}, "outputs": [], "source": [ "for ind, layer in enumerate(layers):\n", " layer_weights = [[sum_of_children_and_self(node, weights, children) for node in node_list] for node_list in layer]\n", " if any([len(set(layer_weight)) > 1 for layer_weight in layer_weights]):\n", " break" ] }, { "cell_type": "code", "execution_count": 79, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[[59, 59, 59, 59], [92, 92, 92], [14, 14]]" ] }, "execution_count": 79, "metadata": {}, "output_type": "execute_result" } ], "source": [ "layer_weights" ] }, { "cell_type": "code", "execution_count": 80, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1232" ] }, "execution_count": 80, "metadata": {}, "output_type": "execute_result" } ], "source": [ "weights['kiatxq']" ] }, { "cell_type": "code", "execution_count": 81, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1226" ] }, "execution_count": 81, "metadata": {}, "output_type": "execute_result" } ], "source": [ "1232 - 6" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If that was the weight it would be exactly balanced... and it works!" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 8 " ] }, { "cell_type": "code", "execution_count": 82, "metadata": {}, "outputs": [], "source": [ "test_input = \"\"\"b inc 5 if a > 1\n", "a inc 1 if b < 5\n", "c dec -10 if a >= 1\n", "c inc -20 if c == 10\"\"\"" ] }, { "cell_type": "code", "execution_count": 83, "metadata": {}, "outputs": [], "source": [ "import re" ] }, { "cell_type": "code", "execution_count": 84, "metadata": {}, "outputs": [], "source": [ "def parse_input(input, debug=False):\n", " registers = {}\n", " max_of_all_time = 0\n", " for row in input.split(\"\\n\"):\n", " if debug:\n", " print(re.split(\"(\\w+) (inc|dec) (-?\\d+) if (\\w+)\", row))\n", " _, register, op, opval, condition_register, condition = re.split(\"(\\w+) (inc|dec) (-?\\d+) if (\\w+)\", row)\n", " if condition_register not in registers:\n", " registers[condition_register] = 0\n", " if eval('{}'.format(registers[condition_register]) + condition):\n", " if register not in registers:\n", " registers[register] = 0\n", " if op == 'inc':\n", " registers[register] += int(opval)\n", " elif op == 'dec':\n", " registers[register] -= int(opval)\n", " max_of_all_time = max(max_of_all_time, max(registers.values()))\n", " return registers, max(registers.values()), max_of_all_time" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "({'a': 1, 'b': 0, 'c': -10}, 1, 10)" ] }, "execution_count": 85, "metadata": {}, "output_type": "execute_result" } ], "source": [ "parse_input(test_input)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "input = \"\"\"ioe dec 890 if qk > -10\n", "gif inc -533 if qt <= 7\n", "itw dec 894 if t != 0\n", "nwe inc 486 if hfh < -2\n", "xly inc 616 if js >= -3\n", "j inc 396 if b != -5\n", "nwe dec -637 if uoc > 0\n", "b inc 869 if yg >= -3\n", "gif dec -221 if iyu < 0\n", "tc dec -508 if gy >= -7\n", "x dec 637 if gif < -526\n", "nwe dec -185 if nwe != -8\n", "x inc 638 if b != 869\n", "ih dec -722 if itw > 9\n", "xly inc -38 if ih >= 8\n", "hm dec 910 if t == 0\n", "uoc dec -585 if qt == 0\n", "js dec -325 if hm == -910\n", "yr dec -922 if cp != 0\n", "qt dec 316 if itw != 2\n", "bi dec -422 if iyu <= -1\n", "uoc inc -862 if itw <= 3\n", "itw dec -301 if x < -632\n", "gif inc -492 if fi != 5\n", "uoc inc -745 if x < -631\n", "xly inc 21 if js > 331\n", "hm inc 44 if js > 334\n", "js dec 503 if tc > 503\n", "t inc -216 if j == 396\n", "yg inc 559 if nwe > 189\n", "bhp dec -214 if x >= -646\n", "hm dec 366 if fi == 0\n", "t dec -658 if nwe == 185\n", "hm inc -432 if qt <= -307\n", "xly dec 695 if uoc >= -1031\n", "cp inc -438 if x != -647\n", "yg dec 211 if x >= -628\n", "bi inc 829 if ih > -8\n", "yg dec 540 if tc >= 503\n", "hm dec -913 if qt > -310\n", "qk inc -406 if itw < 309\n", "uoc dec -716 if iyu >= -1\n", "ih inc -655 if qt != -316\n", "ih inc 6 if xly > -80\n", "cp inc 795 if xly > -88\n", "bhp dec 59 if yr < 1\n", "yr dec 952 if x >= -628\n", "xly dec -867 if j > 393\n", "fi inc 720 if ioe >= -892\n", "gif inc 454 if ioe > -886\n", "j dec 547 if fi != 720\n", "qk inc 665 if bi > 819\n", "hm dec -174 if cp != 357\n", "hm dec -795 if uoc <= -314\n", "uoc inc 273 if itw <= 307\n", "gy dec 212 if xly >= 783\n", "tc inc 918 if ih != 9\n", "tc inc -43 if js >= -186\n", "gif inc -615 if b == 869\n", "bhp inc -335 if fi > 724\n", "ih inc 747 if hm >= -1711\n", "ih inc -515 if ioe != -881\n", "yg dec 967 if cp == 357\n", "yr inc -23 if qt < -309\n", "gif dec -16 if cp == 357\n", "itw inc 353 if uoc <= -41\n", "cp dec -788 if b <= 869\n", "bi dec 510 if itw < 306\n", "yg inc 321 if qk > 265\n", "itw inc -194 if gif == -1624\n", "yr dec 484 if b == 869\n", "yr dec 828 if yg != -1515\n", "cp dec -700 if gy != -212\n", "ioe dec -238 if iyu >= -5\n", "xly inc -334 if bi != 316\n", "js dec 642 if uoc < -27\n", "cp inc 131 if x >= -633\n", "cp dec 693 if iyu >= -2\n", "bi inc 671 if hm >= -1712\n", "fi dec 781 if nwe >= 176\n", "ioe inc 770 if qk > 253\n", "nwe dec 381 if j < 406\n", "qt inc -599 if hm != -1715\n", "yg inc 277 if qk >= 268\n", "hm dec -656 if ioe < 117\n", "uoc dec -875 if ih < 243\n", "js dec 297 if yg >= -1514\n", "hfh dec 821 if iyu >= 8\n", "ioe inc -133 if iyu > -9\n", "x dec -623 if iyu != 0\n", "gy inc 240 if cp >= 451\n", "gy inc 937 if hfh != -10\n", "tc dec 476 if tc != 1376\n", "iyu dec -35 if hm == -1706\n", "nwe dec 86 if yr >= -1344\n", "cp dec 96 if qk != 259\n", "x dec 864 if b >= 865\n", "hm dec -965 if bhp != 161\n", "bhp dec 402 if b == 859\n", "b inc -19 if hm <= -746\n", "xly dec 24 if uoc >= 840\n", "ih inc 816 if js >= -1117\n", "xly dec 511 if iyu != 5\n", "t dec -214 if iyu != -8\n", "yr inc -81 if tc <= 898\n", "js inc -187 if yr < -1331\n", "x inc -970 if cp < 462\n", "hm dec 668 if tc > 904\n", "uoc dec -488 if yg <= -1502\n", "uoc inc -974 if j != 394\n", "qk inc -58 if qt > -913\n", "j dec -741 if js == -1304\n", "j dec 58 if nwe != -276\n", "fi dec 772 if qt != -910\n", "yg dec -271 if bi == 990\n", "uoc dec 983 if gy != 966\n", "t inc -355 if uoc >= -636\n", "hfh dec -486 if yr == -1335\n", "itw inc -102 if tc < 905\n", "gif inc 663 if b > 862\n", "fi dec -546 if js < -1294\n", "bhp dec -955 if qt > -914\n", "qt dec -927 if ih == 1054\n", "gy inc -272 if uoc <= -620\n", "yg inc -30 if nwe != -291\n", "nwe dec 393 if ih != 1048\n", "ih dec 904 if tc != 915\n", "nwe inc -211 if j != 1084\n", "qt dec 249 if tc <= 913\n", "ioe dec -703 if gy <= 695\n", "hfh inc -836 if j <= 1079\n", "tc inc -153 if qk <= 255\n", "bhp dec -697 if uoc == -627\n", "hfh dec -762 if qk <= 263\n", "xly inc -369 if qk >= 269\n", "xly inc -135 if xly > -80\n", "j dec 773 if x <= -2468\n", "iyu inc -541 if iyu < 9\n", "itw inc 870 if xly < -77\n", "x inc 646 if x >= -2474\n", "qk dec 447 if fi >= -287\n", "qk dec -37 if yr >= -1344\n", "nwe inc 406 if gy >= 703\n", "j inc 72 if j > 299\n", "qt inc 946 if t < 306\n", "hm dec -406 if cp == 451\n", "ioe inc -906 if bhp < 849\n", "xly inc -924 if b <= 871\n", "xly inc -645 if qt == 709\n", "b dec -578 if bi <= 999\n", "js inc 237 if t <= 304\n", "gif inc 425 if bi <= 989\n", "uoc dec 318 if x < -1821\n", "fi inc 455 if bhp < 859\n", "fi inc -282 if iyu <= -537\n", "bhp dec 980 if cp > 451\n", "t dec 204 if gif > -967\n", "ioe inc -273 if fi == -114\n", "iyu inc 940 if yr != -1335\n", "t inc -593 if uoc == -945\n", "tc inc -34 if yr >= -1335\n", "yg inc 204 if gif < -969\n", "nwe dec -128 if iyu == -541\n", "qk dec 949 if yr >= -1335\n", "nwe dec -582 if js >= -1063\n", "tc dec -550 if cp <= 452\n", "js inc 427 if ioe <= 407\n", "bhp inc -672 if gif == -961\n", "b dec 890 if hm > -1419\n", "qk dec -801 if iyu > -538\n", "t inc 789 if tc != 1433\n", "tc dec 134 if hm >= -1413\n", "cp inc -287 if b > 552\n", "b inc -131 if bhp == -800\n", "iyu inc 991 if b <= 429\n", "itw inc 3 if hm > -1411\n", "ih inc 263 if b < 428\n", "j dec 848 if t <= 294\n", "xly inc 94 if ioe != 406\n", "j inc 116 if qk < -1094\n", "t inc -779 if yr >= -1338\n", "nwe dec 910 if tc >= 1281\n", "uoc inc -945 if itw <= 975\n", "xly inc -675 if hm <= -1410\n", "xly inc -58 if x == -1825\n", "hfh inc -701 if bhp < -798\n", "nwe inc -586 if uoc > -952\n", "x inc -164 if b < 435\n", "hfh inc -641 if j != -354\n", "yg inc 827 if qt > 699\n", "iyu dec -512 if t < -478\n", "j inc 651 if itw < 987\n", "yg dec 537 if hfh >= -289\n", "ih inc -289 if qk <= -1094\n", "itw dec 158 if nwe > -2260\n", "xly dec 704 if hfh == -289\n", "itw dec -564 if j <= 305\n", "nwe inc -820 if hfh >= -290\n", "bhp dec -252 if nwe < -3065\n", "bhp dec 680 if itw <= 1385\n", "cp inc 811 if t == -486\n", "x inc 423 if b > 419\n", "itw inc 131 if gy <= 693\n", "qk inc 500 if nwe == -3065\n", "gif dec 583 if yg <= -981\n", "x dec -261 if fi > -115\n", "itw dec 314 if cp >= 977\n", "itw inc 197 if b < 429\n", "ioe inc -666 if x <= -1314\n", "hfh inc 345 if hm < -1402\n", "b inc 653 if itw >= 1719\n", "qk dec 298 if itw != 1701\n", "t dec 943 if qt > 703\n", "gif inc 430 if qt > 715\n", "bi inc 60 if gy > 687\n", "j inc -816 if gy > 685\n", "xly inc 334 if js != -1075\n", "qk inc -388 if xly != -2656\n", "t inc 475 if fi <= -113\n", "t dec -842 if nwe > -3078\n", "fi inc 284 if cp == 976\n", "xly inc 265 if ih >= 127\n", "qt dec -481 if hfh < 58\n", "xly dec -484 if ioe <= 415\n", "ioe inc 525 if xly >= -2183\n", "t inc 658 if tc >= 1281\n", "nwe dec -680 if t != 555\n", "qk inc 395 if tc <= 1293\n", "bi dec 422 if gy > 683\n", "itw inc 713 if t == 546\n", "bhp dec 285 if iyu < 967\n", "gif inc -186 if tc <= 1297\n", "iyu inc -858 if iyu <= 954\n", "gy inc -320 if nwe < -2384\n", "yg inc 691 if qt < 1199\n", "hm inc -19 if j <= -528\n", "bhp dec 403 if xly == -2175\n", "gy inc -886 if qk >= -1399\n", "yg inc 404 if js < -1065\n", "gy inc -255 if fi > 160\n", "bhp inc 740 if bi <= 620\n", "b inc -548 if nwe != -2398\n", "t dec 255 if nwe >= -2397\n", "t inc -678 if js >= -1064\n", "js inc -497 if js >= -1071\n", "iyu dec -463 if hfh >= 52\n", "js inc -537 if b != -122\n", "t inc -518 if yg != 129\n", "ih dec 208 if yr >= -1341\n", "qt dec -566 if yr > -1340\n", "itw inc 113 if nwe == -2395\n", "ioe dec -471 if itw != 2424\n", "cp inc 222 if tc > 1283\n", "ih inc 28 if bhp != -1915\n", "yg inc -923 if xly <= -2169\n", "bi inc 893 if yr == -1335\n", "cp inc -459 if gy > -771\n", "b inc 958 if bhp != -1922\n", "yg dec 896 if tc < 1298\n", "ih inc 385 if hfh != 48\n", "j dec -663 if iyu <= 1419\n", "fi dec 89 if x != -1297\n", "tc inc -294 if gif != -1147\n", "uoc inc -232 if qk < -1381\n", "bi inc 743 if hfh >= 48\n", "gif inc 317 if yr == -1335\n", "hm dec 938 if xly <= -2172\n", "iyu dec 961 if xly > -2173\n", "qk dec -69 if qk == -1390\n", "ioe dec -450 if hfh != 52\n", "j inc 944 if qt != 1748\n", "x dec 48 if gy <= -764\n", "yr dec 505 if iyu <= 1422\n", "x dec 316 if yg < -1695\n", "bi inc -386 if nwe != -2392\n", "xly inc 363 if fi < 87\n", "uoc dec 629 if nwe < -2384\n", "ioe dec 816 if bhp < -1909\n", "uoc inc 196 if fi == 81\n", "gif dec -196 if iyu > 1419\n", "bi dec -652 if nwe != -2402\n", "gy dec -416 if yg > -1701\n", "bhp dec 78 if qk < -1384\n", "bi inc -660 if ih != 328\n", "ih dec 352 if fi >= 79\n", "ioe inc 288 if itw == 2414\n", "b dec -461 if xly < -1814\n", "t inc -291 if js > -1557\n", "tc dec 502 if j == 432\n", "gif inc -800 if qk >= -1384\n", "yr dec -59 if gif > -641\n", "yg dec 360 if yr <= -1275\n", "nwe dec 790 if gy >= -358\n", "b dec 544 if yr == -1268\n", "tc inc 743 if ih <= -22\n", "bhp inc 314 if cp <= 744\n", "x dec -708 if tc <= 2039\n", "iyu inc 968 if yr != -1274\n", "x dec 454 if hfh <= 61\n", "qk dec -41 if bhp >= -1685\n", "ih inc 302 if tc != 2032\n", "cp inc -167 if yr == -1281\n", "ih inc 349 if qt != 1760\n", "gif inc -367 if uoc <= -1603\n", "xly inc 229 if gy <= -344\n", "gif dec 459 if fi >= 76\n", "hm dec -297 if gy <= -347\n", "j dec -320 if iyu <= 2397\n", "qt dec 634 if b <= 837\n", "cp dec 342 if ih > 324\n", "ioe dec -119 if qt > 1120\n", "x dec 564 if hfh != 56\n", "tc dec 779 if qt < 1130\n", "hm dec 586 if ioe > 695\n", "yg dec 373 if ioe > 683\n", "xly inc 344 if iyu <= 2397\n", "hm inc 91 if qt < 1121\n", "ih inc -219 if ioe <= 699\n", "ih inc -937 if ioe <= 702\n", "hfh dec -805 if t != -221\n", "itw dec -385 if ioe == 693\n", "nwe inc 946 if js != -1564\n", "qt dec 685 if hm == -2052\n", "itw dec -625 if bhp <= -1674\n", "ih inc 933 if qt < 442\n", "js inc 971 if itw != 3437\n", "hfh dec 444 if uoc >= -1617\n", "itw inc 182 if itw >= 3433\n", "hfh inc 509 if gy > -353\n", "ioe dec 952 if bhp > -1688\n", "b inc 210 if uoc > -1615\n", "itw inc -579 if hm < -2044\n", "hm inc -427 if j <= 739\n", "uoc inc 90 if nwe > -3190\n", "ih inc -678 if x <= -1407\n", "js dec -238 if x >= -1419\n", "ih inc -263 if tc > 1244\n", "ioe dec 30 if gy == -352\n", "t inc -76 if ih < -837\n", "yr dec -442 if cp < 400\n", "iyu inc -425 if j < 751\n", "qk inc -189 if js <= -350\n", "yg inc 282 if t >= -311\n", "b inc 11 if j > 737\n", "qt dec -839 if bi == 1863\n", "tc inc -40 if bhp >= -1688\n", "b inc 439 if yg >= -2142\n", "bhp dec 144 if b == 1057\n", "gy dec 460 if b <= 1065\n", "qk inc -681 if itw >= 3035\n", "iyu dec 0 if j > 740\n", "ih inc -189 if uoc <= -1520\n", "bi inc 360 if hm > -2058\n", "yr inc 603 if xly <= -1232\n", "j dec 68 if fi < 90\n", "yg dec -425 if gy <= -804\n", "x dec 295 if x != -1405\n", "nwe inc -355 if j <= 679\n", "ioe dec -506 if xly < -1229\n", "bhp inc -489 if j >= 671\n", "hm inc 730 if ioe > 209\n", "gy inc -464 if iyu < 1968\n", "bi dec 191 if yg > -1731\n", "j dec 707 if gy < -804\n", "ioe dec -180 if qt == 437\n", "ioe inc 909 if yr != -231\n", "yr dec -627 if ih == -1027\n", "itw dec -145 if gy == -818\n", "hm inc -156 if gif == -1460\n", "hm inc 301 if yg < -1735\n", "gif dec 137 if bi == 2039\n", "cp dec 777 if yg <= -1717\n", "fi dec -90 if yg != -1726\n", "cp dec 256 if tc <= 1217\n", "gy dec -401 if ioe >= 393\n", "js inc 850 if tc <= 1219\n", "iyu inc 124 if hm >= -1478\n", "tc dec 341 if nwe > -3534\n", "yr dec -13 if tc <= 1218\n", "x inc -44 if cp != -634\n", "t inc 591 if qk >= -2229\n", "t dec -38 if itw <= 3045\n", "xly inc -996 if ioe >= 396\n", "cp inc -21 if x > -1757\n", "t dec -989 if itw >= 3033\n", "uoc inc 193 if fi >= 74\n", "x inc 234 if uoc > -1333\n", "hm dec -353 if gif > -1597\n", "cp inc 684 if t == 1315\n", "bhp dec -437 if iyu < 2095\n", "xly inc 59 if j == -30\n", "nwe inc 176 if fi >= 81\n", "b inc 573 if iyu > 2086\n", "gif inc 526 if gy > -418\n", "ioe dec 261 if b >= 1625\n", "qk inc -976 if bi != 2040\n", "qt inc -648 if cp >= 31\n", "x dec -490 if iyu <= 2099\n", "bi dec 450 if x <= -1021\n", "hm dec -317 if hm >= -1485\n", "x inc 462 if ih != -1032\n", "qt dec 436 if yr == 409\n", "uoc inc 289 if b <= 1638\n", "qk inc -998 if uoc > -1045\n", "j dec 387 if b < 1622\n", "gy dec 13 if cp >= 24\n", "bi dec -822 if js != 489\n", "ioe dec -140 if xly < -2170\n", "uoc dec -15 if ih < -1021\n", "x dec -906 if hfh < 923\n", "itw dec -986 if yr > 402\n", "cp inc 474 if gy < -421\n", "gy dec 530 if fi == 72\n", "fi inc -277 if tc < 1214\n", "ioe inc -26 if gif < -1066\n", "itw dec -900 if ih < -1025\n", "fi dec 443 if yg < -1719\n", "hfh inc 602 if uoc == -1023\n", "yg inc 409 if ih == -1027\n", "t dec -366 if t != 1323\n", "gif inc 158 if yr == 409\n", "iyu inc 464 if hfh >= 1525\n", "xly inc -71 if yg > -1319\n", "cp dec -247 if qk > -4201\n", "cp dec -278 if cp > 745\n", "tc inc -903 if ioe < 257\n", "itw inc 221 if bhp < -1870\n", "yg dec -352 if j >= -31\n", "ih dec -77 if qk < -4188\n", "itw inc -921 if gy < -414\n", "tc dec 565 if iyu != 2561\n", "uoc inc -564 if cp <= 1035\n", "ih dec -962 if qt == 1\n", "hfh dec 646 if itw < 4222\n", "js dec 604 if qk != -4186\n", "hfh dec 389 if itw != 4214\n", "cp inc -819 if bhp == -1876\n", "tc inc 121 if qk <= -4185\n", "cp dec 330 if t == 1677\n", "nwe inc -864 if gy >= -417\n", "uoc dec -459 if hm == -1155\n", "x inc 886 if tc >= -124\n", "tc inc 954 if yg != -973\n", "qk inc 408 if x <= -563\n", "hfh inc 37 if uoc == -1587\n", "bhp dec -426 if cp == 197\n", "nwe inc -46 if itw < 4233\n", "j dec -546 if fi <= -637\n", "bi dec 421 if xly > -2253\n", "cp inc -991 if nwe >= -3417\n", "gif inc -9 if hfh >= 1169\n", "yg dec 397 if tc >= 816\n", "gif inc 258 if js > -115\n", "bhp dec -594 if tc != 822\n", "t inc -975 if ioe != 253\n", "tc inc 999 if ioe >= 242\n", "gif inc 746 if yr < 419\n", "gy inc -980 if yr > 407\n", "qt inc 892 if cp > -789\n", "itw inc 806 if yr != 402\n", "hm dec 977 if iyu <= 2559\n", "gy inc 848 if gy >= -1405\n", "bi dec -310 if qt == 893\n", "hfh inc -40 if yg == -1353\n", "js inc -626 if j == 516\n", "iyu dec 863 if yr < 408\n", "bi inc 321 if b < 1633\n", "qt inc 895 if hfh <= 1178\n", "hfh dec -782 if js == -735\n", "cp inc -443 if yr < 410\n", "yg inc -446 if bi >= 2626\n", "uoc inc -251 if tc < 1824\n", "ioe dec 549 if yg < -1360\n", "x dec -961 if yg <= -1362\n", "gif inc -184 if js > -743\n", "js dec 929 if x <= 397\n", "yg inc 994 if yg == -1362\n", "js dec -246 if bi < 2629\n", "yg dec 875 if j <= 522\n", "ih inc 287 if yg >= -1240\n", "itw inc 615 if hfh == 1958\n", "ih dec -665 if qt <= 1790\n", "itw inc -747 if qt == 1788\n", "iyu inc -631 if tc > 1810\n", "j inc 178 if bhp >= -1273\n", "nwe dec 85 if itw >= 4897\n", "tc inc 530 if cp > -1222\n", "fi dec 329 if tc >= 1819\n", "uoc inc 1 if iyu != 1932\n", "t dec 905 if nwe > -3497\n", "j inc -836 if ioe >= -299\n", "xly dec 185 if nwe > -3499\n", "b inc 41 if gif >= -92\n", "iyu dec 315 if t > -196\n", "nwe dec 676 if uoc != -1839\n", "bi dec 380 if tc != 1819\n", "ih dec -397 if gif != -102\n", "yr dec 449 if js > -1420\n", "hfh inc 584 if bhp <= -1282\n", "ih inc -524 if ioe >= -304\n", "gif dec 688 if hfh == 2542\n", "hm dec -370 if bi == 2621\n", "js dec 575 if hm != -1768\n", "qk dec -85 if itw != 4893\n", "xly inc 961 if tc == 1819\n", "itw inc 913 if qk <= -3699\n", "bi inc -858 if js != -1420\n", "t dec 622 if bi != 1764\n", "qt inc -980 if fi >= -964\n", "fi dec -380 if js == -1418\n", "qt dec -446 if bi != 1772\n", "gy inc -414 if yr != -50\n", "qt dec 628 if itw < 5813\n", "bi inc -649 if fi >= -588\n", "uoc dec 821 if iyu >= 1916\n", "gy dec 19 if xly > -1472\n", "qt dec 137 if qt <= 1608\n", "bhp dec -850 if t >= -830\n", "bhp inc 19 if iyu != 1928\n", "yr dec 272 if ih == 153\n", "js inc 628 if hm > -1775\n", "qk inc 893 if b != 1630\n", "fi dec -959 if gif < -783\n", "x inc 848 if bhp <= -405\n", "bhp dec -555 if j != -318\n", "gif dec -906 if hm > -1772\n", "itw dec -722 if hfh == 2542\n", "bhp dec 960 if j != -327\n", "js dec 670 if gif >= 123\n", "itw inc 153 if yr > -313\n", "t dec -712 if ioe == -299\n", "ioe inc 345 if itw == 6693\n", "hfh dec -411 if bi <= 1123\n", "hfh dec 368 if qt == 1469\n", "ioe dec -688 if itw != 6684\n", "cp inc 888 if bhp != -818\n", "iyu dec 184 if fi != 378\n", "xly inc 143 if fi == 371\n", "cp dec 691 if ih <= 151\n", "bi dec -712 if xly != -1333\n", "nwe inc 231 if bhp < -808\n", "qt dec -736 if fi != 361\n", "hm inc 536 if gy < -988\n", "yr inc -539 if j < -311\n", "xly inc -311 if bi <= 1833\n", "qk inc 271 if yg != -1237\n", "uoc dec -40 if gif < 119\n", "nwe inc 223 if yg >= -1239\n", "qt inc 501 if itw <= 6685\n", "xly inc 11 if t >= -109\n", "hm dec 147 if j != -328\n", "js inc -15 if hm == -1379\n", "bhp inc -841 if fi > 362\n", "fi inc -26 if ioe != 397\n", "fi dec 283 if tc > 1817\n", "uoc inc 105 if j < -314\n", "ioe inc -885 if gif < 113\n", "xly dec -849 if iyu == 1746\n", "j inc -614 if yg != -1243\n", "yg inc 115 if fi <= 62\n", "itw inc -405 if cp != -1222\n", "hm inc 854 if gy >= -988\n", "tc dec 143 if cp >= -1232\n", "gy dec -111 if b < 1635\n", "ioe inc -939 if hfh == 2585\n", "gif dec 43 if bi < 1831\n", "gif dec 519 if itw < 6284\n", "nwe inc 197 if gif != -449\n", "bi dec -71 if bi != 1835\n", "ih inc 479 if hfh >= 2595\n", "ih inc -979 if qk <= -3438\n", "iyu dec 653 if uoc == -2513\n", "yr dec -346 if hfh <= 2585\n", "gif inc 572 if xly != -1638\n", "qk dec -891 if j > -322\n", "qk dec -911 if ih == 150\n", "tc inc 995 if iyu <= 1094\n", "hfh inc -129 if x == 1241\n", "xly dec -533 if gy > -884\n", "gif dec 806 if b == 1630\n", "hfh dec -805 if hfh >= 2453\n", "iyu inc 242 if qt < 2714\n", "fi dec 878 if bhp <= -1661\n", "t dec 166 if hm == -1379\n", "ioe inc -456 if hm == -1379\n", "hm dec 225 if cp >= -1228\n", "xly dec 820 if qt <= 2707\n", "tc dec -786 if bi != 1898\n", "uoc inc 751 if qk != -2547\n", "b dec 922 if x >= 1238\n", "j dec -179 if b <= 715\n", "hfh dec -590 if qk == -2539\n", "x dec 187 if itw == 6280\n", "bi dec -967 if js < -804\n", "tc inc 133 if qt <= 2713\n", "t dec -411 if tc <= 3596\n", "uoc inc 264 if fi < 61\n", "gy inc 223 if ioe <= -1000\n", "gif dec -942 if ioe >= -1008\n", "hfh inc 999 if gy > -662\n", "fi inc -485 if ih <= 153\n", "nwe dec 733 if ioe > -1015\n", "x inc -753 if bhp <= -1653\n", "js dec 784 if gif < 263\n", "bhp dec -307 if b != 703\n", "itw dec -757 if ih == 153\n", "iyu dec 785 if bi >= 2874\n", "nwe inc -450 if t == 136\n", "bi dec -77 if yg > -1132\n", "js dec 990 if yr > -515\n", "iyu inc 337 if bi > 2933\n", "uoc dec 241 if ih != 153\n", "bi dec 459 if hm == -1604\n", "iyu inc -85 if bhp > -1353\n", "qk inc -437 if hm != -1597\n", "x inc -852 if qt <= 2708\n", "gy dec 311 if hm != -1604\n", "iyu dec 876 if t <= 143\n", "x dec 779 if yr <= -513\n", "hfh inc -843 if qt < 2707\n", "bi inc 536 if yg < -1120\n", "itw inc -886 if hfh != 4003\n", "js inc 107 if hfh <= 4009\n", "x dec 156 if yr >= -504\n", "hfh dec 971 if j < -140\n", "tc inc -480 if hm != -1595\n", "x inc 993 if j > -142\n", "tc inc 910 if yg != -1120\n", "tc dec 571 if x != 432\n", "x dec -194 if nwe > -4935\n", "yr inc 288 if b <= 717\n", "fi inc 970 if tc >= 3454\n", "xly dec -554 if fi <= -431\n", "ih inc -380 if iyu <= 706\n", "qk dec 162 if nwe == -4925\n", "fi dec 396 if gif != 261\n", "xly inc 698 if yr >= -224\n", "qt dec 57 if hm >= -1607\n", "tc inc 555 if x <= 644\n", "x inc -20 if xly == -1217\n", "ih dec -766 if ioe <= -1005\n", "tc dec -101 if gy != -660\n", "hm dec 989 if ioe == -1006\n", "yr inc 995 if gy != -651\n", "cp inc -70 if cp < -1232\n", "gy inc -408 if hfh > 3027\n", "yg dec 360 if bhp >= -1352\n", "hm inc 263 if qk < -3137\n", "qt dec -603 if yg > -1495\n", "xly inc 516 if js <= -2466\n", "ioe inc -442 if uoc >= -1764\n", "ih inc 898 if gy < -1053\n", "gif dec 863 if tc >= 4114\n", "hfh dec 478 if hfh != 3030\n", "js dec -623 if hm > -2328\n", "itw dec 792 if qt > 3244\n", "yg inc -367 if tc == 4105\n", "gy inc -330 if b <= 709\n", "x inc 821 if t == 136\n", "bi inc -979 if cp >= -1235\n", "nwe dec -608 if qt == 3252\n", "cp inc 885 if yr == 778\n", "js dec 197 if b > 717\n", "ih inc -737 if qt != 3248\n", "iyu dec -570 if tc < 4107\n", "x dec 63 if bi == 2039\n", "t dec 323 if j < -133\n", "tc inc -962 if tc > 4098\n", "ih inc 663 if xly == -701\n", "ih inc 489 if ih >= 1363\n", "uoc inc -393 if js >= -2480\n", "j inc -62 if cp == -342\n", "gy dec -29 if bhp < -1348\n", "yg inc -202 if nwe >= -4322\n", "fi dec -628 if bi == 2039\n", "itw inc -338 if itw > 5350\n", "qt dec 24 if qt > 3242\n", "tc inc 877 if t == -188\n", "nwe inc 521 if ioe != -1448\n", "gif inc -328 if gif > 261\n", "ih inc -277 if bhp != -1351\n", "tc inc -61 if qk > -3148\n", "nwe inc 588 if xly != -702\n", "qk dec -762 if qk >= -3141\n", "gif inc 937 if b <= 708\n", "t inc -749 if fi == -191\n", "js inc 814 if qk == -2376\n", "j inc -479 if bhp < -1346\n", "iyu inc -941 if gif == 876\n", "js dec 411 if hm > -2326\n", "itw inc -832 if gy == -1364\n", "iyu dec 537 if xly != -706\n", "yg inc 687 if js == -1658\n", "b inc 741 if tc > 3073\n", "x dec 86 if ih < 1584\n", "fi inc 851 if t > -940\n", "x dec 680 if qk >= -2373\n", "gy inc 882 if itw != 4183\n", "tc dec 711 if fi < 658\n", "yg dec -166 if qt == 3228\n", "yg dec 684 if fi > 661\n", "bi inc -715 if gif < 875\n", "gy dec 168 if nwe != -3719\n", "gif inc 301 if yg != -1204\n", "ioe inc 293 if cp >= -344\n", "yr dec -395 if bhp <= -1351\n", "qk inc 97 if js > -1659\n", "hm inc 371 if gif > 865\n", "gif inc 443 if uoc >= -2151\n", "nwe dec -677 if cp > -351\n", "qk dec -845 if yg != -1201\n", "ih dec -890 if cp != -337\n", "nwe dec -932 if hfh > 2549\n", "xly dec -281 if ih <= 2473\n", "cp dec 76 if j == -682\n", "hfh dec 236 if gy == -650\n", "uoc inc 804 if b != 1448\n", "iyu dec -791 if yg <= -1205\n", "yr inc -720 if bi == 1324\n", "b inc -234 if yg == -1204\n", "bhp dec 728 if t != -938\n", "qk dec 703 if itw == 4194\n", "hfh dec 944 if uoc <= -1360\n", "yg dec -384 if hfh < 2324\n", "hm inc -765 if fi == 660\n", "b inc -769 if hfh == 2322\n", "ioe dec 681 if b >= 455\n", "iyu inc -795 if itw > 4180\n", "bhp dec -533 if t < -933\n", "j inc 861 if ih < 2475\n", "ioe inc 136 if itw < 4189\n", "b dec 400 if fi >= 663\n", "fi inc -483 if gif < 868\n", "bhp dec 815 if qt == 3228\n", "x inc -236 if yr > 456\n", "xly inc 516 if b > 443\n", "bhp inc -95 if x != 1295\n", "uoc inc 174 if js > -1668\n", "bi inc 126 if b <= 454\n", "uoc inc -742 if gy >= -655\n", "ih dec -381 if qt > 3235\n", "itw inc -493 if bi <= 1449\n", "fi inc -673 if fi <= 653\n", "ih inc 55 if x >= 1284\n", "tc inc 55 if fi == 657\n", "ioe inc -715 if yg <= -820\n", "nwe inc -665 if qk != -1432\n", "qt inc -129 if b <= 443\n", "fi inc 984 if yg <= -819\n", "cp dec 112 if bi < 1454\n", "j dec -268 if hm <= -2729\n", "fi inc -620 if itw <= 4191\n", "nwe dec 330 if tc != 3077\n", "xly dec -490 if bi == 1450\n", "cp dec 922 if yg >= -825\n", "itw inc -752 if uoc < -1914\n", "yg inc 502 if tc == 3082\n", "hm inc 987 if qt > 3226\n", "qk inc -234 if bi <= 1451\n", "ioe inc 201 if iyu > -64\n", "fi dec 730 if xly <= 591\n", "js inc 506 if qk <= -1661\n", "x dec 453 if yr <= 455\n", "t inc -941 if uoc > -1923\n", "hm inc 30 if bi < 1458\n", "gy inc 947 if fi > 292\n", "hm dec 976 if iyu == -56\n", "tc inc -420 if qk <= -1667\n", "tc dec -779 if gy < 302\n", "bi inc -814 if x < 845\n", "qt dec 484 if bi > 643\n", "yr inc 363 if fi >= 290\n", "ioe inc -314 if gif > 866\n", "ioe inc 84 if yg < -312\n", "bhp dec -941 if itw >= 3447\n", "gif inc -791 if ioe >= -1898\n", "yg dec -440 if ioe != -1904\n", "b dec -673 if x != 835\n", "tc dec -547 if qt <= 3233\n", "t inc 641 if yg < 120\n", "xly dec 548 if fi < 293\n", "iyu dec -947 if hm >= -2687\n", "gif inc 643 if yg > 119\n", "iyu dec 681 if j >= 174\n", "ioe dec 326 if cp == -1452\n", "cp dec 489 if js == -1151\n", "bi dec -814 if js != -1152\n", "tc inc -803 if yr >= 812\n", "qk inc 155 if itw >= 3429\n", "bhp inc -445 if tc < 3188\n", "itw inc -280 if js > -1147\n", "js inc -921 if ioe > -2227\n", "gy inc 200 if b == 446\n", "js inc -943 if nwe > -3125\n", "gif inc -412 if hfh == 2322\n", "t inc 240 if ioe == -2225\n", "iyu inc 774 if b != 440\n", "yr dec -305 if ih != 2522\n", "ih dec -24 if uoc > -1928\n", "yr inc 770 if gif != 1102\n", "iyu inc 440 if yg != 115\n", "gy inc 148 if qt >= 3226\n", "ih inc 534 if tc != 3182\n", "yr inc -140 if js > -3019\n", "ih dec 369 if bhp < -2894\n", "x dec -155 if uoc <= -1915\n", "x inc -627 if nwe < -3114\n", "yr dec -446 if tc != 3180\n", "cp dec -638 if xly <= 593\n", "gy inc -97 if x <= 370\n", "qk inc -769 if fi == 298\n", "hfh dec 365 if bhp < -2906\n", "j dec -533 if xly != 586\n", "x dec 24 if uoc < -1910\n", "fi inc 391 if tc <= 3182\n", "yg inc -329 if b >= 440\n", "ih dec -722 if t >= -1633\n", "qk dec -517 if x >= 340\n", "gif inc 404 if qt != 3225\n", "x inc -52 if ih >= 2716\n", "hm dec 759 if js < -3008\n", "nwe dec -356 if yg >= -212\n", "ioe inc -337 if x == 332\n", "xly inc 610 if cp < -811\n", "j dec 778 if j >= 178\n", "qk dec -477 if ioe != -2231\n", "gy inc 61 if b < 451\n", "hfh inc -726 if gy <= 615\n", "iyu inc -899 if itw < 3441\n", "ih dec 980 if qt >= 3232\n", "js inc 165 if yr != 1425\n", "js dec -668 if yg == -207\n", "b dec 584 if x < 339\n", "qk dec -606 if cp < -806\n", "gif inc 269 if hm <= -3437\n", "js dec -472 if t > -1638\n", "fi inc -853 if xly < 1197\n", "gif inc -716 if iyu != 522\n", "cp inc -536 if itw < 3440\n", "hfh dec -848 if hfh <= 1594\n", "hfh inc -135 if iyu <= 525\n", "fi dec -789 if hfh > 1459\n", "bhp dec -689 if uoc == -1919\n", "hfh inc -507 if ioe <= -2221\n", "yg dec 440 if ih > 2714\n", "qk inc 99 if bhp != -2213\n", "qk dec -330 if hfh >= 958\n", "j inc -946 if ih != 2717\n", "bhp dec -107 if gy < 619\n", "cp dec -797 if t >= -1641\n", "cp dec 615 if fi <= 228\n", "nwe dec 502 if t != -1641\n", "hm dec -58 if hm < -3433\n", "t inc -324 if nwe < -3257\n", "hfh dec 754 if gif > 1067\n", "hm dec 2 if ih == 2709\n", "bi dec -992 if fi == 230\n", "t dec 646 if ih == 2709\n", "qk dec -549 if nwe == -3261\n", "tc dec -772 if nwe <= -3260\n", "fi dec 640 if fi == 230\n", "ioe dec 921 if tc >= 3957\n", "tc dec 79 if tc <= 3964\n", "tc inc 541 if yr == 1427\n", "qk dec 331 if cp >= -546\n", "ih dec 561 if itw >= 3438\n", "itw inc 558 if qk != 119\n", "hfh inc 809 if hfh >= 948\n", "itw dec 981 if xly < 1197\n", "ih dec -431 if js > -1708\n", "yr dec -737 if hfh != 1754\n", "tc inc 873 if ih != 2709\n", "bhp dec -53 if hm != -3395\n", "fi inc -207 if j >= -1541\n", "bi inc -484 if itw >= 2449\n", "js inc 548 if j > -1549\n", "tc inc 336 if nwe != -3257\n", "gy dec 39 if hm == -3386\n", "gif inc 186 if itw > 2450\n", "hm dec 671 if fi > -404\n", "bi inc 950 if qt > 3227\n", "gif inc 667 if fi > -414\n", "x inc 380 if qk != 111\n", "t dec -194 if js > -1172\n", "yr inc -954 if itw < 2449\n", "bhp inc 61 if j <= -1539\n", "x inc -893 if bhp > -1997\n", "ih dec -169 if iyu > 522\n", "b dec 211 if cp >= -548\n", "gif inc -278 if fi < -406\n", "js dec 22 if t < -2404\n", "ih dec -350 if nwe <= -3255\n", "yg dec 198 if qk != 116\n", "fi inc -466 if bi != 2091\n", "yr inc -28 if yg == -405\n", "cp dec 165 if xly < 1201\n", "hm inc 875 if bhp >= -1995\n", "qk inc 856 if gy > 565\n", "hm inc -20 if iyu == 525\n", "hfh dec -771 if itw > 2448\n", "ioe dec 162 if fi == -874\n", "yg inc -662 if ih < 3233\n", "yr inc -214 if t == -2413\n", "xly dec -251 if yg != -1065\n", "itw inc 361 if ih < 3234\n", "qk inc 206 if yg <= -1060\n", "t inc 398 if ioe == -3146\n", "qk dec 35 if b > 437\n", "itw inc -841 if xly != 1445\n", "hfh inc -461 if yr == 1922\n", "hm dec -698 if itw != 1968\n", "fi dec -98 if bhp < -1986\n", "t inc 224 if hfh < 2080\n", "j inc -767 if hm == -1833\n", "uoc dec -817 if j > -2320\n", "qt inc -801 if tc < 4761\n", "hfh dec 597 if iyu == 525\n", "itw dec 670 if cp != -709\n", "ih inc 173 if bhp <= -1983\n", "js inc 904 if hm == -1833\n", "ih dec 913 if bi >= 2091\n", "x inc 841 if itw < 1297\n", "t dec 74 if gif == 1634\n", "j dec 302 if yr != 1916\n", "xly dec -815 if bi > 2092\n", "qk inc -349 if x <= -168\n", "xly inc 974 if fi >= -783\n", "ih inc -251 if t == -1865\n", "ioe dec 314 if nwe != -3253\n", "fi dec -245 if ih < 2239\n", "js dec -69 if js <= -272\n", "yg inc -33 if j != -2623\n", "xly dec -146 if ioe < -3451\n", "bhp dec 757 if itw < 1309\n", "qt inc -472 if yr >= 1918\n", "xly dec 662 if hfh < 1477\n", "nwe dec 66 if iyu <= 528\n", "gy inc 47 if j > -2623\n", "bhp dec -567 if bhp < -2746\n", "gy inc 968 if nwe >= -3333\n", "t dec -731 if iyu >= 519\n", "gif dec -522 if j > -2621\n", "qk inc -855 if tc > 4754\n", "gif inc 125 if gif <= 2159\n", "iyu dec -400 if hfh >= 1476\n", "nwe dec -751 if qk >= -67\n", "hm inc -645 if ioe != -3466\n", "bi inc -235 if nwe >= -2571\n", "b dec 981 if yr >= 1922\n", "gy dec -452 if hm <= -2475\n", "fi dec -532 if qt <= 1959\n", "cp inc 612 if hm >= -2487\n", "fi dec -455 if bi < 2097\n", "t dec 80 if iyu <= 934\n", "xly inc -694 if hm == -2478\n", "uoc dec -759 if qk >= -59\n", "ih dec 244 if yr >= 1918\n", "tc inc 638 if ih > 1998\n", "cp inc 1 if fi < 458\n", "cp inc 454 if nwe > -2573\n", "gy inc -134 if hm < -2471\n", "yg dec 1 if iyu >= 919\n", "js inc 91 if yg < -1108\n", "yg inc 173 if ioe <= -3458\n", "gy dec -760 if t != -1214\n", "qk dec 816 if iyu < 920\n", "gy dec 226 if itw < 1301\n", "bi dec 704 if tc == 4755\n", "iyu inc -661 if nwe != -2572\n", "nwe inc -425 if qt < 1963\n", "gy inc 197 if qk == -58\n", "t inc 853 if nwe == -3001\n", "js dec 603 if yg >= -928\n", "j dec 708 if xly == 2026\n", "hm dec 836 if b == -535\n", "x dec -132 if itw > 1299\n", "cp inc 587 if gif > 2278\n", "t dec -715 if nwe <= -2994\n", "b inc 63 if yr == 1922\n", "tc inc 147 if bi > 1383\n", "yg dec -24 if cp <= 476\n", "gy dec -11 if j == -3322\n", "bhp inc -488 if tc >= 4903\n", "iyu inc 890 if hfh >= 1476\n", "qk inc 224 if yr <= 1928\n", "bhp dec 845 if itw > 1303\n", "uoc inc 965 if qk != 166\n", "fi dec -186 if cp == 482\n", "t dec 388 if js >= -814\n", "hm dec -157 if t < 357\n", "hfh inc -353 if nwe == -3008\n", "x dec 846 if cp >= 491\n", "fi inc -436 if iyu <= 1154\n", "qk dec 465 if bhp == -3027\n", "yg inc -489 if t <= 354\n", "js inc 809 if gif >= 2284\n", "iyu inc 757 if hfh != 1479\n", "uoc inc -765 if yg != -1415\n", "bi inc 637 if nwe == -3005\n", "ih dec 369 if ih == 1993\"\"\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": false }, "outputs": [], "source": [ "parse_input(input)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 9 " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "So we need to parse groups." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "streams = {\"{}\": (1, 1),\n", " \"{{{}}}\": (3, 6),\n", " \"{{},{}}\": (3, 5),\n", " \"{{{},{},{{}}}}\": (6, 16),\n", " \"{<{},{},{{}}>}\": (1, 1),\n", " \"{,,,}\": (1, 1),\n", " \"{{},{},{},{}}\": (5, 9),\n", " \"{{},{},{},{}}\": (2, 3)}" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def parse_stream(stream):\n", " \"\"\"Parses a stream. Returns the number of groups.\"\"\"\n", " counter = 0\n", " groups = 0\n", " score = 0\n", " in_garbage = False\n", " ignore_next = False\n", " for char in stream:\n", " if not in_garbage:\n", " if char == '{':\n", " counter += 1\n", " groups += 1\n", " score += counter\n", " elif char == '}':\n", " counter -= 1\n", " elif char == \"<\":\n", " in_garbage = True\n", " else:\n", " if not ignore_next:\n", " if char == \">\":\n", " in_garbage = False\n", " elif char == \"!\":\n", " ignore_next = True\n", " else:\n", " ignore_next = False\n", " return groups, score" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for stream, expected in streams.items():\n", " print(parse_stream(stream)==expected, parse_stream(stream), expected)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "input_stream = \"\"\"{{{{{{{{ua,a,!>{!>!!!>a>,,!!!!,!!!\"!,!a!e}!>!>,},,}},{{<}eaa'},<<>},<}},}}},{{{{}}},{{{<,!>,!!!>!!!>!>!>a!!,!!',>},<'!<,>},{{{i'u\">}},!!eo!!\"\"'!>,!!,,>}}},{{{{{{!>,},<>}}},{{!!!!,},<{!!!>>},{<>}}},{{{<},!!'>}},{{},{!>},'>}},{{{,}!!!>u>},<'a,!>,e!>!u>},{{{{},e!\"\"!!'e\">},<{e!!!>!}'}o!>,<,o!>},,},},},<}}<'o}!>,<'!!!>'>},{<{e>,{}}}},{{},{}}},{{,!>e\"'!>},>},<,!>}}<,{!e>}},{{{},},{}au!>},,{}},{i!\"!!!>a,uu!ao>},{,{e!!!>},!!!>!ei!!io}!>},<\"!!o!}>,\"!!!o!>,,},<>}},{},{{{{{<\"!!!!!>>}}}},{<{!>},<}i'!!i!>!'},{{ioi\"u>}}}}}},{{{<{\"'e},>}},{{{{u!!!>ao'a>},{}},},!>},\"!>!>},,},{{{<}',\"'>},{{}}},<{<>},{<{!!\"}!!!>!!!>{!,\"!>},,ae}'>,!!!>},,}}},{{{{},i!!!>},}},{{{<\"iao,}>},{{{}},{{{}},{},},>}},{{<>,{o\"!>!>},<,ea>}},{{},{}},{!>},},<{!e,!>},<},e>,\"!!u{u{!>,!>,<>}}}},{{{{},<<\"!!!>},}e},,},a{{!!!>,<{!a}ua<',!!!o!!!>e,!!!>>},},}}},{{{,<}!>{!>o!>},'}},{\"!!ou!!o>,{},},<>}}},{{}}},{{{<\"!eui!>},!>o!!!}>,{!!!!!>!i!'!!e>}},{{i!>,<,\"\"}a}{!!!>{u!>,},,a!!!>,>},{{{,<}>,!!!!!>i>},{<,a!{{{!>,!!a!>},},{{},{}}},{{u!>'!>!!!>,o!>,a!!,},}},{{},<'!{'u!>,},,},<>}}},{{{'>},},{{}},{{a>,<<\"e,u!!!'i!'!!!!!!}!>}i\"aa>}}},{{{ai!!!>!!!>'!>},!>u\"i>,}},{{{<,i!!!>!!e\"au!!'\"u>},{}},{}}}}},{{{{},{{<,!>},<\"!>,,<!!!!\"!>,,<>},<\"<<{},!!!o,o!!!>!!!>!>},<>}},{{<{,{>},<\"oi,!!e!!!>i!>,<{!>,},}},{{{<,{!>'i!>!!!>!!!!!>},<'i{u>},},uo!!o!>,,<>},{{{\"u!!{>},{},<},<>}},{}}},{{},{{{{{<,,>},{}},{{!>!!e!>o!!!!!!!e'!!!>\"u>}},{{'aa!!!>},!'}!!!>>}}}},{{{,<>},{!!o!>a,!>,<,!!!!>}}},{{{{{}},{{!o<,e!>,},},{{<!},>},{},<}!>,},>}}},{{<{}!>!>i!>,!!!>!!!!\"{!>,<,'!>},<>,{u\"!{!!!!}>}},{<{>,{},}},{},}}},{{{{},<>},{{},,},a>}}},{{,},<'e>},{>}}},{{,<'{,!{!!!!!!}}e!!{},{{<,o\"e!>},},},}}},{{{}!!'a\"}}}}},{{},{<,!>},<>}},{{{},{<>}},{u!!a>}},{{},{,<}o!!!>!!!>>},{{{<<,,!!!>!!!>!>},i!!!>o!!!>'!>},>}}}}}},{{{},a{e!!!>!!!!!>>,,},,},{},<,>}},{,<>,!>},<'i'>},{{'},},},,}}}},{{{{},{{{}},,!!!!}!!!>'},>}},{<,!!!!!a!>},,>,<>},{<>}},{{,<!>},<{!!!>,{!!!!o!u\",!!!>'o!!!!a!'!!,>},{<}!>,,!!!>u!!!!!>!>},a!!!>!>>}},{{{},{!>},,e}<>,<}{uuo\"!!o!e>}},{{{<}!>\"!!!>{o!!!!<>},{},{{}}},{},{{<{!!!>eo!>},<,>},,<{iu{!,!!oi!!\"!{'!!>}}}}},{{{{e,\"!!e!>!!,'!>,<>},{{{<},u>},{\",,<>}}}},{{,i!!a!>},>},{{<<''o!>!!!>>}}},{{{ao>},{<,,{!!>,{<},,o}!!\"ioo!>,<}!!,o}i!>,<,{!!!!!!!>!>},<,{!!ia!>,!!!>a!!{}o>}}},{,!!o>}},{{{{{<{o!!e'}{,}},{{!>},}'o{!'{>},,<\"!!{>}},{{!!o!!!>},<\"!>a{!>},<'!>},},,{<}!>},,},!>},i!!!>>}},{<}ia\"!!!>o,<\",!,>}}},{{,<,<>,<}a},},<'!e>},{},},{{}}},{{}},{{{{}},{{<<<,!!o!!!!e!!!>}!!!>!>,},}},{{<,oe!a}!>>},{<{!>},!>!!o!!!>u'\"!>,>}}},{{{<<'!>},!!!!!u!{e!!i!>,},<'!!}!>,},,e>},{<\"!!!>,},}'!!\"!>},,e!}oe>}},{<\">}}}}},{{{,a>},{!>,{!>,,<>}},{{{{!>,<>},{{<\">}}},{{{<,i!!!>}!>,!>,},},''!>>},{}},{{,<{!!!>'!ai!!!>,<>}}},{{{{{!!!>!>,{!}'o!>!!ui}>}},{{!!!>,},!uu!a!>},<>}}},{<o!>,,<}o'!>>,<}!,,},!>},}},{{,<'!>,o!'o>,{}},{}},{{<,!>},<\"!!!!!>''>},{{,,!!!!!>},,>}},{{},,!!'!>},},,<<}}},{{{<},<,<\"oai,!>>},{<'ue!!!>{!>},}}},{},{{{},{}},{,},<{o!!\">,<>}}},{{{}},{{},{<,u!!'!>!>!>},<}!!e!{!!u!!!>},!>},<,>}},{<>}},{{{,}!!!>!''!>!!>},!!!>},},{'>,u{'!!,'>},{}}},{{{{{{},{}}}},{}}},{{{{{!>},!!u!!{{e<'!>},<'!>!>},<>},{<\"o!>,,,}}}}},{{{{!>,,}},{<'au!>},<{{aaiu!!>},{i\"!!iiiu}>}},{},{{<}!!',},<>,{}}},{{{{iie!o\"!!,!>,,,<>},{e!>'>}},{}},{{<'!>},<'!!}!!a!>},e>}},{{<}i\"'!>,!>},!!,!!!!!>,},{{,{<\"i!>},'euu!!!>,<,>}}}}}}},{{{{{{<'u!}!>!>},}}},{{{,{!>,<,{oee}},}}},{{{,ai!>},<\"\"e!!!>!>,},},>},{aui!>},}\"}!>,<,!!!>!>},!!>},{{{}},{!ue\"a,!!!!!>e!!,!>!>,<<>}}},{{{,<\"!!{,},<},<>},{}},{{},,<}!>,e!!\">},{{!o!!uu!,!>,},{!>,!>,,<,o!!!>!>!!!>e{>}}},{{{o!!!>}oa\"!!!>!a\"!{>,},{{<'>},{!!!a!!ia!,!>,u}},{{}}},{{!u!!!>\"!>,>}}}},{{{{}},{{{,}}},{{{!>},!>},}},},},,o{!>>}},{<\"e!>,ia\"!>},}},{{}}},{{{{{!!!>},},,{<'oo!!!>!>,!u!>},<>}},<\"},!!!>,!>!!!>!!!i,>},{{<{!!u\">,<{,{!>},<{!}'>},{{<,<>},{}},{,<<>}},{{{{,},<\"e,}},{{},},}},,}},{{<\",{<>}},{<>,},<\"!!!!!>!\"{{\"''au!!o,},{{!>!e,<>,<>},{<>}}}},{{{{{{<\"}>},{{,},<},{},<'\"}o,o!>},},}!>,}},{<{'e,a!>i!>,,}},{{},!>'a!{!>,,},},{{,<>}}},{{<'i!>,<,o,!!i'i!!e},}e{!!oo!!,!>},<,!>,},},}}},{{,{{},{<,>}}},{{,'!!u}!!,,u}},{{'o\"{ou,'}>},>}}},{{},,!>,<\"{u}},{{{},{{},<>}}},{{},{a<<}{\"\"'!!!>>}}},{{<}!{'!!}}e,'e!!'}!>},},{{{,<{!!,<>},{,<>}}},{,<{!!!>,>,,},},}}},{{{{{},a!\">,},<}>},{{},{>}}},{{},{,{}},{<\"\"{!a>}}},{{{!!'!au',a!'aie'!>,<{o>,{<<<}},{{},{},<,<>}},{{<}i'!>,<}!!oa!!eeu!>},}}},{{},{{{{}},{!!}}}},{},<\"{!!\"},>,{},<,!>!\"!>!!'>}}},{{{,},{,!!>},!!!>'a,\"!>},<>}}},{{{<>}}}},{{{{{{<{!>},a>}},{},,'o'u>,{,<}!>!!}!!<\"ui!>,},<,ou>}},{>,},<{!!,a!>,'!!!!!>\"!o!>,a>}},{{,!o,'>,{},<'!,!>},}}},{{{,,i,!>},<,>},}}},{{{},{{!>},},<}!>!!!!i{>}},{<<\"!>!>,<<,!!!>!!!\"{a>,,>}},{{{{<>,{<{o{i'<{!!\"i,>}}},{{,,<>}},{{{{},<'!!!>ue!o!>!!},<},}>},!>u<>},{{},{},,}},{{e}>,{,>}},{}}}},{{{,!!!>e>}}},{{<,oe>},{{<},,'!!'\"!!!!!>>}},{{{}}}}},{{{},,!!}a\"<'>,{},i!!o'e!!!a>}},{},i'!a!!,<'},{{<'!!!>},<}i{i!!!>!!{!!a,!,>}}},{{}}}}},{{{{,{!!!!!'u{!!\"!!!}o!'aou!!!!!>a>,,}},{},,<'!!!>u!o{oo{'!!!>>,{}},{{}}},{{{<,},,},,}},{<\"}{!>,,>},{{<!!,},},<<{!!>},{<,,},,}}}},{{<{o!!!!!>{!>,<}>},{{}}},{{<{!!!>,<!!!!u!>!!!>'i{,}u>}}},{{{{{},e!>},}},{<,,!'!>,ua>}},{{{<{!,!>,\"!!!!,<>}},{{}}},{{{\"!!!>},<>},{u'ea!>eu!u!!!>}}}},{{{{{},!u!!!>},<,{oi!>,<'!!!>,<>}},{{{{,<\"u}!!\">,{}}},{,<{!!!>!>!!uuo!>,<'!>,<>,},<,>},{}},{{<<}!!{!{!!>},{!ioaau!>!>},,{{e<,iei!!au!!!>},<>,'!\"\"!!!>e{!!!>u>}}}},{}}}},{{{{<>},<}!!'!>,<,}'!>,u>},{!{o!uaa,!!!>{!!!!}!>},<>,{<,\"{ae!>},},!!!>!!!>}e,>}}},{{{<<\"!>'a'!!uu>},<,!>!>a!>!!>},{e!!!!!}uu\"eo>,{}},{{},{{{},{}},{,<'!>e!}!!a}}}},{{},u!!!>e<{!!u\">},{}},{{<,'i!!!>>,<\"e<,'e{u!!!!o}\"!\"\"uu!!!!!>!>},<'o>},{{{}},},!!!>e,!!!>,},<,!!!>,}}}},{{{},{{}},{{{<>}},{<>}}},{{},{{{,},!>ei\"e},{,,,}}}},{{{{{{{<\"!>\">}}},{{<{!,}!>!!!>,<\"!>},},!>},<>,{{}}}},{{{<>,,,<{{}!!!!!!'>}},{},,>,{}},{{{<>,{{{u!!!>\">},\"!!!!!u!!!<,!!!>>}}},{!!a!>},<}u!!!>,!uo}\"u!{!>!!<>}},{{,}}!>},<\"e,>,{},,,<'\",<>}},{},<}\"e'a!>},,},},<'>}},{{{{},<<},,},{{},{}},{{}}}}}},{{{<\"!!e!>},i>,},!>},<>},{},!>!>,>,{{{}}}}},{{{{{,}},{>}},{<{},!!iue''o!!!!!>!>},<>}},{{}},{e'!!,!!!>},<>}}}},{{<>}},{{{<'}{ae>},{,<<}!!!>a!>},,!!!>a!!o>,{},<<{a,e,,i}o!>,<>}}},{{}},{,<{!>},<>,{}}}},{{{{{},,},<{!\",>},{!!u!!!!!>a!!!!!>,>,{!>,i}u!!!>!!!>,},}}},{{{{'!>,<,u!!!>},!!ao>},{{!!!u!!',a!!!!!>u!>,<{>}},{{{}}}}},{{}}},{{{,<\"!>,<{>},{{!!i{>},{!!!>}!!a!{,e!>a!!,!!!>>}},{}}},{{{{{}}},{{},<,!>,<>,{}},,!{!!!>},>}},{{},{{},<{!>,},<}!!\">,{}},,,<,o!>,},<,!!!>}\"o,},<>}},{{{},,<>}}}}}}}},{{{{}}},{{},{,,,},<{ea!u!>a!!!><>,{{},,u{!!!>>}}},{a!>,<<{e{!>},<}}!>>}},{{,,{},a!!!>!!!>o!uio{o>}},{{!!o!!iu!<\"}!!o{'!{ooio<>},}}},{}},{{{{<>},{{{},{},!iaa,}e!>!!o}a!!!>},<>,},,}}},{{<>,<>}}},{{{!>},<'!!!>!>i>}}}},{{}},{{{<}!!!>{!!>},{<'a,!{i!!,!>!!'!>}u>}},{!>,<\">,{<<},},>}},{}},{{{!!!!!!<\"},e}'!!{!!i>}},{{>,!>'!>,},},,,},{{},{}}},{,,{>}}}},{{{,}>},{{{}},{},},<>}},{{ao!>},<},,,,,},},<{>}}},{{{<}!>},<},<,!!!>ua!>!>,>},{{<'o>}},{{},>},!>,<\"}},{{{{},{{},<>,{<>}},{{}},{}},{{{<>},,<>},{{{,\"o!>,<,!!!>o'!!},{{{},{}},{}},{{!>},},<>}},{{!>\",!!!>,>},{!>},<},<\"{\"<>},{}},{{},!>i!>'{ei!!!a!!!>}<>}},{{{{}},{!>},a!>},<\"}!!,u,'{a!>},<{>,io!!},{{},{}}}}},{{{{{,<\">,{<uo!>,<>}}}},{<},{{<}!!!>},},},<}>},{,{}}}},{{<}\"o!},},<'u'!>},<<>},{{{e!>,}},{{!>o!!!>},<,{,a}},{{{<'!>}!!'u,!!!i!!u>}},{,!,>}}},{{{{}}},{{,a!!{},!!i\"!>,!!iu!>},,<<,>}}},{{{{{},<'aae!o!!!>{aa,!>!!!>,<>},{,io<{u!!!!u>,{}}},{<}!!>},<}!>!>!>!!i,!>'!>,<,\">,<{ioo!>},{}a'e\"!o>},{}},{}},{{{{}},{{},{{}}},{{,{}}}},{{{}}},{},{{{!>,i!>},<,e!!!u},<>,{<{a!!!!'oi!!}!>},{>}}},{{{{,}},{{},<{!!<},,!!!>!>,},{{{{},{{!!!>!>,,,<'!>e!>!!ee,>}},{{{<,o!,,o>,{',>}},<\"a!!!!{a!>},}}>},{{{<\"',!a>},},<'!>,,<{i!>},!>,!'!!}<>},<{!o\"o>},{{{{}},{{e!!!>!!!>i'e,,a}!>u\">},{},,i!i!!!>!>,<,a!!'\"\",uu>}}},{{},{{a\"}>},{{}}}}}}},{},{<'!oue!!!>oa!u!>,<}e!>{o>}},{{},{{{},<>}},{{<}!>},!!!>i,!!!>},e!!!!!>\">}}}},{}}},{{{\"!,!>,!!!>,!!!!!>!!!!!!!!'oa!!u{a\"!!!>e>},{<{,!!!>!>,<,<\"!!!>!>},}},{{<>},{{},<\"!!!!!>'!>,>},{!>,,},'>}}}}},{{{{o!!!!e\"!!\",!!!!!!i!!!!!>!'>},{,<'!!!>>}},{}},{{{!ao!>,},i!>},<'!>,<>}},{{{},{{}}}},{{{<\"!>,,<'>}}},{{},{<\"!a!>},!!!>{!!!>},},{{},<'!!!>i!>,<',}}>},{}}}},{{},{{!!!>!i}''eu!>},>},{<{!!!>o'u'oa!!e,>}}},{{,u,!>!!!!!!!>!!!!o>,{<{!>},'e!!\"!!e>}},{{},{}}}},{{{,\",!>oo{!>},>},{'a!>,u}!!!!u\">}}}},{{,<,!!\",a!>},<>,{<{}oe!!!>}{!>},<,{'!>},,<>}},{{<'ao'a!!,!!>},{,<'e>}}},{{{<,}>}}}}}},{{{{{{{<{!>,{o>},{}},{},},}},{{<{{!!i{!>},!!!!!>},},<>,{,<'!>{!!!>\"!}\"!!e!!ii!>>}}},{{{{{}},{!,!>,,,<,>}}},{{<!!!>},<\"'o!>,,,{}},{{!>},},},{}}},{{<<{>},{,!!i!!ea<}!!!!o{}a!>,<,}!>>}}}},{{<\"a!>},,<}!!!!!>'eoi{!!}!>},<>},{!>},!>,<}\",!!'!>!<>},{}},{{{,,iia>},{,a{u}ieu!!a}!!!!e!>},},u!!u!>},<>}},{{>,{<'>}}},{},<,!!o!!!>!!a!!!>!!}>}},{{},{{}}}},{}},{{{},,<,!>,!!e!>},,<>,{u!>,!!!>!e>}}},{<,!e{aaoui>,{<,}i'i\"}\"ou>}}},{{{<>},{!!!!!>}}}eu>}},{},{{{},<!!o!>,<',!!!>u!!!>!!'{!>'!!,e>},{}}}}},{{{<}!>,!!!>},<>},{{{}},{{<{,!>u\"!!a\"',<}!!!>u!!!!!>a!>}},{,>}}},{}},{{{},{{{}},{{{!!,\">}},{},{{\",,<\">},{,!'!!!>u'!>,<,!>,}}}},{<\"iii!>!!!>},<,},,ui\">,<}},{},,{!!!!!!!!}e<>}},{{<'}i!>},ue!!'oa>},>}}}},{{{<'{!>,,<\"!>},<>},},<}eo!!!>ai!>},,!a\"}>},{{<}o!>ao\"!}<<>},{{<>}}}}},{{{{{!>},},{<{>}},{}},{{{},}}},{{},!>,},<<}!>},},<\"}a>},{<,!!!>}!>},},u,<'u!>,,>}},{{{{{<\"e!!!!!!u!!!>!!\"!!!>\"!}!oo!!!>,<>},{},,}},{{},{}}},{{{<{'!!<}!>,<,i,!>},,,<}!!!!o>},!e}a!e!>}!!o>},{},<}}!>},<}{!!>},{io\"'{!,<>,,}}!!!>,,}},{{{{},{<{!!!!!>!!u'!!!!!!!<}e\"a}>}},{},io!!!!!>},<,e,}!>!>!!e}!>},,{{!!!!,{!!ee!>,<,!!>}}},{},<,!>},<>,{{<{!>,<{\"a}!!!>!!!>!!a!!ai!u>,{}}}}},{{{{!}!!a!!>,u!!!>!!,o!!,,<\"!>,,{}!>},}},{{}}},{{{},,{},!!e,e!!u!u,i!!i,>,{}}},{{{,<'i!>},<{e!{!!i>}},{}},{}},{e>,{{},<,!>{!!!>!a!}>}},{{},{{,!>,,!\"!!a!!!>!}}}},{{<\"ioe!>,!!i{!!!>,!!o>}},{{{},{}},{<>,{<'!!'!>!i>}},{{,,a,!!!>>}}}}}},{{<\"'\",<'>},{{\",!>},!!!>!>,,,<{{}i\"a{!!!!!!!>,<}o,>},},{{<{!>,}}},{},{{<'uo!>ui{!!!>!>,,{,}},{{},{}}}},{{{{{{},{}},{}},{{e!!o!!!>ue\"{!!!>!!!>!>>}}},{{<>,{}},{{,o}e\"}>},{}}}},{{{<},!>,uu!!'}!!!>o!!}<{!!!>,,{{{},{{},{<},},<>}}}}},{{!>o!!!>!>,<<,!\"!!}\">}},{{},{}}},{!!!>!!!>!>},},>},{{<'oa{!u}!o!!e!>},}}}}},{{{{{},,<'>}},{}},{}},{{{},,},<<,},{,>,<{!!!>,<'!!!>},<\"!>\"}!>},,!!!!!e!!!!,!>,<>},{{,<>}}},{{!>},<<>},{{<}!>},<'>}}}}}}\"\"\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "parse_stream(input_stream)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def parse_stream2(stream):\n", " \"\"\"Parses a stream. Returns the number of groups.\"\"\"\n", " counter = 0\n", " groups = 0\n", " score = 0\n", " in_garbage = False\n", " ignore_next = False\n", " garbage_count = 0\n", " for char in stream:\n", " if not in_garbage:\n", " if char == '{':\n", " counter += 1\n", " groups += 1\n", " score += counter\n", " elif char == '}':\n", " counter -= 1\n", " elif char == \"<\":\n", " in_garbage = True\n", " else: # we're in the garbage NOW\n", " if not ignore_next:\n", " if char == \">\":\n", " in_garbage = False\n", " elif char == \"!\":\n", " ignore_next = True\n", " elif char != \">\":\n", " garbage_count += 1\n", " else:\n", " ignore_next = False\n", " return garbage_count" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "garbage_streams = {\"<>\": 0,\n", "\"\": 17,\n", "\"<<<<>\": 3,\n", "\"<{!>}>\": 2,\n", "\"\": 0,\n", "\">\": 0,\n", "'<{o\"i!a,<{i': 10}" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for stream, expected_garbage_count in garbage_streams.items():\n", " print(parse_stream2(stream)==expected_garbage_count, parse_stream2(stream), expected_garbage_count)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "parse_stream2(input_stream)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 10 " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "input_str = \"157,222,1,2,177,254,0,228,159,140,249,187,255,51,76,30\"\n", "input = [int(item) for item in input_str.split(',')]\n", "input" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def transform_number_list(number_list, lengths):\n", " # init\n", " #number_list = [0, 1, 2, 3, 4]\n", " #lengths = [3, 4, 1, 5]\n", " current = 0\n", " skip = 0\n", " for length in lengths:\n", " start, stop = current, current + length\n", " if stop < len(number_list):\n", " number_list[current: current + length] = number_list[current: current + length][::-1]\n", " else:\n", " # selecting\n", " stop1 = len(number_list)\n", " stop2 = stop - stop1\n", " selection = number_list[start:stop1] + number_list[:stop2]\n", " # reversing\n", " reversed_selection = selection[::-1]\n", " # modifying list in-place\n", " number_list[start:stop1] = reversed_selection[:stop1 - start]\n", " number_list[:stop2] = reversed_selection[stop1 - start:]\n", " current = (current + length + skip) % len(number_list)\n", " skip += 1\n", " return number_list" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "transform_number_list([0, 1, 2, 3, 4], [3, 4, 1, 5])" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "number_list" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "skip" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "first_two = transform_number_list(list(range(256)), input)[:2]\n", "first_two[0] * first_two[1]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Part 2 " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Converting to ASCII:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def to_ASCII(number_list_as_str):\n", " return list(ord(item) for item in number_list_as_str) + [17, 31, 73, 47, 23]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "to_ASCII(\"1,2,3\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def transform_number_list2(number_list, lengths):\n", " # init\n", " #number_list = [0, 1, 2, 3, 4]\n", " #lengths = [3, 4, 1, 5]\n", " current = 0\n", " skip = 0\n", " for _ in range(64):\n", " for length in lengths:\n", " start, stop = current, current + length\n", " if stop < len(number_list):\n", " number_list[current: current + length] = number_list[current: current + length][::-1]\n", " else:\n", " # selecting\n", " stop1 = len(number_list)\n", " stop2 = stop - stop1\n", " selection = number_list[start:stop1] + number_list[:stop2]\n", " # reversing\n", " reversed_selection = selection[::-1]\n", " # modifying list in-place\n", " number_list[start:stop1] = reversed_selection[:stop1 - start]\n", " number_list[:stop2] = reversed_selection[stop1 - start:]\n", " current = (current + length + skip) % len(number_list)\n", " skip += 1\n", " return number_list" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sparse_hash = transform_number_list2(list(range(256)), to_ASCII(input_str))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from functools import reduce" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "reduce(lambda x, y: x^y, [65 , 27 , 9 , 1 , 4 , 3 , 40 , 50 , 91 , 7 , 6 , 0 , 2 , 5 , 68 , 22])" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "reduce(lambda x,y: x^y, sparse_hash[0:16])" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "dense_hash = [reduce(lambda x,y: x^y, sparse_hash[16*start:16*start+16]) for start in range(16)]\n", "dense_hash" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "to_hex = lambda sequence: \"\".join([format(item, '02x') for item in sequence])" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "to_hex([64, 7, 255])" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "to_hex(dense_hash)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 11 " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "https://www.redblobgames.com/grids/hexagons/" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's encode the directions as vectors that we can add and substract." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "dirs = {'n': np.array([0, 1, -1]),\n", " 'ne': np.array([1, 0, -1]),\n", " 'se': np.array([1, -1, 0]),\n", " 's': np.array([0, -1, 1]),\n", " 'sw': np.array([-1, 0, 1]),\n", " 'nw': np.array([-1, 1, 0])}" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def distance(displacement):\n", " return (np.sum(np.abs(displacement))/2)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def sum_input(input):\n", " return np.sum(dirs[item] for item in input.split(','))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "test_inputs = [('ne,ne,ne', 3),\n", " ('ne,ne,sw,sw', 0),\n", " ('ne,ne,s,s', 2),\n", " ('se,sw,se,sw,sw', 3)]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for test_input, expected in test_inputs:\n", " displacement = sum_input(test_input)\n", " print(test_input, displacement, expected, distance(displacement), distance(displacement) == expected)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "input = \"\"\"n,nw,nw,sw,s,sw,sw,s,s,s,s,s,ne,s,ne,se,se,sw,s,se,se,se,n,se,se,ne,se,ne,n,ne,ne,sw,ne,ne,se,ne,ne,ne,sw,ne,ne,ne,n,ne,n,n,se,ne,ne,n,sw,n,ne,n,ne,n,ne,n,n,n,n,n,n,n,ne,n,n,sw,nw,n,nw,n,nw,n,n,nw,s,nw,nw,n,n,nw,se,nw,nw,sw,n,n,n,nw,nw,n,nw,nw,nw,nw,nw,ne,nw,nw,nw,sw,sw,nw,nw,nw,ne,sw,se,n,s,nw,sw,nw,s,sw,sw,n,nw,sw,sw,nw,sw,sw,nw,nw,nw,sw,sw,sw,s,sw,se,sw,sw,ne,sw,sw,sw,ne,sw,sw,sw,nw,sw,sw,sw,sw,sw,nw,sw,se,se,nw,nw,sw,sw,sw,ne,nw,sw,n,sw,sw,sw,sw,se,sw,sw,se,sw,ne,nw,sw,sw,nw,sw,sw,sw,se,sw,s,s,s,sw,s,sw,sw,sw,s,s,s,s,s,s,s,sw,s,nw,s,sw,s,s,se,s,s,s,s,ne,s,s,se,s,se,nw,s,s,ne,s,s,se,s,s,s,s,s,s,s,s,se,s,se,s,n,s,n,s,s,s,s,s,ne,s,sw,se,s,s,se,s,s,s,s,se,s,s,s,nw,se,s,nw,se,s,se,se,nw,s,sw,s,sw,s,se,se,s,s,s,se,s,s,se,n,se,se,se,s,s,s,se,s,se,se,se,se,s,nw,s,se,se,se,se,se,s,n,se,se,se,se,se,se,sw,s,s,se,n,se,se,ne,se,se,se,se,se,sw,se,se,se,n,se,se,ne,se,se,se,se,se,se,se,se,se,se,sw,sw,nw,se,ne,ne,n,s,se,se,n,ne,ne,nw,se,n,se,se,se,ne,ne,ne,se,s,s,se,se,ne,se,se,se,ne,ne,ne,s,se,nw,ne,s,se,se,ne,se,se,se,ne,se,s,ne,se,se,se,s,ne,sw,nw,s,ne,se,se,ne,ne,ne,n,ne,se,ne,ne,ne,se,ne,ne,sw,ne,ne,n,ne,s,sw,ne,ne,ne,se,ne,se,se,ne,ne,se,se,ne,ne,ne,ne,ne,se,se,n,ne,ne,ne,s,ne,ne,ne,ne,ne,ne,se,se,s,ne,ne,ne,ne,s,ne,ne,ne,ne,ne,nw,ne,ne,sw,ne,se,ne,ne,ne,ne,sw,s,ne,ne,s,ne,ne,ne,ne,se,s,ne,ne,ne,ne,sw,ne,ne,ne,nw,ne,ne,ne,n,ne,ne,se,ne,se,ne,ne,ne,sw,n,ne,ne,n,nw,se,n,n,n,n,sw,ne,n,n,n,ne,se,n,sw,ne,n,n,ne,ne,ne,ne,ne,n,ne,ne,n,n,ne,s,n,ne,n,sw,sw,ne,ne,n,ne,ne,n,sw,ne,s,ne,n,ne,n,n,ne,n,ne,s,n,ne,se,n,ne,n,ne,n,ne,ne,ne,n,s,ne,ne,ne,n,n,n,nw,ne,ne,n,ne,ne,n,sw,s,ne,n,n,sw,ne,ne,n,ne,n,nw,nw,nw,ne,n,n,n,ne,ne,se,n,n,s,ne,n,n,n,nw,ne,s,n,n,nw,sw,ne,ne,n,n,n,ne,n,ne,nw,n,n,n,n,ne,n,n,n,n,n,n,ne,n,n,ne,n,ne,n,n,n,n,n,sw,n,sw,n,n,sw,n,n,n,n,n,n,n,se,ne,se,sw,n,n,n,n,n,n,n,n,n,n,n,n,n,n,nw,n,n,nw,n,ne,n,ne,n,nw,nw,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,ne,n,n,sw,ne,n,n,n,n,n,n,n,ne,n,n,nw,n,n,nw,n,n,n,n,n,n,se,nw,sw,n,n,n,n,n,n,nw,n,n,s,n,nw,n,n,s,n,nw,n,n,nw,se,n,n,n,n,n,n,n,n,nw,n,n,nw,nw,nw,n,sw,nw,n,nw,se,nw,sw,n,nw,s,nw,n,n,sw,nw,nw,nw,sw,nw,nw,nw,n,n,nw,n,n,nw,s,nw,n,n,n,sw,se,n,n,n,nw,nw,s,nw,nw,n,n,nw,nw,nw,n,nw,nw,se,n,n,nw,nw,s,nw,n,n,n,s,nw,ne,nw,n,nw,nw,ne,se,n,ne,n,nw,sw,nw,n,nw,n,n,nw,n,nw,n,nw,n,nw,nw,n,n,n,s,ne,nw,nw,nw,nw,s,nw,nw,nw,n,n,nw,n,nw,sw,nw,nw,nw,n,ne,s,se,nw,n,nw,nw,n,nw,sw,nw,nw,nw,n,s,nw,n,nw,n,n,nw,sw,nw,nw,nw,n,nw,nw,nw,nw,nw,nw,ne,sw,nw,nw,nw,nw,nw,nw,sw,nw,ne,nw,nw,nw,ne,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,n,nw,nw,nw,nw,nw,nw,nw,n,nw,nw,s,se,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,sw,nw,nw,nw,nw,sw,nw,nw,nw,nw,nw,nw,se,n,nw,ne,nw,nw,s,nw,nw,se,s,nw,se,n,nw,nw,nw,nw,nw,n,nw,nw,n,nw,nw,nw,nw,nw,nw,nw,n,s,nw,sw,nw,sw,nw,nw,nw,nw,n,nw,n,nw,sw,nw,nw,nw,nw,nw,nw,ne,nw,nw,nw,nw,nw,nw,se,nw,nw,nw,ne,sw,nw,nw,nw,se,nw,nw,s,n,nw,nw,nw,nw,nw,nw,nw,sw,nw,nw,nw,nw,s,nw,ne,sw,sw,n,nw,nw,sw,nw,se,nw,nw,sw,nw,n,nw,se,nw,se,nw,sw,nw,nw,sw,nw,n,nw,se,nw,nw,s,s,nw,sw,nw,s,nw,nw,nw,n,nw,nw,sw,n,ne,sw,ne,sw,nw,sw,nw,sw,s,sw,nw,sw,nw,nw,nw,sw,sw,nw,nw,nw,se,sw,n,nw,nw,nw,sw,ne,sw,sw,sw,sw,sw,sw,sw,nw,se,nw,nw,sw,nw,sw,sw,sw,nw,nw,n,nw,nw,nw,nw,sw,sw,sw,se,sw,sw,s,sw,sw,sw,sw,sw,n,nw,sw,nw,nw,sw,sw,sw,sw,sw,nw,sw,sw,n,nw,sw,se,sw,sw,nw,sw,sw,nw,nw,ne,se,se,sw,nw,nw,se,sw,nw,sw,nw,nw,nw,nw,sw,sw,nw,sw,nw,sw,nw,sw,sw,sw,sw,sw,nw,nw,sw,sw,sw,sw,nw,nw,sw,nw,sw,sw,sw,sw,sw,sw,n,sw,nw,sw,nw,n,sw,se,nw,sw,s,nw,sw,nw,sw,sw,nw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,ne,ne,n,nw,sw,ne,nw,n,sw,sw,sw,sw,sw,ne,s,sw,se,n,nw,sw,sw,sw,sw,sw,sw,sw,sw,nw,sw,sw,sw,se,sw,sw,n,nw,sw,sw,nw,nw,sw,sw,ne,nw,nw,se,sw,sw,ne,sw,sw,nw,sw,nw,nw,sw,se,sw,ne,sw,sw,sw,nw,sw,sw,s,sw,sw,ne,n,sw,sw,ne,sw,sw,s,nw,nw,nw,sw,sw,sw,ne,sw,sw,n,ne,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,ne,sw,sw,ne,sw,sw,sw,sw,ne,sw,nw,sw,sw,sw,sw,sw,sw,se,sw,sw,ne,sw,nw,sw,sw,n,sw,ne,sw,sw,sw,sw,sw,sw,nw,sw,sw,sw,sw,sw,nw,sw,sw,sw,s,s,sw,sw,sw,sw,sw,sw,sw,sw,n,sw,sw,sw,sw,s,ne,sw,s,s,sw,sw,sw,sw,n,sw,sw,sw,sw,sw,sw,sw,sw,s,sw,sw,sw,sw,sw,se,s,sw,sw,sw,se,sw,sw,n,sw,s,sw,sw,sw,sw,sw,sw,sw,sw,ne,sw,s,s,s,s,sw,nw,sw,sw,sw,sw,nw,sw,sw,s,sw,sw,ne,nw,sw,sw,s,sw,s,sw,sw,sw,sw,s,ne,sw,sw,sw,s,sw,sw,se,sw,sw,sw,sw,sw,sw,ne,se,sw,sw,ne,s,nw,s,sw,s,sw,s,sw,n,sw,n,se,sw,sw,sw,s,sw,s,sw,sw,sw,sw,sw,s,s,sw,s,s,s,s,sw,sw,ne,sw,s,sw,sw,ne,sw,sw,sw,s,sw,ne,sw,sw,sw,ne,sw,sw,s,sw,sw,sw,sw,s,sw,s,sw,sw,sw,s,sw,sw,sw,n,n,sw,s,sw,s,sw,sw,sw,s,s,sw,sw,sw,sw,sw,sw,s,sw,n,sw,sw,s,nw,s,sw,s,n,s,sw,s,s,s,sw,nw,s,sw,s,sw,s,sw,s,sw,ne,s,s,sw,se,sw,sw,n,sw,s,nw,sw,sw,nw,s,s,sw,s,nw,s,s,s,sw,sw,s,s,nw,s,sw,sw,s,nw,sw,s,s,nw,nw,sw,s,se,s,s,sw,s,n,sw,sw,sw,sw,sw,sw,s,ne,s,s,s,sw,sw,s,s,sw,s,sw,s,se,ne,s,s,s,sw,s,s,sw,ne,s,s,sw,s,se,sw,s,s,sw,se,sw,s,ne,sw,s,s,s,s,s,s,s,s,s,s,sw,s,s,sw,s,se,s,s,s,sw,s,sw,s,sw,s,sw,s,s,s,sw,s,s,s,sw,s,n,sw,sw,se,ne,s,s,sw,s,sw,n,sw,s,sw,s,sw,sw,s,s,sw,sw,s,s,s,s,se,sw,s,s,s,n,s,s,se,s,sw,sw,s,sw,s,s,s,sw,s,sw,sw,nw,s,s,s,s,s,s,s,sw,s,s,s,sw,s,s,s,s,nw,s,s,s,s,s,s,sw,n,s,s,s,n,s,sw,se,sw,s,s,nw,sw,s,sw,sw,s,n,s,s,s,sw,s,sw,n,s,s,sw,s,s,sw,s,s,s,s,s,ne,sw,s,s,s,s,s,s,n,sw,s,s,se,n,se,sw,s,sw,s,sw,se,s,s,s,s,se,s,se,ne,s,s,sw,s,nw,se,s,s,s,s,sw,s,s,s,s,s,se,ne,s,s,s,s,s,s,s,se,ne,n,n,s,s,s,s,nw,nw,s,s,s,s,nw,s,s,s,s,s,se,se,s,s,s,n,s,n,s,s,s,s,s,s,s,ne,ne,s,s,n,s,ne,s,sw,s,sw,sw,s,s,ne,s,sw,s,s,n,s,s,se,s,s,s,s,s,s,s,s,se,s,se,s,n,s,s,s,n,s,s,s,s,s,s,s,ne,sw,n,s,s,s,s,sw,s,s,s,s,se,s,n,s,s,s,s,s,s,se,s,s,sw,s,s,s,s,s,s,s,se,n,s,s,ne,s,s,s,s,se,s,se,s,s,s,ne,s,s,s,nw,s,s,s,s,s,se,s,n,se,s,s,s,s,s,se,s,se,nw,se,n,s,n,s,s,s,s,s,s,s,s,s,s,s,nw,s,sw,s,nw,s,s,s,s,s,nw,s,s,ne,sw,s,s,sw,s,s,ne,s,s,se,s,s,s,s,s,s,s,sw,sw,s,ne,s,s,s,sw,nw,s,s,ne,s,n,s,s,s,s,s,n,sw,sw,s,s,sw,se,nw,s,ne,s,s,s,nw,n,s,n,s,s,s,s,s,sw,se,s,s,s,s,se,se,s,s,s,ne,s,s,s,s,s,se,se,nw,nw,s,se,s,ne,se,s,s,se,se,se,s,ne,nw,se,nw,s,n,s,se,se,se,s,sw,s,se,s,se,s,s,s,s,se,se,s,s,s,s,ne,s,s,s,s,s,s,sw,se,s,se,s,s,se,s,sw,s,s,se,se,s,se,se,s,s,se,s,s,s,s,n,ne,se,s,se,s,sw,sw,n,s,s,s,nw,se,sw,se,s,se,se,n,se,s,se,s,s,se,sw,n,s,s,sw,sw,s,se,sw,s,se,sw,s,se,se,s,se,s,se,se,se,ne,s,s,se,s,ne,se,se,s,se,se,se,s,ne,s,s,s,se,se,sw,s,s,s,se,n,s,se,s,se,s,s,s,s,s,s,se,ne,ne,se,ne,se,se,se,se,sw,s,n,ne,s,se,s,s,s,s,nw,ne,s,sw,se,sw,ne,se,nw,s,se,se,se,s,s,ne,s,se,se,ne,s,s,n,s,se,s,se,se,se,se,s,se,se,se,s,se,sw,s,se,n,s,nw,nw,se,s,s,sw,s,se,s,se,se,ne,s,se,se,s,se,s,se,n,s,se,s,s,se,s,s,s,ne,se,se,s,s,sw,se,se,se,se,se,n,se,se,ne,s,se,ne,s,se,se,s,s,n,s,se,s,s,se,ne,se,s,ne,nw,s,n,s,ne,se,s,sw,se,s,se,n,s,se,s,se,se,s,se,s,se,sw,ne,se,se,se,se,s,se,se,se,n,se,se,s,s,s,s,se,se,se,nw,se,se,ne,se,se,s,s,s,s,se,se,s,se,se,sw,s,se,s,se,s,ne,se,se,se,sw,se,nw,n,se,s,se,se,sw,s,sw,s,se,s,s,se,se,se,s,s,se,se,nw,s,se,sw,se,s,se,s,se,s,s,ne,nw,sw,s,se,se,se,se,se,nw,nw,se,s,sw,se,s,ne,se,s,s,se,s,nw,ne,se,ne,se,s,ne,s,nw,se,sw,se,nw,s,sw,sw,se,se,se,s,se,se,se,se,s,s,se,s,s,se,se,s,s,se,se,se,n,s,se,se,se,s,sw,se,se,se,se,se,se,se,se,s,se,se,se,se,ne,se,se,s,ne,se,se,ne,se,s,se,sw,n,se,se,se,se,n,se,sw,se,se,se,sw,se,se,se,s,sw,nw,se,se,sw,nw,se,se,nw,se,se,se,se,nw,se,se,se,se,se,s,nw,se,ne,se,nw,s,se,se,se,sw,se,se,se,se,se,se,se,s,s,se,se,se,se,se,se,nw,n,se,se,se,n,se,se,se,n,n,se,n,se,se,se,se,se,ne,se,se,se,sw,n,n,se,s,sw,se,s,se,ne,ne,nw,se,se,ne,se,se,se,se,se,s,se,se,s,se,se,s,se,se,nw,se,se,se,se,s,se,se,se,se,se,se,se,se,se,se,se,se,n,se,se,se,se,se,se,se,se,s,se,n,sw,n,se,s,se,se,se,se,se,sw,ne,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,se,ne,se,se,se,se,se,se,se,se,se,se,se,ne,se,ne,se,s,se,se,se,se,ne,s,s,se,se,se,se,se,s,se,se,nw,se,se,ne,nw,nw,se,sw,nw,se,se,se,se,se,se,sw,sw,se,se,nw,ne,se,se,ne,se,se,ne,se,se,se,se,se,ne,s,se,se,se,se,se,se,se,se,se,se,n,se,se,se,se,se,se,se,se,se,se,n,se,se,se,se,se,ne,se,se,se,se,se,se,s,se,se,se,se,se,se,se,se,ne,se,se,ne,sw,ne,se,se,ne,se,se,s,se,se,se,nw,ne,se,n,se,sw,se,ne,se,se,se,ne,se,se,se,nw,se,se,ne,n,se,se,se,sw,se,ne,se,se,se,ne,se,se,ne,se,se,se,se,se,se,ne,s,se,ne,se,se,se,se,se,se,ne,ne,se,nw,se,se,se,ne,se,se,sw,ne,ne,s,sw,se,nw,ne,se,ne,ne,se,se,se,ne,ne,se,se,nw,se,ne,ne,se,se,s,nw,ne,ne,se,se,se,ne,se,se,ne,se,se,se,se,se,se,se,s,se,ne,nw,sw,se,se,se,se,se,se,se,se,se,ne,se,se,ne,se,se,se,se,n,se,sw,se,nw,se,se,se,ne,ne,se,se,ne,ne,se,se,s,se,ne,se,s,nw,se,se,nw,se,s,nw,ne,se,se,se,ne,se,se,se,se,se,se,se,se,se,se,se,se,ne,ne,ne,sw,se,se,se,ne,se,se,se,n,se,ne,s,ne,s,se,se,nw,se,ne,ne,n,ne,ne,se,ne,ne,se,sw,n,ne,ne,se,se,ne,se,s,se,ne,n,ne,se,se,se,n,se,s,sw,se,ne,se,ne,se,n,se,se,se,se,ne,se,s,se,se,se,n,se,se,ne,ne,se,se,se,se,n,ne,ne,se,nw,se,sw,n,se,ne,se,se,ne,ne,sw,se,se,se,ne,ne,se,se,se,se,ne,n,n,ne,se,ne,se,sw,se,n,se,se,ne,se,se,sw,se,se,se,se,ne,se,se,ne,se,se,ne,n,se,ne,sw,se,se,se,ne,s,ne,se,se,se,ne,sw,se,se,ne,ne,ne,se,se,ne,se,se,se,ne,se,ne,se,ne,ne,se,se,ne,ne,se,ne,se,nw,se,ne,se,nw,n,nw,ne,se,ne,se,se,ne,se,nw,se,se,ne,nw,se,se,n,ne,nw,se,n,se,se,ne,se,se,se,ne,se,nw,se,ne,ne,se,nw,se,se,se,se,ne,se,se,se,se,ne,nw,se,ne,se,ne,ne,se,n,ne,ne,se,ne,n,sw,ne,ne,se,ne,se,se,se,sw,ne,se,s,nw,se,sw,s,se,ne,s,ne,se,ne,se,ne,s,ne,ne,se,se,se,ne,n,se,ne,nw,ne,ne,nw,se,n,sw,ne,ne,se,ne,ne,se,ne,se,se,sw,sw,ne,sw,se,se,ne,ne,nw,ne,se,se,ne,se,s,sw,ne,se,ne,ne,ne,se,se,ne,ne,se,se,ne,se,ne,se,ne,ne,se,se,se,se,ne,ne,se,ne,se,sw,ne,se,s,s,ne,ne,ne,se,ne,sw,se,ne,ne,se,se,ne,ne,se,ne,ne,ne,ne,ne,se,nw,ne,se,ne,ne,se,se,ne,se,ne,se,ne,n,se,n,se,se,se,se,nw,ne,n,se,ne,s,ne,se,se,ne,ne,ne,n,se,sw,sw,ne,se,ne,ne,ne,se,n,ne,ne,se,se,se,ne,ne,se,ne,sw,ne,n,s,se,se,sw,se,ne,ne,se,n,nw,ne,s,se,ne,sw,s,ne,s,ne,se,nw,ne,ne,sw,ne,ne,ne,s,ne,sw,ne,se,ne,ne,s,se,se,s,ne,nw,nw,se,se,ne,se,ne,s,ne,ne,ne,ne,ne,se,se,ne,ne,se,sw,se,sw,ne,sw,ne,ne,se,ne,se,s,n,se,ne,ne,se,ne,ne,ne,ne,n,se,se,ne,n,se,se,ne,se,ne,ne,se,se,ne,se,se,ne,ne,ne,se,sw,ne,se,se,ne,nw,ne,ne,ne,ne,ne,ne,ne,n,se,ne,se,s,ne,se,ne,ne,se,ne,se,se,ne,se,ne,ne,sw,se,ne,ne,ne,s,ne,ne,s,ne,ne,ne,ne,se,s,ne,ne,ne,ne,ne,se,sw,ne,ne,ne,ne,ne,ne,ne,ne,nw,ne,ne,ne,se,nw,ne,se,ne,ne,ne,ne,ne,s,ne,ne,se,ne,n,ne,ne,ne,ne,ne,ne,se,se,ne,s,ne,ne,se,ne,ne,se,ne,s,n,ne,ne,ne,se,ne,ne,s,se,n,ne,ne,ne,ne,ne,ne,ne,ne,n,ne,nw,ne,ne,ne,sw,ne,ne,ne,ne,ne,ne,ne,nw,ne,se,ne,ne,ne,ne,s,ne,ne,ne,ne,ne,n,ne,ne,ne,ne,ne,ne,n,se,ne,ne,s,ne,ne,ne,s,s,ne,ne,ne,ne,ne,ne,se,ne,ne,ne,se,s,nw,se,ne,ne,ne,ne,nw,ne,ne,ne,sw,ne,sw,ne,ne,ne,ne,ne,ne,n,ne,ne,ne,sw,se,ne,s,ne,ne,ne,ne,ne,ne,n,n,ne,ne,ne,n,ne,ne,nw,ne,ne,ne,nw,s,ne,ne,nw,ne,se,ne,ne,ne,nw,se,nw,ne,ne,ne,ne,ne,ne,ne,nw,ne,ne,ne,ne,sw,ne,ne,n,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,n,s,ne,ne,ne,ne,ne,ne,ne,ne,ne,sw,se,ne,sw,se,ne,nw,sw,ne,ne,ne,ne,nw,ne,ne,s,ne,ne,ne,ne,n,ne,ne,se,nw,s,ne,ne,ne,ne,ne,nw,ne,ne,s,se,ne,ne,s,ne,ne,ne,ne,ne,ne,ne,n,se,s,ne,ne,ne,n,ne,se,se,s,ne,ne,ne,sw,ne,ne,ne,se,ne,ne,ne,s,ne,ne,ne,ne,ne,ne,sw,nw,nw,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,n,ne,ne,ne,ne,ne,ne,ne,ne,s,ne,n,ne,se,ne,nw,ne,sw,ne,ne,ne,ne,nw,ne,s,ne,ne,ne,ne,ne,ne,sw,ne,ne,se,nw,ne,ne,ne,n,se,nw,ne,ne,ne,ne,s,ne,ne,n,se,ne,ne,sw,ne,ne,ne,n,ne,nw,ne,ne,ne,se,ne,n,ne,s,ne,ne,ne,ne,ne,ne,ne,ne,n,ne,ne,se,se,ne,ne,ne,ne,se,ne,ne,ne,ne,ne,ne,ne,n,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,nw,ne,ne,nw,ne,ne,ne,ne,sw,sw,se,ne,n,ne,ne,n,n,n,nw,ne,ne,ne,ne,ne,ne,s,ne,ne,ne,ne,ne,n,ne,sw,se,ne,sw,s,ne,ne,ne,ne,ne,ne,sw,ne,n,n,ne,n,ne,sw,n,ne,n,s,ne,n,ne,ne,ne,ne,ne,sw,s,ne,nw,ne,nw,nw,ne,ne,ne,ne,n,ne,ne,ne,ne,s,ne,ne,ne,ne,ne,ne,ne,ne,n,n,n,ne,n,ne,n,nw,ne,n,ne,ne,ne,ne,ne,ne,ne,ne,sw,ne,ne,ne,n,ne,ne,ne,ne,ne,ne,nw,ne,n,n,ne,ne,ne,n,ne,n,ne,ne,sw,nw,n,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,n,ne,ne,ne,n,n,ne,ne,ne,ne,ne,ne,n,ne,ne,ne,ne,n,n,s,ne,ne,ne,ne,se,ne,nw,ne,ne,se,nw,ne,ne,ne,sw,ne,ne,se,ne,n,n,s,ne,ne,ne,ne,ne,s,ne,ne,ne,sw,ne,ne,se,ne,n,ne,s,ne,sw,ne,s,ne,ne,s,ne,ne,ne,ne,s,ne,s,ne,ne,ne,nw,ne,n,ne,ne,ne,ne,n,ne,n,n,n,ne,ne,n,ne,n,ne,ne,n,nw,se,ne,n,ne,ne,ne,n,n,n,n,ne,n,s,ne,ne,ne,n,n,n,ne,s,s,n,s,nw,ne,ne,ne,sw,ne,ne,ne,n,n,ne,ne,ne,ne,ne,n,ne,ne,ne,n,ne,sw,ne,sw,ne,ne,ne,ne,ne,ne,nw,n,ne,ne,ne,n,s,n,ne,n,sw,s,ne,n,ne,s,ne,se,n,ne,se,n,ne,s,ne,n,ne,n,ne,ne,ne,ne,ne,n,sw,ne,n,nw,n,ne,ne,ne,n,ne,ne,n,n,n,ne,n,ne,n,sw,n,ne,ne,sw,ne,n,sw,n,n,n,nw,ne,ne,ne,ne,ne,ne,sw,s,ne,n,ne,n,n,ne,ne,sw,ne,ne,ne,n,ne,ne,nw,se,n,n,n,ne,ne,n,ne,ne,ne,sw,sw,ne,ne,ne,se,n,sw,n,n,ne,ne,ne,ne,ne,ne,sw,sw,ne,ne,ne,ne,n,n,nw,sw,ne,s,ne,ne,ne,ne,sw,n,n,n,ne,nw,ne,sw,ne,ne,n,sw,ne,ne,sw,ne,n,se,ne,ne,ne,nw,ne,n,ne,nw,ne,ne,s,ne,n,ne,ne,ne,n,ne,ne,ne,n,ne,n,n,n,nw,se,n,n,n,ne,ne,ne,ne,n,ne,se,n,n,ne,n,se,ne,ne,ne,ne,s,n,n,ne,ne,n,ne,n,sw,n,ne,n,sw,n,ne,n,n,ne,n,ne,sw,ne,n,ne,ne,n,s,ne,n,s,ne,n,ne,ne,ne,ne,n,ne,ne,n,ne,sw,n,ne,ne,ne,ne,ne,ne,ne,se,nw,se,n,n,n,n,n,ne,nw,n,n,n,n,ne,sw,n,n,n,ne,ne,n,ne,ne,ne,n,ne,sw,ne,n,sw,ne,n,ne,nw,n,sw,ne,ne,ne,ne,se,nw,sw,n,ne,sw,n,n,n,se,nw,n,s,ne,n,sw,nw,n,ne,ne,n,ne,ne,n,ne,n,n,ne,ne,n,ne,ne,ne,ne,n,sw,se,ne,ne,ne,s,n,nw,s,ne,ne,n,n,n,ne,ne,s,ne,ne,ne,sw,ne,n,n,n,ne,n,ne,se,n,ne,n,s,ne,n,ne,ne,n,ne,ne,s,n,n,n,se,n,n,ne,n,ne,se,se,se,n,n,n,nw,ne,ne,ne,ne,s,n,n,ne,ne,n,s,s,n,n,sw,ne,n,n,n,ne,ne,n,ne,ne,ne,sw,n,ne,n,n,n,ne,ne,nw,n,n,nw,sw,ne,sw,ne,s,n,n,s,n,ne,n,n,ne,n,ne,n,n,ne,ne,ne,n,n,ne,n,ne,ne,n,ne,ne,n,n,ne,ne,n,ne,sw,se,ne,ne,ne,n,n,nw,n,n,n,nw,se,n,n,n,sw,sw,n,n,n,n,ne,ne,n,ne,n,n,n,ne,n,ne,ne,se,se,ne,ne,n,n,n,ne,n,sw,ne,ne,ne,n,n,ne,se,n,sw,ne,ne,n,n,n,n,s,ne,n,n,nw,nw,n,n,n,ne,s,n,ne,ne,s,ne,n,n,sw,ne,ne,n,n,n,s,n,n,n,ne,n,sw,ne,n,s,n,s,sw,se,ne,n,n,n,n,ne,ne,nw,ne,n,n,ne,ne,ne,ne,ne,se,se,ne,n,n,sw,n,n,nw,n,ne,sw,n,sw,ne,ne,n,se,ne,ne,n,n,n,n,sw,n,n,n,nw,s,n,n,n,se,ne,ne,n,n,nw,n,n,n,n,n,n,n,n,n,se,n,ne,nw,n,se,n,ne,n,ne,n,n,n,n,nw,ne,n,n,ne,n,s,n,n,n,n,ne,ne,ne,ne,nw,n,s,se,ne,n,s,n,ne,ne,ne,nw,n,n,nw,se,ne,ne,ne,n,n,n,ne,s,nw,nw,nw,ne,n,n,nw,ne,n,n,ne,n,n,n,ne,sw,n,se,ne,se,n,nw,nw,n,ne,n,ne,ne,n,s,n,ne,ne,s,se,ne,ne,s,n,s,ne,n,n,n,n,nw,ne,n,sw,ne,n,n,n,n,n,se,s,n,n,n,se,n,n,n,n,n,n,n,n,se,n,n,s,ne,ne,ne,ne,s,n,n,n,n,ne,n,n,ne,n,n,n,ne,se,n,n,ne,ne,s,n,n,n,n,n,n,n,ne,s,n,n,n,nw,se,n,n,n,n,n,ne,n,ne,ne,ne,ne,n,n,se,n,n,ne,n,sw,n,ne,n,n,se,s,n,n,n,n,n,n,n,nw,s,n,n,n,ne,ne,n,s,nw,n,n,n,ne,ne,nw,n,ne,n,sw,n,n,ne,n,n,n,ne,nw,n,n,sw,n,se,s,n,n,nw,n,n,n,n,ne,sw,ne,se,n,n,n,n,ne,n,n,sw,nw,ne,n,n,n,sw,n,n,n,n,n,se,s,s,n,s,n,se,n,ne,n,n,n,n,n,n,n,ne,n,n,ne,n,n,n,n,se,nw,n,n,n,ne,n,n,n,n,ne,n,sw,n,s,n,n,n,n,n,se,n,n,ne,n,ne,n,se,n,n,ne,n,n,n,n,n,n,s,n,n,n,n,n,sw,n,ne,n,n,n,n,n,n,n,n,ne,n,n,s,n,n,n,n,n,ne,nw,ne,n,n,n,n,n,n,n,n,sw,n,n,n,nw,n,n,ne,n,ne,n,ne,n,n,nw,n,n,n,n,nw,n,se,n,n,se,n,n,n,n,n,n,n,n,n,n,s,n,n,n,n,ne,se,n,n,nw,n,n,n,n,s,n,n,ne,se,n,sw,n,n,n,ne,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,ne,n,n,n,n,n,n,sw,n,n,n,n,n,n,s,n,n,sw,n,n,n,n,n,n,n,n,ne,n,ne,n,n,n,n,n,n,se,s,n,n,sw,n,n,n,sw,n,n,n,n,n,n,n,n,se,s,sw,se,se,n,ne,se,n,n,n,n,n,n,n,ne,n,n,sw,n,n,n,n,n,n,n,n,n,n,ne,s,s,s,s,ne,s,s,s,sw,se,sw,se,ne,n,sw,nw,nw,sw,ne,se,nw,nw,nw,nw,se,sw,n,n,n,n,n,se,n,n,n,s,n,n,n,se,n,se,n,n,ne,n,n,ne,n,ne,ne,n,ne,ne,se,ne,n,ne,ne,ne,ne,ne,n,sw,se,se,ne,ne,nw,se,s,se,ne,se,se,se,se,ne,se,ne,ne,sw,se,se,ne,se,se,se,se,se,n,se,se,s,se,se,n,se,nw,se,se,sw,se,se,nw,nw,nw,s,se,s,n,se,se,sw,nw,s,se,se,se,se,se,ne,s,se,se,s,s,s,se,ne,nw,s,nw,se,s,sw,s,s,s,sw,s,s,s,s,s,s,s,s,s,sw,nw,sw,s,se,s,nw,s,sw,ne,s,s,s,s,s,sw,s,s,sw,sw,s,s,s,s,ne,n,sw,sw,s,s,se,sw,s,s,sw,s,sw,s,sw,s,sw,sw,s,s,s,sw,s,sw,sw,sw,sw,sw,sw,sw,n,nw,sw,sw,sw,sw,s,sw,sw,ne,sw,sw,sw,sw,sw,sw,sw,sw,n,sw,sw,nw,s,sw,sw,sw,sw,sw,sw,sw,s,sw,sw,sw,sw,se,se,sw,sw,sw,sw,sw,nw,sw,nw,sw,n,sw,sw,nw,nw,nw,nw,se,sw,nw,se,sw,sw,n,sw,n,sw,sw,nw,ne,nw,nw,se,nw,nw,nw,se,nw,nw,nw,s,n,nw,sw,n,sw,sw,nw,ne,nw,nw,s,nw,sw,nw,nw,sw,nw,sw,nw,ne,nw,nw,se,se,nw,nw,ne,nw,se,nw,se,nw,nw,nw,nw,s,s,nw,nw,nw,ne,nw,nw,nw,nw,nw,nw,nw,nw,n,nw,nw,nw,nw,nw,nw,se,nw,nw,nw,nw,nw,nw,nw,nw,nw,ne,nw,nw,n,n,nw,n,nw,nw,nw,s,se,nw,n,n,sw,nw,n,nw,nw,nw,nw,s,n,ne,nw,nw,nw,nw,n,ne,se,nw,nw,nw,n,s,n,n,nw,n,nw,n,nw,s,nw,nw,ne,s,nw,n,n,nw,s,nw,n,sw,nw,ne,n,nw,nw,nw,n,n,n,nw,n,nw,sw,n,n,n,n,se,ne,n,se,s,n,se,ne,n,nw,nw,s,nw,n,n,n,sw,n,nw,sw,n,n,n,nw,sw,n,n,sw,n,sw,n,sw,n,se,n,n,n,n,n,n,n,nw,n,n,n,n,ne,sw,n,s,n,n,n,n,se,nw,n,n,n,se,n,n,n,sw,n,n,se,n,ne,n,ne,ne,n,n,n,n,n,n,n,ne,n,ne,n,se,n,n,n,se,ne,n,n,n,s,s,n,n,n,s,se,n,n,n,n,n,n,se,n,ne,n,ne,ne,n,n,n,ne,n,n,n,n,ne,n,ne,n,n,sw,ne,sw,ne,n,n,n,ne,se,ne,sw,n,ne,ne,ne,n,ne,n,se,n,n,n,n,n,sw,nw,ne,ne,sw,n,se,n,n,ne,se,ne,ne,ne,s,ne,ne,n,ne,ne,ne,n,n,nw,ne,n,n,ne,ne,n,s,ne,ne,ne,ne,n,ne,ne,ne,n,ne,ne,sw,ne,n,ne,nw,se,ne,ne,ne,n,s,ne,ne,ne,ne,ne,n,ne,ne,ne,ne,ne,sw,ne,ne,s,n,ne,s,ne,n,ne,ne,ne,ne,ne,ne,se,se,ne,ne,ne,ne,n,n,ne,ne,ne,ne,ne,ne,ne,ne,nw,se,ne,ne,nw,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,se,n,ne,ne,ne,se,se,ne,ne,n,s,ne,ne,ne,ne,s,s,s,ne,ne,ne,se,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,sw,ne,s,ne,nw,ne,nw,ne,ne,nw,se,ne,s,ne,ne,ne,ne,ne,ne,ne,ne,ne,ne,nw,ne,nw,se,sw,ne,se,ne,ne,se,se,ne,ne,se,ne,sw,ne,ne,ne,se,ne,se,ne,ne,ne,s,s,ne,ne,se,se,ne,s,ne,se,ne,ne,ne,se,ne,ne,se,s,ne,se,ne,se,nw,ne,se,ne,s,s,ne,se,se,sw,se,ne,s,se,ne,ne,ne,ne,ne,n,se,se,se,ne,se,se,ne,n,nw,se,se,n,sw,ne,ne,ne,ne,s,ne,ne,sw,n,ne,ne,se,n,ne,se,se,ne,se,nw,ne,sw,se,s,ne,se,nw,se,ne,ne,ne,se,se,se,ne,ne,ne,se,ne,ne,sw,sw,nw,se,se,nw,n,ne,ne,ne,se,se,se,nw,se,nw,ne,se,nw,nw,se,se,n,se,se,se,se,se,nw,ne,se,se,se,s,se,se,se,se,se,s,se,se,se,nw,nw,ne,ne,n,ne,ne,se,se,se,se,se,sw,n,se,n,se,ne,se,se,se,se,ne,ne,se,se,ne,ne,nw,n,se,ne,se,se,se,se,se,se,se,se,sw,se,ne,ne,se,se,se,se,se,se,se,nw,se,se,se,ne,se,se,ne,se,se,se,se,se,se,sw,se,se,s,ne,se,nw,nw,se,se,se,se,nw,se,se,ne,se,se,se,nw,se,nw,se,se,se,se,se,se,se,se,se,se,se,nw,sw,sw,nw,se,se,se,se,s,se,nw,nw,s,se,se,n,sw,se,se,n,se,se,se,se,n,se,se,se,s,se,n,se,s,se,n,s,n,sw,nw,se,se,se,se,se,se,se,n,se,ne,se,se,sw,se,se,n,se,s,n,se,se,se,se,se,se,se,se,s,se,se,sw,s,se,se,se,nw,se,se,s,s,se,s,se,se,se,se,se,nw,se,sw,sw,n,se,s,se,se,se,se,n,se,ne,se,se,se,sw,s,se,s,se,se,s,se,se,se,s,se,se,s,s,se,n,s,se,nw,se,se,s,s,se,se,se,se,s,se,se,se,se,s,se,ne,s,sw,s,se,se,s,s,nw,s,se,se,sw,se,n,n,s,se,se,se,s,sw,se,se,s,s,s,s,se,n,se,s,s,s,se,s,nw,s,s,se,s,se,s,s,sw,se,se,s,ne,se,se,s,se,s,sw,s,s,s,s,se,se,s,n,n,se,s,se,se,n,ne,s,s,s,s,s,s,se,n,s,s,se,nw,ne,s,se,nw,se,se,s,s,se,s,se,sw,s,se,se,s,se,s,s,s,n,s,se,n,se,n,s,s,se,sw,se,s,s,s,s,ne,s,se,sw,s,s,s,se,s,ne,s,s,sw,se,s,se,se,s,n,s,s,s,s,sw,s,s,s,ne,s,se,sw,se,s,s,ne,s,se,s,se,se,nw,s,s,s,s,s,se,s,s,s,ne,s,ne,s,s,s,s,s,s,s,s,s,s,s,ne,s,nw,s,s,s,s,n,s,s,s,ne,sw,s,s,s,s,s,s,s,ne,s,s,s,nw,s,s,se,s,s,se,sw,s,s,s,n,s,s,s,s,s,s,s,s,s,s,nw,s,s,s,s,s,s,nw,s,s,s,s,s,se,nw,s,n,s,s,s,s,s,s,s,s,nw,se,s,s,s,s,s,s,s,s,s,s,s,s,s,se,n,s,s,n,sw,sw,ne,s,sw,nw,s,s,s,sw,s,s,s,s,s,ne,sw,s,s,s,s,s,s,s,sw,s,s,ne,s,s,s,s,s,s,nw,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,sw,sw,se,s,sw,s,s,nw,s,sw,s,sw,s,s,nw,n,sw,s,s,sw,se,s,s,s,s,se,sw,s,nw,s,ne,s,n,s,s,se,sw,sw,s,s,sw,s,s,s,se,s,s,s,ne,ne,sw,s,sw,s,s,s,s,s,s,sw,s,s,s,s,s,s,s,sw,sw,s,s,s,s,s,s,sw,s,s,s,se,sw,s,s,nw,s,s,sw,s,s,sw,ne,s,sw,sw,nw,s,s,s,sw,s,s,ne,sw,s,s,s,s,s,s,s,sw,s,s,sw,s,sw,s,s,sw,sw,sw,s,s,se,ne,se,s,s,ne,sw,s,sw,sw,s,sw,se,se,sw,s,s,s,sw,s,s,n,s,n,sw,sw,sw,s,n,se,sw,s,s,s,s,ne,s,sw,s,sw,n,s,s,s,s,s,s,s,s,s,s,s,s,s,sw,n,sw,s,ne,s,sw,sw,s,sw,s,s,sw,s,s,s,s,se,s,sw,s,s,sw,s,n,s,sw,s,s,sw,s,s,s,sw,sw,sw,s,nw,s,sw,sw,sw,s,s,s,sw,sw,sw,nw,sw,nw,nw,sw,sw,sw,nw,sw,sw,sw,s,s,sw,s,sw,s,s,sw,s,sw,sw,nw,sw,sw,ne,nw,nw,s,n,sw,n,s,s,s,sw,sw,sw,s,sw,sw,sw,sw,s,nw,sw,sw,s,sw,sw,nw,ne,sw,nw,sw,sw,sw,sw,sw,s,s,sw,sw,n,sw,n,sw,sw,sw,sw,se,sw,sw,sw,s,s,ne,sw,sw,nw,sw,s,se,sw,s,sw,sw,sw,se,sw,sw,s,sw,sw,sw,s,sw,sw,sw,nw,sw,sw,sw,sw,sw,sw,sw,nw,s,sw,sw,n,sw,s,s,sw,n,nw,sw,n,sw,sw,sw,n,s,sw,sw,sw,s,sw,sw,sw,s,s,sw,sw,sw,s,s,sw,sw,sw,sw,se,sw,sw,nw,sw,se,sw,sw,n,n,sw,s,sw,sw,sw,s,sw,sw,sw,sw,s,sw,sw,sw,ne,sw,sw,nw,nw,sw,sw,n,sw,sw,sw,sw,s,sw,sw,n,sw,sw,s,nw,sw,sw,sw,s,sw,sw,sw,sw,n,sw,sw,s,sw,sw,sw,sw,sw,sw,s,sw,sw,sw,ne,s,sw,sw,n,sw,sw,sw,sw,nw,sw,sw,sw,sw,sw,n,sw,nw,s,sw,sw,sw,sw,sw,ne,ne,sw,sw,sw,sw,sw,sw,sw,sw,ne,sw,sw,sw,sw,sw,s,nw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,s,sw,ne,se,sw,n,sw,s,sw,ne,sw,s,sw,s,sw,nw,nw,sw,n,se,ne,sw,sw,sw,sw,sw,sw,n,sw,sw,sw,sw,sw,s,nw,sw,sw,nw,sw,sw,sw,se,sw,n,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,sw,s,sw,sw,s,sw,ne,ne,sw,sw,se,sw,nw,sw,nw,n,sw,sw,sw,s,sw,sw,sw,sw,sw,sw,sw,sw,n,s,sw,ne,sw,ne,sw,se,n,nw,nw,sw,sw,sw,sw,sw,s,ne,sw,se,sw,sw,sw,sw,sw,sw,ne,nw,se,sw,sw,sw,sw,sw,nw,nw,ne,nw,nw,s,sw,nw,sw,sw,ne,sw,ne,sw,nw,se,nw,n,sw,nw,sw,sw,sw,sw,sw,sw,nw,sw,nw,sw,sw,sw,se,sw,s,sw,sw,sw,sw,sw,sw,sw,sw,se,s,nw,nw,nw,s,n,sw,sw,sw,nw,sw,n,sw,n,s,nw,s,sw,sw,sw,sw,sw,sw,sw,sw,nw,sw,sw,sw,sw,sw,nw,sw,sw,sw,sw,sw,sw,nw,nw,sw,se,se,s,ne,sw,nw,sw,sw,nw,sw,sw,sw,ne,nw,sw,nw,sw,sw,sw,nw,sw,nw,sw,n,nw,ne,sw,sw,nw,sw,sw,sw,s,sw,nw,nw,nw,nw,nw,se,sw,sw,se,nw,se,nw,nw,n,sw,sw,sw,sw,nw,sw,nw,s,nw,sw,sw,nw,se,s,nw,sw,nw,nw,s,sw,sw,n,se,nw,sw,sw,nw,sw,sw,sw,sw,nw,nw,sw,sw,sw,sw,nw,nw,sw,sw,sw,sw,se,sw,nw,sw,sw,sw,nw,nw,se,sw,sw,nw,sw,ne,nw,sw,sw,sw,sw,sw,s,nw,sw,sw,nw,nw,sw,ne,nw,sw,sw,sw,sw,ne,s,nw,sw,sw,sw,nw,n,sw,nw,nw,nw,nw,nw,sw,sw,sw,ne,nw,sw,n,nw,sw,se,sw,sw,nw,nw,n,sw,nw,sw,nw,s,nw,sw,nw,nw,nw,n,nw,sw,s,nw,nw,s,nw,nw,sw,n,se,ne,n,sw,sw,sw,n,sw,sw,sw,s,nw,s,se,sw,sw,sw,ne,sw,sw,nw,sw,n,n,sw,n,nw,sw,s,ne,sw,sw,sw,sw,nw,sw,nw,sw,nw,sw,nw,nw,nw,sw,sw,nw,ne,sw,nw,s,nw,sw,sw,sw,sw,sw,nw,sw,sw,sw,nw,sw,nw,n,nw,sw,sw,nw,nw,nw,sw,sw,se,nw,ne,sw,sw,nw,nw,sw,sw,sw,s,s,sw,sw,ne,s,nw,ne,nw,se,nw,nw,nw,nw,se,sw,nw,sw,nw,nw,sw,sw,nw,sw,sw,sw,nw,sw,nw,nw,nw,sw,se,se,nw,nw,sw,nw,nw,nw,nw,s,sw,sw,nw,s,se,sw,nw,n,nw,sw,nw,se,sw,nw,nw,se,nw,nw,nw,nw,nw,sw,n,nw,ne,n,nw,sw,sw,sw,ne,ne,sw,nw,sw,nw,nw,nw,sw,nw,se,sw,nw,sw,nw,sw,nw,sw,nw,s,nw,se,nw,nw,nw,nw,nw,nw,n,nw,nw,sw,s,se,ne,n,sw,se,s,sw,nw,nw,se,nw,nw,sw,nw,nw,sw,sw,se,nw,sw,n,sw,sw,nw,nw,nw,nw,nw,nw,nw,sw,nw,nw,sw,nw,nw,nw,ne,nw,sw,se,sw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,s,nw,nw,nw,nw,nw,nw,nw,sw,sw,nw,nw,nw,nw,nw,nw,nw,sw,sw,n,nw,sw,nw,nw,nw,nw,nw,nw,sw,nw,nw,ne,nw,s,nw,sw,nw,nw,nw,ne,nw,sw,sw,nw,se,nw,sw,nw,nw,nw,nw,n,nw,nw,sw,nw,nw,nw,nw,sw,nw,nw,nw,nw,nw,n,nw,nw,n,s,nw,nw,nw,sw,nw,nw,se,nw,nw,nw,nw,nw,nw,nw,nw,sw,nw,nw,nw,nw,nw,nw,nw,nw,sw,n,nw,nw,nw,nw,nw,nw,nw,nw,s,nw,nw,sw,nw,nw,nw,nw,nw,s,nw,s,nw,sw,nw,sw,sw,sw,sw,se,nw,s,sw,nw,nw,se,s,nw,sw,sw,nw,nw,nw,nw,nw,nw,nw,nw,nw,ne,se,n,nw,nw,nw,nw,nw,nw,nw,nw,s,se,ne,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,nw,se,nw,se,nw,sw,nw,nw,nw,ne,nw,nw,nw,nw,nw\"\"\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sum_input(input)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "distance(sum_input(input))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "maxdist = 0\n", "displacement = np.zeros((3,))\n", "for item in input.split(','):\n", " displacement += dirs[item]\n", " maxdist = max(maxdist, distance(displacement))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "maxdist" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 12 " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "input = \"\"\"0 <-> 889, 1229, 1736\n", "1 <-> 1, 480, 793, 1361\n", "2 <-> 607\n", "3 <-> 273, 422\n", "4 <-> 965, 1052, 1130, 1591\n", "5 <-> 1998\n", "6 <-> 483, 1628\n", "7 <-> 1012, 1242, 1244, 1491\n", "8 <-> 524\n", "9 <-> 13, 281, 1498\n", "10 <-> 10\n", "11 <-> 1956\n", "12 <-> 598, 621, 1210\n", "13 <-> 9\n", "14 <-> 1728\n", "15 <-> 912, 1461\n", "16 <-> 1489, 1680, 1994\n", "17 <-> 854\n", "18 <-> 1157, 1299\n", "19 <-> 759\n", "20 <-> 1352, 1831\n", "21 <-> 1425\n", "22 <-> 470, 685, 857, 1526\n", "23 <-> 405\n", "24 <-> 43, 536, 1849\n", "25 <-> 1674\n", "26 <-> 26, 1738\n", "27 <-> 558\n", "28 <-> 1863\n", "29 <-> 154, 649, 1818\n", "30 <-> 721, 1366\n", "31 <-> 725\n", "32 <-> 413, 880, 903\n", "33 <-> 414, 442, 1403\n", "34 <-> 489, 1308\n", "35 <-> 385, 1254, 1464\n", "36 <-> 167, 1013, 1860\n", "37 <-> 535\n", "38 <-> 605, 1297\n", "39 <-> 680, 1408, 1982\n", "40 <-> 169, 615, 952, 1547\n", "41 <-> 644, 991, 1319, 1509\n", "42 <-> 453, 1315\n", "43 <-> 24, 200, 805\n", "44 <-> 919, 1083\n", "45 <-> 500\n", "46 <-> 1532, 1550\n", "47 <-> 910, 1837\n", "48 <-> 1849\n", "49 <-> 542, 1945\n", "50 <-> 57, 660\n", "51 <-> 354, 934\n", "52 <-> 1212\n", "53 <-> 569\n", "54 <-> 706\n", "55 <-> 55, 114, 1077\n", "56 <-> 1453\n", "57 <-> 50, 1438\n", "58 <-> 616, 738\n", "59 <-> 1242\n", "60 <-> 312, 523, 648\n", "61 <-> 748, 1780, 1965\n", "62 <-> 1533, 1909\n", "63 <-> 562, 661, 1016\n", "64 <-> 280, 300, 677\n", "65 <-> 661, 698, 1881\n", "66 <-> 283, 440\n", "67 <-> 382, 421\n", "68 <-> 986, 1592, 1824\n", "69 <-> 541, 1363\n", "70 <-> 266, 1855\n", "71 <-> 371, 433, 1055, 1682\n", "72 <-> 793\n", "73 <-> 73\n", "74 <-> 1139\n", "75 <-> 770, 1190, 1409, 1433, 1886\n", "76 <-> 1135\n", "77 <-> 492, 1771\n", "78 <-> 575, 1107, 1596, 1670\n", "79 <-> 1374\n", "80 <-> 1168, 1519\n", "81 <-> 1258\n", "82 <-> 919, 1519, 1768\n", "83 <-> 1463\n", "84 <-> 684\n", "85 <-> 517, 1655\n", "86 <-> 1226\n", "87 <-> 1700\n", "88 <-> 523, 1292, 1939\n", "89 <-> 177, 1695, 1706\n", "90 <-> 400, 1683\n", "91 <-> 194\n", "92 <-> 106, 1546\n", "93 <-> 104\n", "94 <-> 501, 1686\n", "95 <-> 285, 1985\n", "96 <-> 402, 770\n", "97 <-> 196\n", "98 <-> 318, 1827\n", "99 <-> 220, 1272, 1766, 1802\n", "100 <-> 1105\n", "101 <-> 380, 957\n", "102 <-> 1305, 1483\n", "103 <-> 262, 481, 621\n", "104 <-> 93, 708, 1731\n", "105 <-> 282\n", "106 <-> 92, 901\n", "107 <-> 553, 742, 1833\n", "108 <-> 480, 1140\n", "109 <-> 1247\n", "110 <-> 1549\n", "111 <-> 1283\n", "112 <-> 1503, 1963\n", "113 <-> 819, 1601\n", "114 <-> 55, 593, 1020\n", "115 <-> 324\n", "116 <-> 378\n", "117 <-> 1534\n", "118 <-> 1740, 1836\n", "119 <-> 1223, 1283\n", "120 <-> 435, 1063\n", "121 <-> 404, 939\n", "122 <-> 294, 360, 1809\n", "123 <-> 1166\n", "124 <-> 1988\n", "125 <-> 163\n", "126 <-> 126\n", "127 <-> 255, 754\n", "128 <-> 634, 969\n", "129 <-> 563, 1732, 1926\n", "130 <-> 1196\n", "131 <-> 1019, 1429\n", "132 <-> 1287, 1417\n", "133 <-> 1453\n", "134 <-> 184, 786\n", "135 <-> 647\n", "136 <-> 260, 306\n", "137 <-> 1342\n", "138 <-> 292\n", "139 <-> 1265\n", "140 <-> 613\n", "141 <-> 1001, 1217\n", "142 <-> 142, 1901\n", "143 <-> 758, 822, 1533\n", "144 <-> 866, 930, 1197, 1443, 1665\n", "145 <-> 1672\n", "146 <-> 1937\n", "147 <-> 1409, 1697\n", "148 <-> 608, 954, 1624\n", "149 <-> 527, 652, 1938\n", "150 <-> 709\n", "151 <-> 447, 1305, 1314\n", "152 <-> 1741\n", "153 <-> 901, 1997\n", "154 <-> 29, 929\n", "155 <-> 1178, 1976\n", "156 <-> 560\n", "157 <-> 522\n", "158 <-> 541\n", "159 <-> 1212, 1878\n", "160 <-> 1078\n", "161 <-> 1128, 1913\n", "162 <-> 588, 734\n", "163 <-> 125, 1073, 1952\n", "164 <-> 1156\n", "165 <-> 1781\n", "166 <-> 1692\n", "167 <-> 36, 1637\n", "168 <-> 1043, 1085\n", "169 <-> 40, 334, 1257, 1313\n", "170 <-> 170\n", "171 <-> 171\n", "172 <-> 1391\n", "173 <-> 925\n", "174 <-> 1733\n", "175 <-> 175, 1466\n", "176 <-> 726, 1182\n", "177 <-> 89, 1100\n", "178 <-> 611, 1141\n", "179 <-> 1036, 1307\n", "180 <-> 1556\n", "181 <-> 1930\n", "182 <-> 775, 1284\n", "183 <-> 1907\n", "184 <-> 134, 1981\n", "185 <-> 255, 1278\n", "186 <-> 1891\n", "187 <-> 531, 1318\n", "188 <-> 790, 1623\n", "189 <-> 379, 1749, 1865\n", "190 <-> 1103, 1676\n", "191 <-> 534\n", "192 <-> 477\n", "193 <-> 193, 860\n", "194 <-> 91, 710, 1780\n", "195 <-> 290, 1383, 1510\n", "196 <-> 97, 1664\n", "197 <-> 1416\n", "198 <-> 287, 1760\n", "199 <-> 366\n", "200 <-> 43\n", "201 <-> 813, 1882\n", "202 <-> 246, 1175\n", "203 <-> 203, 1007\n", "204 <-> 204, 923\n", "205 <-> 924\n", "206 <-> 1162, 1818\n", "207 <-> 365, 487, 923\n", "208 <-> 1281, 1290\n", "209 <-> 1280\n", "210 <-> 210, 288, 1333\n", "211 <-> 211, 417, 754\n", "212 <-> 1698\n", "213 <-> 1626\n", "214 <-> 1256\n", "215 <-> 215, 1385, 1671\n", "216 <-> 811, 1025\n", "217 <-> 554, 1715\n", "218 <-> 1483\n", "219 <-> 1741\n", "220 <-> 99, 530, 1081, 1319, 1801\n", "221 <-> 804, 1144\n", "222 <-> 1288, 1702\n", "223 <-> 223, 1231\n", "224 <-> 649, 1179\n", "225 <-> 1271, 1776\n", "226 <-> 226, 1991\n", "227 <-> 496, 857, 1004, 1821\n", "228 <-> 371, 500\n", "229 <-> 1162\n", "230 <-> 693, 1081\n", "231 <-> 506, 973\n", "232 <-> 859, 969, 1922\n", "233 <-> 233\n", "234 <-> 875, 1006\n", "235 <-> 1035, 1998\n", "236 <-> 236\n", "237 <-> 289, 569, 1440\n", "238 <-> 1249, 1923\n", "239 <-> 1564, 1775, 1944\n", "240 <-> 1888\n", "241 <-> 951, 1874\n", "242 <-> 825\n", "243 <-> 384, 983, 1838\n", "244 <-> 715, 1501\n", "245 <-> 592, 671\n", "246 <-> 202, 391, 632, 656\n", "247 <-> 663\n", "248 <-> 253, 752\n", "249 <-> 1073, 1558\n", "250 <-> 290\n", "251 <-> 792, 1389\n", "252 <-> 797\n", "253 <-> 248, 771\n", "254 <-> 254, 1047\n", "255 <-> 127, 185, 369\n", "256 <-> 623\n", "257 <-> 1636, 1740\n", "258 <-> 317\n", "259 <-> 1775\n", "260 <-> 136, 561, 1290\n", "261 <-> 359, 1657\n", "262 <-> 103, 697, 1074\n", "263 <-> 1205\n", "264 <-> 1779, 1782\n", "265 <-> 1407\n", "266 <-> 70, 1215, 1306\n", "267 <-> 333, 790\n", "268 <-> 603\n", "269 <-> 269, 1497\n", "270 <-> 270, 1613\n", "271 <-> 1416, 1562, 1923\n", "272 <-> 579, 894\n", "273 <-> 3, 993\n", "274 <-> 333\n", "275 <-> 1188\n", "276 <-> 535, 645, 1166, 1269\n", "277 <-> 1369\n", "278 <-> 744, 1717\n", "279 <-> 349, 695, 985, 1096\n", "280 <-> 64, 1516\n", "281 <-> 9, 427, 768, 1468\n", "282 <-> 105, 867\n", "283 <-> 66, 1235, 1525, 1748\n", "284 <-> 530\n", "285 <-> 95, 800, 1191\n", "286 <-> 339, 611, 1581\n", "287 <-> 198, 1285, 1501\n", "288 <-> 210, 1059\n", "289 <-> 237, 1928\n", "290 <-> 195, 250, 1934\n", "291 <-> 337, 1902\n", "292 <-> 138, 1805, 1849\n", "293 <-> 906\n", "294 <-> 122, 1582\n", "295 <-> 602\n", "296 <-> 778\n", "297 <-> 471, 483\n", "298 <-> 298\n", "299 <-> 402, 729\n", "300 <-> 64, 1002\n", "301 <-> 856\n", "302 <-> 1084, 1538, 1739\n", "303 <-> 892, 1774\n", "304 <-> 1029, 1350\n", "305 <-> 521, 1628, 1902\n", "306 <-> 136, 469, 653, 835\n", "307 <-> 981\n", "308 <-> 1997\n", "309 <-> 1612\n", "310 <-> 1338, 1571\n", "311 <-> 1388\n", "312 <-> 60\n", "313 <-> 1557\n", "314 <-> 886, 1704\n", "315 <-> 672, 779\n", "316 <-> 1062, 1906\n", "317 <-> 258, 1290\n", "318 <-> 98, 318\n", "319 <-> 1974\n", "320 <-> 839\n", "321 <-> 395, 615, 909, 1046\n", "322 <-> 1077, 1390, 1989\n", "323 <-> 323, 773, 1571\n", "324 <-> 115, 493, 511, 650\n", "325 <-> 325\n", "326 <-> 1944, 1972\n", "327 <-> 1489\n", "328 <-> 412, 468\n", "329 <-> 1637\n", "330 <-> 556, 1176\n", "331 <-> 656\n", "332 <-> 564, 1688\n", "333 <-> 267, 274, 421, 1205, 1743\n", "334 <-> 169, 1896\n", "335 <-> 1176\n", "336 <-> 638, 1408, 1633\n", "337 <-> 291, 844, 1549\n", "338 <-> 515\n", "339 <-> 286\n", "340 <-> 340, 1959\n", "341 <-> 943\n", "342 <-> 417, 638, 1116, 1536\n", "343 <-> 1030\n", "344 <-> 584, 1751\n", "345 <-> 345, 1810\n", "346 <-> 346\n", "347 <-> 587\n", "348 <-> 515, 1187\n", "349 <-> 279, 349\n", "350 <-> 1749\n", "351 <-> 1030, 1097\n", "352 <-> 352\n", "353 <-> 353, 683\n", "354 <-> 51, 354, 735\n", "355 <-> 1362\n", "356 <-> 1593\n", "357 <-> 357\n", "358 <-> 441, 501, 899, 1672\n", "359 <-> 261\n", "360 <-> 122, 360, 1234, 1927\n", "361 <-> 736\n", "362 <-> 1169\n", "363 <-> 780\n", "364 <-> 444, 905, 1049, 1911\n", "365 <-> 207\n", "366 <-> 199, 1469\n", "367 <-> 1612\n", "368 <-> 675, 1800\n", "369 <-> 255\n", "370 <-> 370, 873, 962, 1238\n", "371 <-> 71, 228, 456\n", "372 <-> 1912\n", "373 <-> 1318\n", "374 <-> 1018, 1246\n", "375 <-> 898, 1303\n", "376 <-> 376, 573\n", "377 <-> 1080\n", "378 <-> 116, 1140\n", "379 <-> 189, 1984\n", "380 <-> 101\n", "381 <-> 472, 827, 1097\n", "382 <-> 67\n", "383 <-> 383, 582\n", "384 <-> 243, 432, 444, 569, 634\n", "385 <-> 35\n", "386 <-> 1496\n", "387 <-> 637, 737, 756, 1293\n", "388 <-> 1562\n", "389 <-> 633\n", "390 <-> 488\n", "391 <-> 246, 853, 1422\n", "392 <-> 1253, 1331\n", "393 <-> 921, 1567, 1777, 1970\n", "394 <-> 809\n", "395 <-> 321, 798, 1040\n", "396 <-> 746, 1332\n", "397 <-> 400, 953\n", "398 <-> 1958\n", "399 <-> 399\n", "400 <-> 90, 397, 808, 1485\n", "401 <-> 1395\n", "402 <-> 96, 299, 1388\n", "403 <-> 716\n", "404 <-> 121\n", "405 <-> 23, 934, 1221\n", "406 <-> 1007\n", "407 <-> 1391\n", "408 <-> 497, 1090, 1644\n", "409 <-> 1479\n", "410 <-> 793, 1977\n", "411 <-> 1026\n", "412 <-> 328, 581, 806\n", "413 <-> 32, 1354\n", "414 <-> 33, 1920\n", "415 <-> 799, 1207, 1880\n", "416 <-> 1862\n", "417 <-> 211, 342, 589, 1858\n", "418 <-> 556, 1437, 1490\n", "419 <-> 1393\n", "420 <-> 420\n", "421 <-> 67, 333, 1813\n", "422 <-> 3, 706, 1598, 1721\n", "423 <-> 1834\n", "424 <-> 854, 1442\n", "425 <-> 855, 1080\n", "426 <-> 1408, 1469\n", "427 <-> 281\n", "428 <-> 832, 1998\n", "429 <-> 553, 657, 834\n", "430 <-> 1466\n", "431 <-> 1357\n", "432 <-> 384\n", "433 <-> 71\n", "434 <-> 434, 489, 1137\n", "435 <-> 120\n", "436 <-> 972, 1461\n", "437 <-> 550\n", "438 <-> 486, 844\n", "439 <-> 978\n", "440 <-> 66, 705, 1850\n", "441 <-> 358, 589, 783, 804, 1129\n", "442 <-> 33, 497\n", "443 <-> 1806\n", "444 <-> 364, 384, 1698\n", "445 <-> 1208, 1294, 1452\n", "446 <-> 1143, 1452\n", "447 <-> 151, 1072\n", "448 <-> 448\n", "449 <-> 997, 1829\n", "450 <-> 1277\n", "451 <-> 1531, 1866\n", "452 <-> 1175, 1622, 1975\n", "453 <-> 42, 1486\n", "454 <-> 689\n", "455 <-> 1497\n", "456 <-> 371, 1577\n", "457 <-> 702\n", "458 <-> 461, 921, 1279\n", "459 <-> 1004\n", "460 <-> 485, 505, 1211, 1451\n", "461 <-> 458, 541, 916, 1844\n", "462 <-> 1281\n", "463 <-> 856, 1481\n", "464 <-> 602, 1476, 1553\n", "465 <-> 543, 1566\n", "466 <-> 847, 1593\n", "467 <-> 1270\n", "468 <-> 328, 829\n", "469 <-> 306, 667, 720, 1931\n", "470 <-> 22\n", "471 <-> 297\n", "472 <-> 381\n", "473 <-> 473\n", "474 <-> 599, 1146\n", "475 <-> 1570, 1894\n", "476 <-> 1145\n", "477 <-> 192, 1193, 1690\n", "478 <-> 1469, 1840\n", "479 <-> 1684\n", "480 <-> 1, 108\n", "481 <-> 103, 963\n", "482 <-> 1778\n", "483 <-> 6, 297, 1662\n", "484 <-> 1435\n", "485 <-> 460\n", "486 <-> 438\n", "487 <-> 207, 998, 1185\n", "488 <-> 390, 1231, 1668\n", "489 <-> 34, 434, 1341\n", "490 <-> 990, 1203\n", "491 <-> 936\n", "492 <-> 77\n", "493 <-> 324\n", "494 <-> 1984\n", "495 <-> 495, 1954\n", "496 <-> 227\n", "497 <-> 408, 442, 1551\n", "498 <-> 1704, 1788\n", "499 <-> 836\n", "500 <-> 45, 228, 1358, 1798\n", "501 <-> 94, 358, 1559\n", "502 <-> 951\n", "503 <-> 1036\n", "504 <-> 1303\n", "505 <-> 460\n", "506 <-> 231, 606, 1473\n", "507 <-> 1109\n", "508 <-> 1724\n", "509 <-> 1644\n", "510 <-> 848\n", "511 <-> 324, 1036\n", "512 <-> 523\n", "513 <-> 809, 1294\n", "514 <-> 785\n", "515 <-> 338, 348, 1027, 1193, 1226\n", "516 <-> 1988\n", "517 <-> 85, 1482\n", "518 <-> 518\n", "519 <-> 1625\n", "520 <-> 520\n", "521 <-> 305, 1033\n", "522 <-> 157, 1355, 1476, 1588\n", "523 <-> 60, 88, 512\n", "524 <-> 8, 1998\n", "525 <-> 990, 1275\n", "526 <-> 1310, 1552\n", "527 <-> 149, 979, 1805\n", "528 <-> 698\n", "529 <-> 631, 970\n", "530 <-> 220, 284, 1533, 1944\n", "531 <-> 187, 551, 1168, 1574\n", "532 <-> 1484\n", "533 <-> 892\n", "534 <-> 191, 879\n", "535 <-> 37, 276, 1527\n", "536 <-> 24, 1094\n", "537 <-> 747, 952\n", "538 <-> 1620, 1735\n", "539 <-> 858, 1467\n", "540 <-> 1263, 1572\n", "541 <-> 69, 158, 461\n", "542 <-> 49, 1384\n", "543 <-> 465, 639, 873\n", "544 <-> 1338\n", "545 <-> 1967\n", "546 <-> 806, 1239\n", "547 <-> 792, 1039, 1078\n", "548 <-> 548, 1891, 1941\n", "549 <-> 861\n", "550 <-> 437, 1209, 1967\n", "551 <-> 531, 888, 896\n", "552 <-> 798\n", "553 <-> 107, 429, 1330, 1951\n", "554 <-> 217\n", "555 <-> 744, 947, 1246\n", "556 <-> 330, 418, 1070, 1925\n", "557 <-> 1826, 1854\n", "558 <-> 27, 1629\n", "559 <-> 1042, 1150\n", "560 <-> 156, 1472, 1834\n", "561 <-> 260\n", "562 <-> 63\n", "563 <-> 129, 1309\n", "564 <-> 332\n", "565 <-> 1770, 1842\n", "566 <-> 621\n", "567 <-> 1160, 1178, 1642\n", "568 <-> 895\n", "569 <-> 53, 237, 384\n", "570 <-> 641\n", "571 <-> 571, 1261, 1924\n", "572 <-> 882\n", "573 <-> 376\n", "574 <-> 982\n", "575 <-> 78, 1255\n", "576 <-> 887, 1539\n", "577 <-> 603, 1122, 1679\n", "578 <-> 742\n", "579 <-> 272, 1444, 1747\n", "580 <-> 797, 1554, 1718\n", "581 <-> 412, 1926\n", "582 <-> 383\n", "583 <-> 1611\n", "584 <-> 344, 1620\n", "585 <-> 1692\n", "586 <-> 1383\n", "587 <-> 347, 1351\n", "588 <-> 162, 1220\n", "589 <-> 417, 441\n", "590 <-> 1919\n", "591 <-> 884, 992\n", "592 <-> 245, 814\n", "593 <-> 114\n", "594 <-> 1843\n", "595 <-> 1809\n", "596 <-> 837\n", "597 <-> 1563, 1575\n", "598 <-> 12, 605, 984\n", "599 <-> 474, 1218\n", "600 <-> 732, 1237, 1714\n", "601 <-> 1913\n", "602 <-> 295, 464, 1061\n", "603 <-> 268, 577, 720\n", "604 <-> 604\n", "605 <-> 38, 598\n", "606 <-> 506, 686, 1813\n", "607 <-> 2, 1948\n", "608 <-> 148\n", "609 <-> 1571\n", "610 <-> 772, 901\n", "611 <-> 178, 286, 880\n", "612 <-> 1814\n", "613 <-> 140, 883, 1198, 1764, 1942\n", "614 <-> 1352\n", "615 <-> 40, 321\n", "616 <-> 58, 1413\n", "617 <-> 624, 1008, 1591, 1791\n", "618 <-> 1625\n", "619 <-> 871, 1567\n", "620 <-> 1954\n", "621 <-> 12, 103, 566\n", "622 <-> 1895\n", "623 <-> 256, 1767\n", "624 <-> 617\n", "625 <-> 663\n", "626 <-> 626\n", "627 <-> 1650\n", "628 <-> 884\n", "629 <-> 1104, 1421\n", "630 <-> 630, 864\n", "631 <-> 529, 646\n", "632 <-> 246\n", "633 <-> 389, 1847\n", "634 <-> 128, 384\n", "635 <-> 1553, 1817\n", "636 <-> 636\n", "637 <-> 387\n", "638 <-> 336, 342, 646, 1453\n", "639 <-> 543, 815, 1087\n", "640 <-> 1422, 1597\n", "641 <-> 570, 805, 993, 1961\n", "642 <-> 1371\n", "643 <-> 959, 1044, 1444\n", "644 <-> 41\n", "645 <-> 276, 1022, 1184\n", "646 <-> 631, 638, 1790\n", "647 <-> 135, 1286\n", "648 <-> 60\n", "649 <-> 29, 224, 1636\n", "650 <-> 324\n", "651 <-> 863, 1321\n", "652 <-> 149, 687, 1128, 1346\n", "653 <-> 306\n", "654 <-> 1409\n", "655 <-> 1142, 1733\n", "656 <-> 246, 331, 768, 1815\n", "657 <-> 429\n", "658 <-> 1511, 1569\n", "659 <-> 1744\n", "660 <-> 50, 796, 1524\n", "661 <-> 63, 65, 810\n", "662 <-> 995, 1661\n", "663 <-> 247, 625, 1001\n", "664 <-> 664\n", "665 <-> 1305\n", "666 <-> 666, 1817\n", "667 <-> 469, 1003, 1550\n", "668 <-> 1540, 1958\n", "669 <-> 831, 883, 1349, 1719\n", "670 <-> 1531\n", "671 <-> 245, 671, 1693\n", "672 <-> 315, 1088\n", "673 <-> 942, 1381, 1660\n", "674 <-> 880\n", "675 <-> 368\n", "676 <-> 1269, 1699\n", "677 <-> 64, 1654\n", "678 <-> 784\n", "679 <-> 1760\n", "680 <-> 39\n", "681 <-> 681\n", "682 <-> 728, 749, 1995\n", "683 <-> 353\n", "684 <-> 84, 1150\n", "685 <-> 22\n", "686 <-> 606\n", "687 <-> 652, 1687\n", "688 <-> 1878\n", "689 <-> 454, 689\n", "690 <-> 924, 1183\n", "691 <-> 1410, 1413\n", "692 <-> 1702\n", "693 <-> 230, 1658\n", "694 <-> 820, 1282, 1873\n", "695 <-> 279\n", "696 <-> 1168\n", "697 <-> 262, 766, 776\n", "698 <-> 65, 528, 698, 940\n", "699 <-> 1778\n", "700 <-> 743, 1459, 1825\n", "701 <-> 1475\n", "702 <-> 457, 792, 861, 1467\n", "703 <-> 1581\n", "704 <-> 1969\n", "705 <-> 440, 1145\n", "706 <-> 54, 422\n", "707 <-> 1015, 1780\n", "708 <-> 104, 1266\n", "709 <-> 150, 1778\n", "710 <-> 194\n", "711 <-> 751\n", "712 <-> 963\n", "713 <-> 1525, 1762\n", "714 <-> 1713\n", "715 <-> 244, 1293, 1421\n", "716 <-> 403, 1572\n", "717 <-> 1142\n", "718 <-> 1204\n", "719 <-> 1672\n", "720 <-> 469, 603\n", "721 <-> 30, 1268, 1400\n", "722 <-> 1183\n", "723 <-> 1012\n", "724 <-> 1029, 1289, 1368\n", "725 <-> 31, 1039\n", "726 <-> 176, 726\n", "727 <-> 856\n", "728 <-> 682, 1000\n", "729 <-> 299, 1216, 1967\n", "730 <-> 850, 900\n", "731 <-> 1540, 1884\n", "732 <-> 600, 784\n", "733 <-> 1655\n", "734 <-> 162\n", "735 <-> 354, 1955\n", "736 <-> 361, 1084, 1822\n", "737 <-> 387\n", "738 <-> 58, 1573\n", "739 <-> 1119, 1216, 1822\n", "740 <-> 829, 1219\n", "741 <-> 1164\n", "742 <-> 107, 578\n", "743 <-> 700, 1744\n", "744 <-> 278, 555\n", "745 <-> 835, 1903\n", "746 <-> 396\n", "747 <-> 537, 1843\n", "748 <-> 61\n", "749 <-> 682, 1217, 1731\n", "750 <-> 874, 1110, 1724\n", "751 <-> 711, 1767\n", "752 <-> 248, 1011\n", "753 <-> 1327, 1885\n", "754 <-> 127, 211, 1117\n", "755 <-> 755\n", "756 <-> 387\n", "757 <-> 1098, 1169\n", "758 <-> 143, 1689\n", "759 <-> 19, 1517\n", "760 <-> 831, 1915\n", "761 <-> 761, 1195\n", "762 <-> 1634\n", "763 <-> 763\n", "764 <-> 848, 1375\n", "765 <-> 765, 1136\n", "766 <-> 697, 1295, 1887\n", "767 <-> 1906\n", "768 <-> 281, 656, 1031\n", "769 <-> 1457, 1863\n", "770 <-> 75, 96\n", "771 <-> 253, 846, 1375\n", "772 <-> 610\n", "773 <-> 323\n", "774 <-> 1067\n", "775 <-> 182, 1494\n", "776 <-> 697\n", "777 <-> 1136\n", "778 <-> 296, 1057\n", "779 <-> 315, 1631, 1796\n", "780 <-> 363, 780, 1814\n", "781 <-> 928, 1423\n", "782 <-> 1850\n", "783 <-> 441\n", "784 <-> 678, 732, 999, 1988\n", "785 <-> 514, 1248\n", "786 <-> 134, 786, 1009\n", "787 <-> 1348, 1863\n", "788 <-> 891, 1183, 1455\n", "789 <-> 1310, 1420, 1510\n", "790 <-> 188, 267\n", "791 <-> 1276\n", "792 <-> 251, 547, 702\n", "793 <-> 1, 72, 410, 1092\n", "794 <-> 880\n", "795 <-> 1799, 1807\n", "796 <-> 660, 1548\n", "797 <-> 252, 580, 797\n", "798 <-> 395, 552\n", "799 <-> 415, 799\n", "800 <-> 285, 1889\n", "801 <-> 801\n", "802 <-> 802\n", "803 <-> 1188, 1326, 1935\n", "804 <-> 221, 441\n", "805 <-> 43, 641, 1772\n", "806 <-> 412, 546, 918, 1617\n", "807 <-> 876, 1887\n", "808 <-> 400, 1435, 1716\n", "809 <-> 394, 513\n", "810 <-> 661\n", "811 <-> 216, 1259\n", "812 <-> 1883\n", "813 <-> 201, 1692\n", "814 <-> 592\n", "815 <-> 639\n", "816 <-> 1041, 1734\n", "817 <-> 1134, 1432\n", "818 <-> 1575\n", "819 <-> 113, 1063\n", "820 <-> 694\n", "821 <-> 1242\n", "822 <-> 143, 892\n", "823 <-> 1393, 1492\n", "824 <-> 946\n", "825 <-> 242, 999\n", "826 <-> 1594\n", "827 <-> 381, 1079, 1580\n", "828 <-> 1941\n", "829 <-> 468, 740, 1905\n", "830 <-> 977, 1260, 1861\n", "831 <-> 669, 760, 946, 1332\n", "832 <-> 428, 832, 944, 1172\n", "833 <-> 837, 1008, 1470\n", "834 <-> 429, 915\n", "835 <-> 306, 745, 976\n", "836 <-> 499, 967\n", "837 <-> 596, 833, 974\n", "838 <-> 1335\n", "839 <-> 320, 839, 1703\n", "840 <-> 1053, 1398, 1760\n", "841 <-> 1193\n", "842 <-> 842, 1066, 1108\n", "843 <-> 1414, 1697, 1894\n", "844 <-> 337, 438\n", "845 <-> 1506\n", "846 <-> 771\n", "847 <-> 466, 907, 1432\n", "848 <-> 510, 764\n", "849 <-> 1063, 1195, 1701\n", "850 <-> 730, 1551\n", "851 <-> 1112, 1331, 1479\n", "852 <-> 1652\n", "853 <-> 391\n", "854 <-> 17, 424, 906, 1665\n", "855 <-> 425, 1082\n", "856 <-> 301, 463, 727, 1744\n", "857 <-> 22, 227\n", "858 <-> 539, 1252, 1472\n", "859 <-> 232, 1843\n", "860 <-> 193\n", "861 <-> 549, 702, 1709, 1884\n", "862 <-> 1149\n", "863 <-> 651, 955\n", "864 <-> 630\n", "865 <-> 1138\n", "866 <-> 144, 1111, 1114\n", "867 <-> 282, 1487, 1835\n", "868 <-> 1699\n", "869 <-> 869\n", "870 <-> 1487\n", "871 <-> 619\n", "872 <-> 872\n", "873 <-> 370, 543, 1968\n", "874 <-> 750, 874\n", "875 <-> 234, 1202, 1473\n", "876 <-> 807, 933, 1741\n", "877 <-> 1205, 1874\n", "878 <-> 1831\n", "879 <-> 534, 1860\n", "880 <-> 32, 611, 674, 794\n", "881 <-> 1361, 1750\n", "882 <-> 572, 1495\n", "883 <-> 613, 669\n", "884 <-> 591, 628, 1815\n", "885 <-> 996, 1237\n", "886 <-> 314, 1709\n", "887 <-> 576\n", "888 <-> 551\n", "889 <-> 0, 1494\n", "890 <-> 1100, 1966\n", "891 <-> 788, 1312\n", "892 <-> 303, 533, 822, 1334, 1812, 1935\n", "893 <-> 1723\n", "894 <-> 272, 1992\n", "895 <-> 568, 1038\n", "896 <-> 551, 1425\n", "897 <-> 1783\n", "898 <-> 375\n", "899 <-> 358\n", "900 <-> 730\n", "901 <-> 106, 153, 610\n", "902 <-> 1203\n", "903 <-> 32, 1935\n", "904 <-> 1109\n", "905 <-> 364\n", "906 <-> 293, 854, 1565\n", "907 <-> 847, 1139, 1180, 1431, 1563, 1878\n", "908 <-> 1908\n", "909 <-> 321, 943\n", "910 <-> 47, 1067\n", "911 <-> 1468, 1495\n", "912 <-> 15\n", "913 <-> 1692\n", "914 <-> 922, 1445\n", "915 <-> 834, 1002\n", "916 <-> 461\n", "917 <-> 1177, 1924\n", "918 <-> 806, 962, 1058, 1419\n", "919 <-> 44, 82, 1933\n", "920 <-> 1147, 1539\n", "921 <-> 393, 458, 1055, 1951\n", "922 <-> 914, 1271\n", "923 <-> 204, 207, 1201\n", "924 <-> 205, 690\n", "925 <-> 173, 1816\n", "926 <-> 1279\n", "927 <-> 927\n", "928 <-> 781\n", "929 <-> 154\n", "930 <-> 144\n", "931 <-> 972, 1237\n", "932 <-> 1317\n", "933 <-> 876, 1756\n", "934 <-> 51, 405, 1105, 1960\n", "935 <-> 935, 1674\n", "936 <-> 491, 1201, 1247\n", "937 <-> 956, 1576, 1788\n", "938 <-> 1377, 1733\n", "939 <-> 121, 1638\n", "940 <-> 698, 1808\n", "941 <-> 1665, 1957\n", "942 <-> 673\n", "943 <-> 341, 909\n", "944 <-> 832\n", "945 <-> 1087, 1340\n", "946 <-> 824, 831\n", "947 <-> 555\n", "948 <-> 959\n", "949 <-> 1068\n", "950 <-> 1664\n", "951 <-> 241, 502, 1151\n", "952 <-> 40, 537, 1376\n", "953 <-> 397\n", "954 <-> 148, 1075, 1364\n", "955 <-> 863, 1235, 1618, 1724\n", "956 <-> 937\n", "957 <-> 101, 1323\n", "958 <-> 1794, 1972\n", "959 <-> 643, 948, 1023\n", "960 <-> 960, 1417\n", "961 <-> 1278\n", "962 <-> 370, 918\n", "963 <-> 481, 712\n", "964 <-> 1198\n", "965 <-> 4\n", "966 <-> 966\n", "967 <-> 836, 967, 1821\n", "968 <-> 1513\n", "969 <-> 128, 232\n", "970 <-> 529\n", "971 <-> 1471\n", "972 <-> 436, 931\n", "973 <-> 231\n", "974 <-> 837\n", "975 <-> 1390\n", "976 <-> 835\n", "977 <-> 830\n", "978 <-> 439, 1687\n", "979 <-> 527\n", "980 <-> 980, 1609, 1940\n", "981 <-> 307, 1671\n", "982 <-> 574, 1318, 1643\n", "983 <-> 243\n", "984 <-> 598\n", "985 <-> 279\n", "986 <-> 68\n", "987 <-> 1060\n", "988 <-> 1942\n", "989 <-> 1478\n", "990 <-> 490, 525, 1838\n", "991 <-> 41, 1263, 1302\n", "992 <-> 591\n", "993 <-> 273, 641\n", "994 <-> 1026, 1240, 1618\n", "995 <-> 662, 1545\n", "996 <-> 885, 1528\n", "997 <-> 449, 1058\n", "998 <-> 487\n", "999 <-> 784, 825\n", "1000 <-> 728\n", "1001 <-> 141, 663, 1626, 1681\n", "1002 <-> 300, 915\n", "1003 <-> 667\n", "1004 <-> 227, 459\n", "1005 <-> 1780\n", "1006 <-> 234, 1578\n", "1007 <-> 203, 406\n", "1008 <-> 617, 833\n", "1009 <-> 786, 1064\n", "1010 <-> 1010, 1031, 1919\n", "1011 <-> 752, 1754\n", "1012 <-> 7, 723, 1068, 1181\n", "1013 <-> 36\n", "1014 <-> 1594\n", "1015 <-> 707\n", "1016 <-> 63\n", "1017 <-> 1511\n", "1018 <-> 374, 1034\n", "1019 <-> 131, 1155\n", "1020 <-> 114\n", "1021 <-> 1288\n", "1022 <-> 645\n", "1023 <-> 959, 1375\n", "1024 <-> 1024\n", "1025 <-> 216\n", "1026 <-> 411, 994\n", "1027 <-> 515\n", "1028 <-> 1417\n", "1029 <-> 304, 724\n", "1030 <-> 343, 351\n", "1031 <-> 768, 1010\n", "1032 <-> 1032\n", "1033 <-> 521\n", "1034 <-> 1018\n", "1035 <-> 235, 1578\n", "1036 <-> 179, 503, 511, 1036\n", "1037 <-> 1037, 1044\n", "1038 <-> 895, 1125\n", "1039 <-> 547, 725, 1599\n", "1040 <-> 395\n", "1041 <-> 816\n", "1042 <-> 559, 1042\n", "1043 <-> 168, 1873\n", "1044 <-> 643, 1037, 1312\n", "1045 <-> 1232\n", "1046 <-> 321\n", "1047 <-> 254\n", "1048 <-> 1747\n", "1049 <-> 364\n", "1050 <-> 1050, 1947, 1963\n", "1051 <-> 1156\n", "1052 <-> 4, 1201\n", "1053 <-> 840\n", "1054 <-> 1133, 1342, 1537, 1708, 1778\n", "1055 <-> 71, 921, 1786\n", "1056 <-> 1672\n", "1057 <-> 778, 1423, 1787\n", "1058 <-> 918, 997\n", "1059 <-> 288, 1337, 1401\n", "1060 <-> 987, 1781\n", "1061 <-> 602, 1660\n", "1062 <-> 316, 1863\n", "1063 <-> 120, 819, 849\n", "1064 <-> 1009\n", "1065 <-> 1065\n", "1066 <-> 842\n", "1067 <-> 774, 910, 1089\n", "1068 <-> 949, 1012\n", "1069 <-> 1900\n", "1070 <-> 556\n", "1071 <-> 1884\n", "1072 <-> 447, 1122\n", "1073 <-> 163, 249, 1073, 1237\n", "1074 <-> 262\n", "1075 <-> 954, 1075, 1789\n", "1076 <-> 1076, 1680\n", "1077 <-> 55, 322\n", "1078 <-> 160, 547\n", "1079 <-> 827, 1079\n", "1080 <-> 377, 425, 1739\n", "1081 <-> 220, 230\n", "1082 <-> 855, 1638\n", "1083 <-> 44\n", "1084 <-> 302, 736\n", "1085 <-> 168, 1431\n", "1086 <-> 1973\n", "1087 <-> 639, 945\n", "1088 <-> 672\n", "1089 <-> 1067, 1190\n", "1090 <-> 408, 1492\n", "1091 <-> 1674\n", "1092 <-> 793\n", "1093 <-> 1802\n", "1094 <-> 536\n", "1095 <-> 1095, 1204\n", "1096 <-> 279\n", "1097 <-> 351, 381\n", "1098 <-> 757, 1519\n", "1099 <-> 1099, 1752\n", "1100 <-> 177, 890\n", "1101 <-> 1145\n", "1102 <-> 1280\n", "1103 <-> 190, 1200\n", "1104 <-> 629\n", "1105 <-> 100, 934\n", "1106 <-> 1426\n", "1107 <-> 78, 1497\n", "1108 <-> 842\n", "1109 <-> 507, 904, 1109\n", "1110 <-> 750\n", "1111 <-> 866\n", "1112 <-> 851\n", "1113 <-> 1113\n", "1114 <-> 866, 1131, 1861\n", "1115 <-> 1187, 1629\n", "1116 <-> 342\n", "1117 <-> 754\n", "1118 <-> 1637\n", "1119 <-> 739\n", "1120 <-> 1837\n", "1121 <-> 1133, 1758\n", "1122 <-> 577, 1072, 1349\n", "1123 <-> 1359\n", "1124 <-> 1174\n", "1125 <-> 1038, 1789\n", "1126 <-> 1260\n", "1127 <-> 1213\n", "1128 <-> 161, 652\n", "1129 <-> 441\n", "1130 <-> 4\n", "1131 <-> 1114\n", "1132 <-> 1132, 1979\n", "1133 <-> 1054, 1121, 1253\n", "1134 <-> 817\n", "1135 <-> 76, 1606\n", "1136 <-> 765, 777, 1860\n", "1137 <-> 434\n", "1138 <-> 865, 1280, 1471, 1736\n", "1139 <-> 74, 907\n", "1140 <-> 108, 378\n", "1141 <-> 178\n", "1142 <-> 655, 717\n", "1143 <-> 446\n", "1144 <-> 221\n", "1145 <-> 476, 705, 1101, 1271, 1956\n", "1146 <-> 474, 1179, 1936\n", "1147 <-> 920, 1147\n", "1148 <-> 1148, 1795\n", "1149 <-> 862, 1799\n", "1150 <-> 559, 684, 1797\n", "1151 <-> 951\n", "1152 <-> 1229\n", "1153 <-> 1515, 1530\n", "1154 <-> 1154\n", "1155 <-> 1019, 1300\n", "1156 <-> 164, 1051, 1156\n", "1157 <-> 18, 1157\n", "1158 <-> 1208\n", "1159 <-> 1651\n", "1160 <-> 567, 1510, 1710\n", "1161 <-> 1161, 1427, 1590\n", "1162 <-> 206, 229, 1561\n", "1163 <-> 1388\n", "1164 <-> 741, 1494\n", "1165 <-> 1217\n", "1166 <-> 123, 276\n", "1167 <-> 1262, 1547\n", "1168 <-> 80, 531, 696\n", "1169 <-> 362, 757, 1504\n", "1170 <-> 1854\n", "1171 <-> 1171, 1898\n", "1172 <-> 832\n", "1173 <-> 1173, 1315\n", "1174 <-> 1124, 1174, 1831\n", "1175 <-> 202, 452\n", "1176 <-> 330, 335, 1761\n", "1177 <-> 917\n", "1178 <-> 155, 567\n", "1179 <-> 224, 1146\n", "1180 <-> 907, 1661\n", "1181 <-> 1012\n", "1182 <-> 176\n", "1183 <-> 690, 722, 788\n", "1184 <-> 645\n", "1185 <-> 487\n", "1186 <-> 1659\n", "1187 <-> 348, 1115, 1670\n", "1188 <-> 275, 803\n", "1189 <-> 1689\n", "1190 <-> 75, 1089\n", "1191 <-> 285\n", "1192 <-> 1744\n", "1193 <-> 477, 515, 841\n", "1194 <-> 1308\n", "1195 <-> 761, 849\n", "1196 <-> 130, 1993\n", "1197 <-> 144\n", "1198 <-> 613, 964, 1329\n", "1199 <-> 1389\n", "1200 <-> 1103\n", "1201 <-> 923, 936, 1052\n", "1202 <-> 875\n", "1203 <-> 490, 902, 1692\n", "1204 <-> 718, 1095, 1245\n", "1205 <-> 263, 333, 877\n", "1206 <-> 1311\n", "1207 <-> 415, 1883\n", "1208 <-> 445, 1158\n", "1209 <-> 550, 1640\n", "1210 <-> 12, 1210, 1428\n", "1211 <-> 460, 1529\n", "1212 <-> 52, 159, 1493, 1819\n", "1213 <-> 1127, 1213\n", "1214 <-> 1214, 1436\n", "1215 <-> 266, 1758\n", "1216 <-> 729, 739\n", "1217 <-> 141, 749, 1165, 1315\n", "1218 <-> 599, 1595\n", "1219 <-> 740, 1549\n", "1220 <-> 588, 1374\n", "1221 <-> 405\n", "1222 <-> 1966\n", "1223 <-> 119\n", "1224 <-> 1528\n", "1225 <-> 1314\n", "1226 <-> 86, 515\n", "1227 <-> 1681\n", "1228 <-> 1228\n", "1229 <-> 0, 1152, 1374\n", "1230 <-> 1453\n", "1231 <-> 223, 488\n", "1232 <-> 1045, 1261\n", "1233 <-> 1759\n", "1234 <-> 360\n", "1235 <-> 283, 955, 1241, 1783\n", "1236 <-> 1356\n", "1237 <-> 600, 885, 931, 1073\n", "1238 <-> 370, 1602\n", "1239 <-> 546, 1373\n", "1240 <-> 994\n", "1241 <-> 1235, 1392\n", "1242 <-> 7, 59, 821, 1945\n", "1243 <-> 1296\n", "1244 <-> 7, 1300, 1434\n", "1245 <-> 1204, 1347\n", "1246 <-> 374, 555, 1508\n", "1247 <-> 109, 936\n", "1248 <-> 785, 1715\n", "1249 <-> 238\n", "1250 <-> 1600, 1623\n", "1251 <-> 1251\n", "1252 <-> 858\n", "1253 <-> 392, 1133\n", "1254 <-> 35, 1394\n", "1255 <-> 575\n", "1256 <-> 214, 1607, 1685\n", "1257 <-> 169\n", "1258 <-> 81, 1264, 1320\n", "1259 <-> 811, 1425\n", "1260 <-> 830, 1126\n", "1261 <-> 571, 1232\n", "1262 <-> 1167, 1862\n", "1263 <-> 540, 991\n", "1264 <-> 1258, 1651\n", "1265 <-> 139, 1569\n", "1266 <-> 708\n", "1267 <-> 1267\n", "1268 <-> 721\n", "1269 <-> 276, 676, 1759\n", "1270 <-> 467, 1270, 1916\n", "1271 <-> 225, 922, 1145, 1700\n", "1272 <-> 99\n", "1273 <-> 1302\n", "1274 <-> 1966\n", "1275 <-> 525\n", "1276 <-> 791, 1834\n", "1277 <-> 450, 1474, 1645\n", "1278 <-> 185, 961\n", "1279 <-> 458, 926\n", "1280 <-> 209, 1102, 1138\n", "1281 <-> 208, 462, 1943\n", "1282 <-> 694, 1522\n", "1283 <-> 111, 119, 1407\n", "1284 <-> 182, 1996\n", "1285 <-> 287\n", "1286 <-> 647, 1286, 1715\n", "1287 <-> 132\n", "1288 <-> 222, 1021, 1398\n", "1289 <-> 724\n", "1290 <-> 208, 260, 317\n", "1291 <-> 1498\n", "1292 <-> 88\n", "1293 <-> 387, 715, 1322, 1519, 1645\n", "1294 <-> 445, 513, 1504\n", "1295 <-> 766\n", "1296 <-> 1243, 1379, 1964\n", "1297 <-> 38, 1669\n", "1298 <-> 1906\n", "1299 <-> 18, 1804\n", "1300 <-> 1155, 1244\n", "1301 <-> 1371, 1453\n", "1302 <-> 991, 1273\n", "1303 <-> 375, 504, 1948\n", "1304 <-> 1667, 1933\n", "1305 <-> 102, 151, 665\n", "1306 <-> 266\n", "1307 <-> 179\n", "1308 <-> 34, 1194\n", "1309 <-> 563\n", "1310 <-> 526, 789\n", "1311 <-> 1206, 1311, 1769\n", "1312 <-> 891, 1044\n", "1313 <-> 169\n", "1314 <-> 151, 1225\n", "1315 <-> 42, 1173, 1217\n", "1316 <-> 1316\n", "1317 <-> 932, 1805\n", "1318 <-> 187, 373, 982\n", "1319 <-> 41, 220, 1948\n", "1320 <-> 1258, 1859\n", "1321 <-> 651\n", "1322 <-> 1293\n", "1323 <-> 957, 1472\n", "1324 <-> 1324\n", "1325 <-> 1325\n", "1326 <-> 803, 1846\n", "1327 <-> 753\n", "1328 <-> 1879\n", "1329 <-> 1198\n", "1330 <-> 553, 1330\n", "1331 <-> 392, 851\n", "1332 <-> 396, 831\n", "1333 <-> 210\n", "1334 <-> 892\n", "1335 <-> 838, 1552, 1568\n", "1336 <-> 1336\n", "1337 <-> 1059\n", "1338 <-> 310, 544\n", "1339 <-> 1897\n", "1340 <-> 945\n", "1341 <-> 489\n", "1342 <-> 137, 1054\n", "1343 <-> 1343\n", "1344 <-> 1946\n", "1345 <-> 1345\n", "1346 <-> 652\n", "1347 <-> 1245, 1914, 1930\n", "1348 <-> 787, 1591\n", "1349 <-> 669, 1122\n", "1350 <-> 304, 1790\n", "1351 <-> 587, 1997\n", "1352 <-> 20, 614\n", "1353 <-> 1738\n", "1354 <-> 413, 1608\n", "1355 <-> 522, 1816, 1917\n", "1356 <-> 1236, 1450\n", "1357 <-> 431, 1575\n", "1358 <-> 500\n", "1359 <-> 1123, 1599\n", "1360 <-> 1370, 1385\n", "1361 <-> 1, 881\n", "1362 <-> 355, 1611, 1952\n", "1363 <-> 69\n", "1364 <-> 954\n", "1365 <-> 1948\n", "1366 <-> 30, 1470\n", "1367 <-> 1527\n", "1368 <-> 724\n", "1369 <-> 277, 1482\n", "1370 <-> 1360\n", "1371 <-> 642, 1301, 1478, 1485\n", "1372 <-> 1372, 1594\n", "1373 <-> 1239\n", "1374 <-> 79, 1220, 1229\n", "1375 <-> 764, 771, 1023\n", "1376 <-> 952\n", "1377 <-> 938, 1520, 1730\n", "1378 <-> 1378, 1411, 1823\n", "1379 <-> 1296, 1832\n", "1380 <-> 1380\n", "1381 <-> 673\n", "1382 <-> 1382\n", "1383 <-> 195, 586\n", "1384 <-> 542\n", "1385 <-> 215, 1360\n", "1386 <-> 1386\n", "1387 <-> 1536\n", "1388 <-> 311, 402, 1163\n", "1389 <-> 251, 1199\n", "1390 <-> 322, 975\n", "1391 <-> 172, 407, 1453\n", "1392 <-> 1241, 1587\n", "1393 <-> 419, 823, 1636\n", "1394 <-> 1254, 1588, 1699\n", "1395 <-> 401, 1621\n", "1396 <-> 1396, 1870\n", "1397 <-> 1629\n", "1398 <-> 840, 1288\n", "1399 <-> 1399, 1932\n", "1400 <-> 721\n", "1401 <-> 1059\n", "1402 <-> 1402\n", "1403 <-> 33\n", "1404 <-> 1449, 1632, 1832\n", "1405 <-> 1634\n", "1406 <-> 1726\n", "1407 <-> 265, 1283, 1999\n", "1408 <-> 39, 336, 426\n", "1409 <-> 75, 147, 654\n", "1410 <-> 691, 1780\n", "1411 <-> 1378\n", "1412 <-> 1447, 1759\n", "1413 <-> 616, 691\n", "1414 <-> 843\n", "1415 <-> 1415\n", "1416 <-> 197, 271\n", "1417 <-> 132, 960, 1028\n", "1418 <-> 1418, 1426\n", "1419 <-> 918, 1560\n", "1420 <-> 789\n", "1421 <-> 629, 715\n", "1422 <-> 391, 640\n", "1423 <-> 781, 1057\n", "1424 <-> 1614\n", "1425 <-> 21, 896, 1259\n", "1426 <-> 1106, 1418\n", "1427 <-> 1161\n", "1428 <-> 1210, 1677\n", "1429 <-> 131\n", "1430 <-> 1822\n", "1431 <-> 907, 1085, 1846\n", "1432 <-> 817, 847\n", "1433 <-> 75\n", "1434 <-> 1244\n", "1435 <-> 484, 808\n", "1436 <-> 1214\n", "1437 <-> 418\n", "1438 <-> 57\n", "1439 <-> 1469, 1824\n", "1440 <-> 237\n", "1441 <-> 1722\n", "1442 <-> 424, 1678\n", "1443 <-> 144\n", "1444 <-> 579, 643, 1869\n", "1445 <-> 914\n", "1446 <-> 1524, 1728\n", "1447 <-> 1412, 1962\n", "1448 <-> 1485\n", "1449 <-> 1404\n", "1450 <-> 1356, 1647\n", "1451 <-> 460, 1907, 1967\n", "1452 <-> 445, 446\n", "1453 <-> 56, 133, 638, 1230, 1301, 1391\n", "1454 <-> 1994\n", "1455 <-> 788\n", "1456 <-> 1914\n", "1457 <-> 769\n", "1458 <-> 1458\n", "1459 <-> 700, 1796\n", "1460 <-> 1799\n", "1461 <-> 15, 436\n", "1462 <-> 1678\n", "1463 <-> 83, 1553, 1684\n", "1464 <-> 35\n", "1465 <-> 1471\n", "1466 <-> 175, 430\n", "1467 <-> 539, 702\n", "1468 <-> 281, 911, 1475\n", "1469 <-> 366, 426, 478, 1439, 1524\n", "1470 <-> 833, 1366\n", "1471 <-> 971, 1138, 1465\n", "1472 <-> 560, 858, 1323, 1937\n", "1473 <-> 506, 875\n", "1474 <-> 1277, 1937\n", "1475 <-> 701, 1468\n", "1476 <-> 464, 522\n", "1477 <-> 1785\n", "1478 <-> 989, 1371\n", "1479 <-> 409, 851\n", "1480 <-> 1677\n", "1481 <-> 463\n", "1482 <-> 517, 1369, 1482\n", "1483 <-> 102, 218\n", "1484 <-> 532, 1531, 1735\n", "1485 <-> 400, 1371, 1448\n", "1486 <-> 453\n", "1487 <-> 867, 870, 1577, 1584\n", "1488 <-> 1488\n", "1489 <-> 16, 327\n", "1490 <-> 418\n", "1491 <-> 7, 1589\n", "1492 <-> 823, 1090\n", "1493 <-> 1212, 1519, 1675\n", "1494 <-> 775, 889, 1164\n", "1495 <-> 882, 911\n", "1496 <-> 386, 1496\n", "1497 <-> 269, 455, 1107\n", "1498 <-> 9, 1291, 1758\n", "1499 <-> 1685, 1893\n", "1500 <-> 1657\n", "1501 <-> 244, 287\n", "1502 <-> 1951\n", "1503 <-> 112\n", "1504 <-> 1169, 1294\n", "1505 <-> 1987\n", "1506 <-> 845, 1905\n", "1507 <-> 1507\n", "1508 <-> 1246\n", "1509 <-> 41\n", "1510 <-> 195, 789, 1160, 1980\n", "1511 <-> 658, 1017\n", "1512 <-> 1990\n", "1513 <-> 968, 1513, 1612\n", "1514 <-> 1514\n", "1515 <-> 1153, 1632\n", "1516 <-> 280\n", "1517 <-> 759\n", "1518 <-> 1837\n", "1519 <-> 80, 82, 1098, 1293, 1493\n", "1520 <-> 1377, 1978\n", "1521 <-> 1521\n", "1522 <-> 1282\n", "1523 <-> 1749, 1876\n", "1524 <-> 660, 1446, 1469, 1535, 1729\n", "1525 <-> 283, 713\n", "1526 <-> 22, 1767\n", "1527 <-> 535, 1367, 1889\n", "1528 <-> 996, 1224\n", "1529 <-> 1211, 1736\n", "1530 <-> 1153\n", "1531 <-> 451, 670, 1484\n", "1532 <-> 46\n", "1533 <-> 62, 143, 530\n", "1534 <-> 117, 1992\n", "1535 <-> 1524\n", "1536 <-> 342, 1387\n", "1537 <-> 1054\n", "1538 <-> 302, 1589\n", "1539 <-> 576, 920\n", "1540 <-> 668, 731\n", "1541 <-> 1639\n", "1542 <-> 1542\n", "1543 <-> 1702\n", "1544 <-> 1927\n", "1545 <-> 995\n", "1546 <-> 92, 1890\n", "1547 <-> 40, 1167\n", "1548 <-> 796\n", "1549 <-> 110, 337, 1219\n", "1550 <-> 46, 667\n", "1551 <-> 497, 850\n", "1552 <-> 526, 1335\n", "1553 <-> 464, 635, 1463\n", "1554 <-> 580, 1696\n", "1555 <-> 1556, 1648, 1867\n", "1556 <-> 180, 1555, 1676\n", "1557 <-> 313, 1831\n", "1558 <-> 249\n", "1559 <-> 501\n", "1560 <-> 1419\n", "1561 <-> 1162\n", "1562 <-> 271, 388\n", "1563 <-> 597, 907\n", "1564 <-> 239\n", "1565 <-> 906, 1854\n", "1566 <-> 465\n", "1567 <-> 393, 619\n", "1568 <-> 1335, 1745\n", "1569 <-> 658, 1265, 1651\n", "1570 <-> 475\n", "1571 <-> 310, 323, 609\n", "1572 <-> 540, 716\n", "1573 <-> 738\n", "1574 <-> 531\n", "1575 <-> 597, 818, 1357\n", "1576 <-> 937\n", "1577 <-> 456, 1487, 1630\n", "1578 <-> 1006, 1035\n", "1579 <-> 1704\n", "1580 <-> 827\n", "1581 <-> 286, 703, 1888\n", "1582 <-> 294\n", "1583 <-> 1907\n", "1584 <-> 1487\n", "1585 <-> 1955\n", "1586 <-> 1586, 1641\n", "1587 <-> 1392\n", "1588 <-> 522, 1394\n", "1589 <-> 1491, 1538, 1589\n", "1590 <-> 1161, 1642, 1946\n", "1591 <-> 4, 617, 1348\n", "1592 <-> 68\n", "1593 <-> 356, 466\n", "1594 <-> 826, 1014, 1372\n", "1595 <-> 1218\n", "1596 <-> 78\n", "1597 <-> 640\n", "1598 <-> 422\n", "1599 <-> 1039, 1359\n", "1600 <-> 1250\n", "1601 <-> 113, 1631\n", "1602 <-> 1238\n", "1603 <-> 1603\n", "1604 <-> 1604\n", "1605 <-> 1980\n", "1606 <-> 1135, 1828\n", "1607 <-> 1256, 1607\n", "1608 <-> 1354\n", "1609 <-> 980, 1864\n", "1610 <-> 1610\n", "1611 <-> 583, 1362\n", "1612 <-> 309, 367, 1513\n", "1613 <-> 270, 1620\n", "1614 <-> 1424, 1688\n", "1615 <-> 1615\n", "1616 <-> 1884\n", "1617 <-> 806, 1763\n", "1618 <-> 955, 994, 1897\n", "1619 <-> 1622\n", "1620 <-> 538, 584, 1613\n", "1621 <-> 1395, 1621\n", "1622 <-> 452, 1619\n", "1623 <-> 188, 1250\n", "1624 <-> 148\n", "1625 <-> 519, 618, 1625, 1765\n", "1626 <-> 213, 1001\n", "1627 <-> 1929\n", "1628 <-> 6, 305\n", "1629 <-> 558, 1115, 1397\n", "1630 <-> 1577\n", "1631 <-> 779, 1601\n", "1632 <-> 1404, 1515\n", "1633 <-> 336\n", "1634 <-> 762, 1405, 1734\n", "1635 <-> 1635\n", "1636 <-> 257, 649, 1393\n", "1637 <-> 167, 329, 1118\n", "1638 <-> 939, 1082\n", "1639 <-> 1541, 1639\n", "1640 <-> 1209\n", "1641 <-> 1586\n", "1642 <-> 567, 1590\n", "1643 <-> 982\n", "1644 <-> 408, 509\n", "1645 <-> 1277, 1293\n", "1646 <-> 1836, 1875\n", "1647 <-> 1450, 1772\n", "1648 <-> 1555, 1946\n", "1649 <-> 1743\n", "1650 <-> 627, 1720\n", "1651 <-> 1159, 1264, 1569\n", "1652 <-> 852, 1930\n", "1653 <-> 1653\n", "1654 <-> 677\n", "1655 <-> 85, 733\n", "1656 <-> 1875\n", "1657 <-> 261, 1500, 1703\n", "1658 <-> 693, 1679\n", "1659 <-> 1186, 1659\n", "1660 <-> 673, 1061\n", "1661 <-> 662, 1180\n", "1662 <-> 483\n", "1663 <-> 1663, 1904\n", "1664 <-> 196, 950, 1664\n", "1665 <-> 144, 854, 941\n", "1666 <-> 1666\n", "1667 <-> 1304, 1890\n", "1668 <-> 488\n", "1669 <-> 1297\n", "1670 <-> 78, 1187\n", "1671 <-> 215, 981\n", "1672 <-> 145, 358, 719, 1056\n", "1673 <-> 1673\n", "1674 <-> 25, 935, 1091\n", "1675 <-> 1493\n", "1676 <-> 190, 1556\n", "1677 <-> 1428, 1480\n", "1678 <-> 1442, 1462, 1987\n", "1679 <-> 577, 1658\n", "1680 <-> 16, 1076\n", "1681 <-> 1001, 1227\n", "1682 <-> 71\n", "1683 <-> 90\n", "1684 <-> 479, 1463, 1852\n", "1685 <-> 1256, 1499\n", "1686 <-> 94\n", "1687 <-> 687, 978, 1787\n", "1688 <-> 332, 1614, 1688\n", "1689 <-> 758, 1189, 1779\n", "1690 <-> 477\n", "1691 <-> 1691, 1986\n", "1692 <-> 166, 585, 813, 913, 1203, 1913\n", "1693 <-> 671\n", "1694 <-> 1711\n", "1695 <-> 89, 1795\n", "1696 <-> 1554\n", "1697 <-> 147, 843, 1900\n", "1698 <-> 212, 444, 1793\n", "1699 <-> 676, 868, 1394, 1705\n", "1700 <-> 87, 1271\n", "1701 <-> 849\n", "1702 <-> 222, 692, 1543\n", "1703 <-> 839, 1657\n", "1704 <-> 314, 498, 1579\n", "1705 <-> 1699\n", "1706 <-> 89, 1993\n", "1707 <-> 1990, 1994\n", "1708 <-> 1054, 1892\n", "1709 <-> 861, 886\n", "1710 <-> 1160\n", "1711 <-> 1694, 1737\n", "1712 <-> 1712\n", "1713 <-> 714, 1935\n", "1714 <-> 600\n", "1715 <-> 217, 1248, 1286\n", "1716 <-> 808\n", "1717 <-> 278, 1914\n", "1718 <-> 580\n", "1719 <-> 669\n", "1720 <-> 1650, 1762, 1856\n", "1721 <-> 422, 1918\n", "1722 <-> 1441, 1722\n", "1723 <-> 893, 1915\n", "1724 <-> 508, 750, 955\n", "1725 <-> 1725\n", "1726 <-> 1406, 1959\n", "1727 <-> 1797\n", "1728 <-> 14, 1446\n", "1729 <-> 1524\n", "1730 <-> 1377, 1737\n", "1731 <-> 104, 749\n", "1732 <-> 129, 1908\n", "1733 <-> 174, 655, 938\n", "1734 <-> 816, 1634, 1734\n", "1735 <-> 538, 1484\n", "1736 <-> 0, 1138, 1529\n", "1737 <-> 1711, 1730\n", "1738 <-> 26, 1353, 1757\n", "1739 <-> 302, 1080\n", "1740 <-> 118, 257\n", "1741 <-> 152, 219, 876\n", "1742 <-> 1841, 1945\n", "1743 <-> 333, 1649\n", "1744 <-> 659, 743, 856, 1192\n", "1745 <-> 1568\n", "1746 <-> 1746\n", "1747 <-> 579, 1048\n", "1748 <-> 283\n", "1749 <-> 189, 350, 1523, 1848, 1894\n", "1750 <-> 881\n", "1751 <-> 344\n", "1752 <-> 1099\n", "1753 <-> 1753\n", "1754 <-> 1011\n", "1755 <-> 1755, 1939\n", "1756 <-> 933\n", "1757 <-> 1738\n", "1758 <-> 1121, 1215, 1498\n", "1759 <-> 1233, 1269, 1412\n", "1760 <-> 198, 679, 840\n", "1761 <-> 1176\n", "1762 <-> 713, 1720\n", "1763 <-> 1617\n", "1764 <-> 613\n", "1765 <-> 1625\n", "1766 <-> 99\n", "1767 <-> 623, 751, 1526\n", "1768 <-> 82\n", "1769 <-> 1311, 1921\n", "1770 <-> 565, 1995\n", "1771 <-> 77, 1771\n", "1772 <-> 805, 1647, 1772\n", "1773 <-> 1773, 1826\n", "1774 <-> 303\n", "1775 <-> 239, 259\n", "1776 <-> 225\n", "1777 <-> 393\n", "1778 <-> 482, 699, 709, 1054\n", "1779 <-> 264, 1689\n", "1780 <-> 61, 194, 707, 1005, 1410, 1999\n", "1781 <-> 165, 1060, 1978\n", "1782 <-> 264\n", "1783 <-> 897, 1235, 1845\n", "1784 <-> 1784\n", "1785 <-> 1477, 1915\n", "1786 <-> 1055\n", "1787 <-> 1057, 1687, 1899\n", "1788 <-> 498, 937, 1859\n", "1789 <-> 1075, 1125\n", "1790 <-> 646, 1350\n", "1791 <-> 617\n", "1792 <-> 1855\n", "1793 <-> 1698\n", "1794 <-> 958\n", "1795 <-> 1148, 1695\n", "1796 <-> 779, 1459, 1857\n", "1797 <-> 1150, 1727\n", "1798 <-> 500\n", "1799 <-> 795, 1149, 1460\n", "1800 <-> 368, 1800\n", "1801 <-> 220\n", "1802 <-> 99, 1093\n", "1803 <-> 1810\n", "1804 <-> 1299\n", "1805 <-> 292, 527, 1317\n", "1806 <-> 443, 1865\n", "1807 <-> 795, 1911\n", "1808 <-> 940\n", "1809 <-> 122, 595\n", "1810 <-> 345, 1803\n", "1811 <-> 1980\n", "1812 <-> 892\n", "1813 <-> 421, 606\n", "1814 <-> 612, 780\n", "1815 <-> 656, 884\n", "1816 <-> 925, 1355\n", "1817 <-> 635, 666\n", "1818 <-> 29, 206\n", "1819 <-> 1212\n", "1820 <-> 1874\n", "1821 <-> 227, 967\n", "1822 <-> 736, 739, 1430\n", "1823 <-> 1378\n", "1824 <-> 68, 1439\n", "1825 <-> 700\n", "1826 <-> 557, 1773\n", "1827 <-> 98, 1971\n", "1828 <-> 1606, 1865\n", "1829 <-> 449\n", "1830 <-> 1830\n", "1831 <-> 20, 878, 1174, 1557\n", "1832 <-> 1379, 1404, 1832\n", "1833 <-> 107\n", "1834 <-> 423, 560, 1276\n", "1835 <-> 867\n", "1836 <-> 118, 1646\n", "1837 <-> 47, 1120, 1518\n", "1838 <-> 243, 990\n", "1839 <-> 1839\n", "1840 <-> 478\n", "1841 <-> 1742\n", "1842 <-> 565\n", "1843 <-> 594, 747, 859\n", "1844 <-> 461\n", "1845 <-> 1783\n", "1846 <-> 1326, 1431\n", "1847 <-> 633, 1888\n", "1848 <-> 1749\n", "1849 <-> 24, 48, 292, 1851\n", "1850 <-> 440, 782\n", "1851 <-> 1849\n", "1852 <-> 1684\n", "1853 <-> 1853\n", "1854 <-> 557, 1170, 1565\n", "1855 <-> 70, 1792\n", "1856 <-> 1720\n", "1857 <-> 1796\n", "1858 <-> 417\n", "1859 <-> 1320, 1788\n", "1860 <-> 36, 879, 1136\n", "1861 <-> 830, 1114\n", "1862 <-> 416, 1262\n", "1863 <-> 28, 769, 787, 1062\n", "1864 <-> 1609, 1920, 1953\n", "1865 <-> 189, 1806, 1828, 1969\n", "1866 <-> 451\n", "1867 <-> 1555\n", "1868 <-> 1868\n", "1869 <-> 1444\n", "1870 <-> 1396\n", "1871 <-> 1939\n", "1872 <-> 1914\n", "1873 <-> 694, 1043\n", "1874 <-> 241, 877, 1820\n", "1875 <-> 1646, 1656\n", "1876 <-> 1523\n", "1877 <-> 1877\n", "1878 <-> 159, 688, 907\n", "1879 <-> 1328, 1879\n", "1880 <-> 415\n", "1881 <-> 65\n", "1882 <-> 201\n", "1883 <-> 812, 1207\n", "1884 <-> 731, 861, 1071, 1616\n", "1885 <-> 753, 1885\n", "1886 <-> 75\n", "1887 <-> 766, 807\n", "1888 <-> 240, 1581, 1847\n", "1889 <-> 800, 1527\n", "1890 <-> 1546, 1667\n", "1891 <-> 186, 548\n", "1892 <-> 1708\n", "1893 <-> 1499\n", "1894 <-> 475, 843, 1749\n", "1895 <-> 622, 1895, 1978\n", "1896 <-> 334\n", "1897 <-> 1339, 1618, 1949\n", "1898 <-> 1171\n", "1899 <-> 1787\n", "1900 <-> 1069, 1697\n", "1901 <-> 142\n", "1902 <-> 291, 305\n", "1903 <-> 745\n", "1904 <-> 1663\n", "1905 <-> 829, 1506\n", "1906 <-> 316, 767, 1298, 1999\n", "1907 <-> 183, 1451, 1583\n", "1908 <-> 908, 1732\n", "1909 <-> 62\n", "1910 <-> 1999\n", "1911 <-> 364, 1807\n", "1912 <-> 372, 1912\n", "1913 <-> 161, 601, 1692\n", "1914 <-> 1347, 1456, 1717, 1872\n", "1915 <-> 760, 1723, 1785\n", "1916 <-> 1270\n", "1917 <-> 1355\n", "1918 <-> 1721\n", "1919 <-> 590, 1010\n", "1920 <-> 414, 1864\n", "1921 <-> 1769\n", "1922 <-> 232\n", "1923 <-> 238, 271, 1923\n", "1924 <-> 571, 917\n", "1925 <-> 556, 1925\n", "1926 <-> 129, 581\n", "1927 <-> 360, 1544\n", "1928 <-> 289\n", "1929 <-> 1627, 1929\n", "1930 <-> 181, 1347, 1652\n", "1931 <-> 469, 1931\n", "1932 <-> 1399\n", "1933 <-> 919, 1304\n", "1934 <-> 290\n", "1935 <-> 803, 892, 903, 1713\n", "1936 <-> 1146\n", "1937 <-> 146, 1472, 1474\n", "1938 <-> 149\n", "1939 <-> 88, 1755, 1871\n", "1940 <-> 980\n", "1941 <-> 548, 828\n", "1942 <-> 613, 988\n", "1943 <-> 1281\n", "1944 <-> 239, 326, 530\n", "1945 <-> 49, 1242, 1742\n", "1946 <-> 1344, 1590, 1648\n", "1947 <-> 1050\n", "1948 <-> 607, 1303, 1319, 1365\n", "1949 <-> 1897\n", "1950 <-> 1950\n", "1951 <-> 553, 921, 1502\n", "1952 <-> 163, 1362\n", "1953 <-> 1864\n", "1954 <-> 495, 620\n", "1955 <-> 735, 1585\n", "1956 <-> 11, 1145\n", "1957 <-> 941\n", "1958 <-> 398, 668\n", "1959 <-> 340, 1726\n", "1960 <-> 934\n", "1961 <-> 641\n", "1962 <-> 1447\n", "1963 <-> 112, 1050\n", "1964 <-> 1296\n", "1965 <-> 61\n", "1966 <-> 890, 1222, 1274\n", "1967 <-> 545, 550, 729, 1451\n", "1968 <-> 873\n", "1969 <-> 704, 1865\n", "1970 <-> 393\n", "1971 <-> 1827\n", "1972 <-> 326, 958\n", "1973 <-> 1086, 1973\n", "1974 <-> 319, 1974\n", "1975 <-> 452\n", "1976 <-> 155\n", "1977 <-> 410\n", "1978 <-> 1520, 1781, 1895\n", "1979 <-> 1132\n", "1980 <-> 1510, 1605, 1811\n", "1981 <-> 184\n", "1982 <-> 39\n", "1983 <-> 1983\n", "1984 <-> 379, 494\n", "1985 <-> 95\n", "1986 <-> 1691\n", "1987 <-> 1505, 1678\n", "1988 <-> 124, 516, 784\n", "1989 <-> 322\n", "1990 <-> 1512, 1707\n", "1991 <-> 226\n", "1992 <-> 894, 1534\n", "1993 <-> 1196, 1706\n", "1994 <-> 16, 1454, 1707\n", "1995 <-> 682, 1770\n", "1996 <-> 1284\n", "1997 <-> 153, 308, 1351\n", "1998 <-> 5, 235, 428, 524\n", "1999 <-> 1407, 1780, 1906, 1910\"\"\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "test_input = \"\"\"0 <-> 2\n", "1 <-> 1\n", "2 <-> 0, 3, 4\n", "3 <-> 2, 4\n", "4 <-> 2, 3, 6\n", "5 <-> 6\n", "6 <-> 4, 5\"\"\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def make_children(input):\n", " children = {}\n", " for row in input.split(\"\\n\"):\n", " left, right = row.split(' <-> ')\n", " children[left] = right.split(', ')\n", " return children" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "children = make_children(test_input)\n", "children" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def make_tree(start, children):\n", " finished = False\n", " current = 0\n", " group = [start]\n", " while True:\n", " for child in children[group[current]]:\n", " if child not in group:\n", " group.append(child)\n", " current += 1\n", " if current >= len(group):\n", " break\n", " return group" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "group = make_tree('0', children)\n", "group" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "len(group)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "children = make_children(input)\n", "group = make_tree('0', children)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "len(group)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## how many groups? " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "len(children.keys())" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "groups = []\n", "for start in children.keys():\n", " groups.append(sorted(make_tree(start, children)))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "len(set([\",\".join(group) for group in groups]))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 13 " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "input = \"\"\"0: 3\n", "1: 2\n", "2: 4\n", "4: 4\n", "6: 5\n", "8: 8\n", "10: 6\n", "12: 6\n", "14: 6\n", "16: 6\n", "18: 8\n", "20: 8\n", "22: 12\n", "24: 10\n", "26: 9\n", "28: 8\n", "30: 8\n", "32: 12\n", "34: 12\n", "36: 12\n", "38: 12\n", "40: 8\n", "42: 12\n", "44: 14\n", "46: 14\n", "48: 10\n", "50: 12\n", "52: 12\n", "54: 14\n", "56: 14\n", "58: 14\n", "62: 12\n", "64: 14\n", "66: 14\n", "68: 14\n", "70: 12\n", "74: 14\n", "76: 14\n", "78: 14\n", "80: 18\n", "82: 17\n", "84: 30\n", "88: 14\"\"\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "test_input = \"\"\"0: 3\n", "1: 2\n", "4: 4\n", "6: 4\"\"\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def parse_input(input):\n", " layers = {}\n", " for row in input.split(\"\\n\"):\n", " layer, rng = row.split(': ')\n", " layers[int(layer)] = int(rng)\n", " max_layer = max(list(layers.keys()))\n", " levels = []\n", " for level in range(max_layer + 1):\n", " if level in layers:\n", " levels.append(layers[level])\n", " else:\n", " levels.append(0)\n", " return levels" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "levels = parse_input(test_input)\n", "levels" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def compute_severity(levels, delay=0, debug=False):\n", " severity = 0\n", " t = 0\n", " while t < len(levels):\n", " rng = levels[t]\n", " if rng > 0:\n", " positions = list(range(rng)) + list(reversed(range(1, rng-1)))\n", " pos = positions[(t + delay) % len(positions)]\n", " if debug:\n", " print(t, rng, pos)\n", " if pos == 0:\n", " severity += t * rng\n", " t += 1\n", "\n", " return severity" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "compute_severity(levels)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "levels = parse_input(input)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "compute_severity(levels)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Part 2 " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's set the delay to 10." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def gets_caught(levels, delay=0, debug=False):\n", " t = 0\n", " while t < len(levels):\n", " rng = levels[t]\n", " if rng > 0:\n", " positions = list(range(rng)) + list(reversed(range(1, rng-1)))\n", " pos = positions[(t + delay) % len(positions)]\n", " if debug:\n", " print(t, rng, pos)\n", " if pos == 0:\n", " return True\n", " t += 1\n", " \n", " return False" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "levels = parse_input(test_input)\n", "levels" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "delay = 10" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "gets_caught(levels, 10)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from ipywidgets import interact, fixed" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "interact(gets_caught, levels=fixed(levels), delay=(0, 10), debug=fixed(True))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "delay = 0\n", "while gets_caught(levels, delay):\n", " delay += 1\n", "delay" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "levels = parse_input(input)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "delay = 0\n", "while gets_caught(levels, delay):\n", " delay += 1\n", "delay" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 14" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Restarting this:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from functools import reduce\n", "\n", "def to_ASCII(number_list_as_str):\n", " return list(ord(item) for item in number_list_as_str) + [17, 31, 73, 47, 23]\n", "\n", "def transform_number_list2(number_list, lengths):\n", " current = 0\n", " skip = 0\n", " for _ in range(64):\n", " for length in lengths:\n", " start, stop = current, current + length\n", " if stop < len(number_list):\n", " number_list[current: current + length] = number_list[current: current + length][::-1]\n", " else:\n", " # selecting\n", " stop1 = len(number_list)\n", " stop2 = stop - stop1\n", " selection = number_list[start:stop1] + number_list[:stop2]\n", " # reversing\n", " reversed_selection = selection[::-1]\n", " # modifying list in-place\n", " number_list[start:stop1] = reversed_selection[:stop1 - start]\n", " number_list[:stop2] = reversed_selection[stop1 - start:]\n", " current = (current + length + skip) % len(number_list)\n", " skip += 1\n", " return number_list\n", "\n", "to_hex = lambda sequence: \"\".join([format(item, '02x') for item in sequence])\n", "\n", "def knot_hash(input_str):\n", " sparse_hash = transform_number_list2(list(range(256)), to_ASCII(input_str))\n", " dense_hash = [reduce(lambda x,y: x^y, sparse_hash[16*start:16*start+16]) for start in range(16)]\n", " return to_hex(dense_hash)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "knot_hash(\"AoC 2017\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "knot_hash('')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for i in range(8):\n", " key = \"flqrgnkx-{}\".format(i)\n", " sequence = knot_hash(key)\n", " print(key, sequence)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now converting to bits." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def to_bits(hex_iterable):\n", " \"\"\"Converts list of hex numbers to bits.\"\"\"\n", " return [bin(int(val, 16))[2:].zfill(4) for val in hex_iterable]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for val in '0123456789abcdef':\n", " print(\"\".join(to_bits(val)))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for i in range(8):\n", " key = \"flqrgnkx-{}\".format(i)\n", " sequence = knot_hash(key)\n", " bits = \"\".join(to_bits(sequence))\n", " print(key, bits[:8].replace('1', \"#\").replace('0', '.'))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sequence" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "set(sequence)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's compute the unit test." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "summed = 0\n", "for i in range(128):\n", " key = \"flqrgnkx-{}\".format(i)\n", " sequence = knot_hash(key)\n", " bits = \"\".join(to_bits(sequence))\n", " for bit in bits:\n", " summed += int(bit)\n", "summed" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now the real one:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "summed = 0\n", "for i in range(128):\n", " key = \"jxqlasbh-{}\".format(i)\n", " sequence = knot_hash(key)\n", " bits = \"\".join(to_bits(sequence))\n", " for bit in bits:\n", " summed += int(bit)\n", "summed" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## part 2 " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's build the array and then label it." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "arr = np.empty((128, 128), dtype=np.int)\n", "for i in range(128):\n", " key = \"flqrgnkx-{}\".format(i)\n", " sequence = knot_hash(key)\n", " bits = \"\".join(to_bits(sequence))\n", " arr[i, :] = [int(val) for val in bits]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "arr" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from skimage.morphology import label" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "label(arr, connectivity=1).max()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "arr = np.empty((128, 128), dtype=np.int)\n", "for i in range(128):\n", " key = \"jxqlasbh-{}\".format(i)\n", " sequence = knot_hash(key)\n", " bits = \"\".join(to_bits(sequence))\n", " arr[i, :] = [int(val) for val in bits]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "label(arr, connectivity=1).max()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 15 " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def make_generator(start_value, factor):\n", " current = factor * start_value % 2147483647\n", " yield current\n", " while True:\n", " current = factor * current % 2147483647\n", " yield current" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's see if our computations are correct so far." ] }, { "cell_type": "raw", "metadata": {}, "source": [ "--Gen. A-- --Gen. B--\n", " 1092455 430625591\n", "1181022009 1233683848\n", " 245556042 1431495498\n", "1744312007 137874439\n", "1352636452 285222916" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "genA = make_generator(65, 16807)\n", "genB = make_generator(8921, 48271)\n", "for _ in range(5):\n", " print(next(genA), next(genB))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "to_bin = lambda i: format(i, '016b')[-16:]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "to_bin(1092455)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "genA = make_generator(65, 16807)\n", "genB = make_generator(8921, 48271)\n", "for _ in range(5):\n", " print(to_bin(next(genA)), to_bin(next(genB)), sep='\\n')\n", " print()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "What's the count after 40 million?" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from itertools import islice" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "n = 40000000\n", "total = 0\n", "genA = make_generator(65, 16807)\n", "genB = make_generator(8921, 48271)\n", "for a, b in zip(islice(genA, n), islice(genB, n)):\n", " if to_bin(a) == to_bin(b):\n", " total += 1\n", "total" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now the real input." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "n = 40000000\n", "total = 0\n", "genA = make_generator(289, 16807)\n", "genB = make_generator(629, 48271)\n", "for a, b in zip(islice(genA, n), islice(genB, n)):\n", " if to_bin(a) == to_bin(b):\n", " total += 1\n", "total" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Part 2 " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def make_picky_generator(start_value, factor, mod):\n", " current = start_value\n", " while True:\n", " current = factor * current % 2147483647\n", " while not current % mod == 0:\n", " current = factor * current % 2147483647\n", " yield current" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "genA = make_picky_generator(65, 16807, 4)\n", "genB = make_picky_generator(8921, 48271, 8)\n", "for _ in range(5):\n", " print(next(genA), next(genB))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Unit test." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "n = 5000000\n", "total = 0\n", "genA = make_picky_generator(65, 16807, 4)\n", "genB = make_picky_generator(8921, 48271, 8)\n", "for a, b in zip(islice(genA, n), islice(genB, n)):\n", " if to_bin(a) == to_bin(b):\n", " total += 1\n", "total" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Real test." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "n = 5000000\n", "total = 0\n", "genA = make_picky_generator(289, 16807, 4)\n", "genB = make_picky_generator(629, 48271, 8)\n", "for a, b in zip(islice(genA, n), islice(genB, n)):\n", " if to_bin(a) == to_bin(b):\n", " total += 1\n", "total" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 16 " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "input = \"\"\"x12/6,pk/e,s1,x5/7,s6,x15/4,pn/j,x10/3,s3,x4/9,s11,x10/7,s8,x4/15,pa/p,x5/1,pk/f,x15/3,pd/e,x14/12,s15,x6/8,pp/o,x4/7,pg/d,x5/14,s15,x2/7,pc/i,x0/4,pj/e,x1/2,ph/b,x6/7,pe/l,x9/4,pa/f,x11/6,pn/e,s5,x8/12,pb/a,s7,x13/10,pk/f,x12/1,s14,x2/7,s7,pd/a,x8/15,s9,pp/e,s4,x4/3,po/g,x7/5,s6,x13/4,s10,x11/10,s13,x6/8,pj/m,x4/9,s1,x13/6,pc/k,x4/15,pn/f,x13/12,pl/i,x3/2,pg/k,x6/13,s5,x7/0,s10,x9/12,s15,x13/5,pi/l,x14/8,s6,x12/10,s8,x0/14,s4,x8/11,s15,x15/10,s15,pn/e,x9/0,s9,x10/15,pm/c,x9/2,pa/i,x10/13,s4,x14/9,s13,x6/3,s3,x15/14,s4,x4/11,po/l,s14,x5/0,s8,x11/12,pm/h,x1/3,s4,x10/8,s13,x1/0,s15,x9/7,pd/a,x11/10,pe/l,s6,x2/0,s2,x11/3,s2,x1/2,s4,x14/6,pn/d,x11/9,s6,x0/5,pb/c,x4/12,s10,x15/2,pd/g,x11/9,pj/p,s3,x4/8,pd/a,x0/1,s10,x3/4,pe/g,x10/9,pc/a,x5/13,s13,x14/2,s12,x15/12,s11,x4/11,pj/n,s10,x0/8,s2,x5/2,s10,x0/15,s11,pk/c,x6/1,s8,x11/0,s14,x3/2,s7,x4/10,s8,x1/13,pa/h,s5,x4/5,s3,x10/8,s13,x4/11,s6,x0/3,s5,x13/12,pd/o,x3/1,pp/f,x11/13,s5,x10/6,s4,x1/3,pn/l,x7/4,s15,x9/12,pa/j,x5/3,s1,x15/9,s6,x4/7,pn/k,x15/5,s14,x2/10,s4,x9/5,s3,x2/10,s15,pi/p,x3/11,s2,x10/1,pg/m,x12/2,s13,x8/9,pi/b,x14/10,s1,x9/6,pe/k,x7/4,s10,x15/2,s2,pf/a,x13/14,s11,x15/10,pi/h,x6/2,pa/e,x14/5,s3,x2/7,pj/l,x14/6,pp/h,x13/15,pg/b,s4,pd/e,x8/3,po/k,x15/6,pj/b,x5/3,pk/e,x12/15,s10,x14/1,s9,x0/7,s1,x6/4,s2,pn/g,x8/0,s9,x3/10,s3,x7/2,pl/f,x8/6,pj/p,x4/12,pe/h,s13,x3/13,pk/i,x9/1,s12,x11/5,s11,x1/7,pj/f,x4/2,pi/m,x9/3,s4,x5/8,pd/a,x2/1,pc/f,x9/8,s3,x1/2,pn/o,x0/15,s5,x11/6,pj/l,x4/0,s4,x9/12,s13,x11/13,po/n,x14/6,pa/h,x5/13,s12,pp/j,x15/10,s13,x3/1,s11,x0/6,pi/f,s1,x8/1,pe/c,x7/12,s1,x5/3,s3,x10/0,pb/k,s14,x3/4,s2,x9/15,s12,x3/14,s14,x0/1,s10,x14/9,s6,x12/0,s9,x13/10,ph/c,x11/12,s6,x5/4,s9,pg/k,s11,x1/9,pa/i,x6/3,s14,x4/15,s11,x10/12,s3,x7/5,pn/e,x13/0,pk/h,s6,x2/7,s11,x10/0,pl/d,x3/14,s14,x9/10,s9,x5/0,ph/a,x8/7,s15,x5/13,s5,x8/0,pk/g,x12/13,s5,x15/0,s5,x6/11,s9,x2/5,ph/i,x6/15,s2,x9/7,pa/l,x3/10,s6,x0/8,pn/i,s7,x10/4,s9,x15/13,s11,x3/8,s7,x12/7,s8,x13/5,pg/b,x15/10,s14,pi/n,x1/14,pa/g,x15/0,s7,x14/1,s14,x13/0,pm/n,x9/1,pi/f,x0/6,pe/b,x3/2,pj/a,x10/13,s13,x9/5,pg/m,x11/13,s6,x6/15,s10,po/d,s14,x8/7,s6,x11/3,ph/c,x10/6,s13,x9/14,s4,x7/1,pm/k,x11/13,pl/a,x2/8,ph/f,x7/15,s11,x12/14,s1,x1/5,s14,x10/7,s6,x5/6,pk/l,x1/7,pp/b,s4,x12/3,pc/l,x4/5,pn/g,x1/11,s4,x14/3,s15,x12/13,pi/d,x0/10,s9,x12/5,s2,x9/7,s14,x14/3,s8,x1/15,s15,pb/n,x10/13,pa/j,x3/4,s7,x12/1,s4,x9/11,pm/d,x0/7,s15,x13/1,pe/c,x5/7,s14,x0/12,s14,x5/7,s5,x12/1,pm/h,s3,pl/p,x6/3,pc/f,x15/11,pe/l,x5/12,s13,x13/7,s3,x9/1,s11,x4/5,s6,x11/12,pm/c,x13/1,pn/j,x5/11,pc/i,x15/14,s10,x2/0,ph/m,x15/1,pe/b,x7/8,s4,x14/4,ph/f,x10/11,pp/j,x1/9,pn/a,x0/4,s4,x11/12,s9,pb/d,x8/4,s2,x11/5,s6,x14/0,pk/a,s2,x1/6,pn/i,x9/13,s11,x7/5,pa/k,x0/8,s15,x7/2,s13,x8/10,s14,x9/15,pn/f,x4/6,s3,x13/3,pe/g,x1/4,s13,x10/13,pj/i,x5/6,s10,x0/12,pc/f,x5/1,s7,x7/4,s1,x5/3,s1,x8/1,s2,x12/14,pe/i,x2/13,s1,x1/14,po/f,x6/10,s15,x5/3,pn/j,x9/6,ph/b,x2/14,s7,x8/9,s10,x10/4,pk/g,x11/14,pf/l,x10/13,s13,x6/7,s6,x3/4,pj/h,s7,x1/15,pf/d,x13/3,pn/c,x1/12,s8,x13/2,s10,x9/11,s1,x5/14,s4,x15/11,pl/e,x13/3,s8,x0/6,po/a,x14/7,pe/j,x10/3,pi/k,x8/9,s12,x14/6,s7,x12/9,s15,x7/4,s11,x2/3,pb/a,x8/14,s14,x12/0,s1,x13/1,s7,x3/2,s5,x7/10,pd/f,x8/6,pa/n,x10/9,s5,x5/1,s12,x14/6,s14,x8/9,ph/e,x10/7,s12,x5/9,s10,x8/2,s4,x0/14,s6,pj/n,x9/10,pd/l,s3,x8/2,s13,x0/9,s10,x1/15,pa/n,x12/6,s10,x14/11,pe/g,x8/13,s15,x14/10,s6,x9/12,s8,x5/2,pn/o,s3,x3/15,s4,pg/d,x1/11,pk/i,x14/9,s10,x6/13,s5,x15/2,pp/f,s14,x0/3,s1,x7/1,s10,x3/12,ph/j,x4/10,s15,x2/7,pm/n,x0/1,s4,pp/a,x8/13,s15,x4/3,ph/d,x9/2,pe/f,x4/12,pl/c,x11/10,s8,x8/9,s9,x2/7,s8,x10/9,pd/a,x5/3,pg/j,s4,x15/8,s8,x12/3,s2,x15/14,s12,x6/1,s4,x4/14,pd/h,x13/3,pc/j,x11/9,pf/g,x0/6,s15,x1/7,pe/l,x3/12,pm/k,x14/15,s4,x6/12,s11,pn/p,x7/14,s14,x10/3,pj/a,x4/5,pm/k,s6,x9/6,s9,x11/2,s2,x10/13,s9,x4/14,s2,x5/2,s3,x8/15,s15,x3/5,s5,x10/14,s5,x2/3,pf/p,x11/6,s3,pb/d,x10/9,pn/m,x12/13,s3,po/k,x14/6,pf/n,x2/11,pj/d,x3/13,pp/g,s14,x14/0,s2,x4/7,s8,x2/14,pf/a,x3/12,s4,x5/13,pp/k,x7/6,s6,x12/5,s12,x2/0,pi/o,x6/8,s2,x5/14,s3,x15/10,s13,x3/0,s1,x15/8,s8,pm/l,x5/0,pa/c,s8,po/h,x2/15,pp/e,x4/11,s5,x3/10,s6,x1/9,ph/k,x6/2,s9,x13/11,pl/f,x3/8,s6,x6/0,s4,x13/2,pk/h,x9/5,pp/d,x1/10,pf/c,x3/14,pi/m,x13/9,ph/a,x10/11,s12,x13/6,s1,x14/10,s13,x12/9,pi/g,x4/11,pc/k,s13,x9/14,s15,x3/11,s5,x14/6,pa/f,x1/2,s14,x14/5,s8,x8/6,pd/l,x4/11,s7,x1/15,s3,x14/4,pj/g,x9/5,pd/a,x13/0,s5,po/g,x6/1,pn/p,x13/14,s10,x3/11,pc/f,x8/10,pg/h,x6/12,pf/i,x0/3,po/n,x8/7,s3,x14/11,pe/l,x6/0,pb/j,x11/13,pl/h,s12,x7/6,s13,x5/2,s3,x7/0,s3,x10/11,s4,x1/9,s11,x0/10,s7,x7/6,s9,x5/12,s14,x2/11,s8,x4/15,pi/m,x6/3,pj/l,x13/14,s12,x7/10,pb/d,x15/2,s14,x9/8,s12,x10/15,pe/g,x6/14,pa/c,x10/2,pd/g,x0/6,s1,x9/3,s2,x5/13,s1,x10/15,pc/j,x0/6,s8,x3/9,s11,x8/14,pe/a,x15/7,s14,pc/l,x6/5,pa/i,x2/15,pe/d,x6/1,s4,pc/h,x13/3,pg/d,s13,x5/2,s10,x15/12,pe/c,x8/4,s14,x5/6,s14,ph/p,x10/15,s1,x7/9,pk/o,x3/0,pm/j,x8/10,s7,x14/15,pa/n,x12/5,s4,x11/3,s8,x14/7,s5,ph/b,x2/11,pc/a,x4/14,po/b,x2/13,s2,x3/4,pj/f,s5,x13/7,po/d,x10/1,pe/c,x13/7,pl/m,x14/4,s5,x7/8,pk/g,x2/14,s15,x5/13,s11,po/j,s15,x4/1,pb/g,x15/5,s7,x2/13,s14,pl/i,s11,pc/j,x10/15,s2,x13/4,pi/l,x11/15,s4,x3/14,s9,x11/2,s9,x6/12,s15,x11/14,pe/m,x1/9,s15,x6/7,pl/a,x14/2,s4,x1/13,pk/f,x0/14,s6,pp/n,x7/1,s12,x0/6,s2,x3/10,s5,x11/8,s13,x14/1,s7,x3/6,s6,x14/11,pe/d,s12,pf/b,x3/13,s6,x14/4,pk/g,x10/8,pb/i,x14/6,ph/k,x15/8,s2,x1/7,pb/l,x9/5,s8,x10/13,s8,x11/14,s6,x12/4,s14,x3/14,pp/e,x15/12,s1,x11/7,pk/a,x15/0,s10,x1/8,pb/c,x10/5,s2,x11/1,pl/e,x5/6,pa/o,x12/3,pf/n,s7,x10/14,s15,x9/2,s5,po/j,x10/14,s2,pc/k,x9/11,s10,pp/a,x14/2,pi/e,x3/6,s5,x13/11,s1,x6/3,s15,x8/12,pc/g,x10/11,s14,x7/1,s14,x5/3,s4,x15/14,po/h,x0/7,s11,pd/j,x13/6,s1,x12/9,s12,x4/10,s14,x6/8,s3,x14/10,pe/m,x2/13,pb/f,s15,x6/8,ph/p,x10/15,s4,x8/5,s11,x7/2,s6,x0/9,s7,x2/7,pc/o,x1/13,s3,x12/6,pj/a,x14/8,s10,x10/1,s3,x2/14,s10,x11/9,s1,x10/15,s14,x0/2,pd/l,s13,pj/o,x1/8,pb/d,s8,x2/6,s14,x14/13,po/g,s8,x8/2,s12,x3/15,s8,x14/8,pc/i,x2/4,pm/n,s15,x0/13,pl/i,x3/14,s9,x13/5,s7,pk/h,x9/4,s8,x8/14,s1,x7/9,pn/b,x6/2,pl/h,x10/13,s14,x5/15,s15,x14/2,pd/c,x7/15,s13,x5/13,s8,x1/12,s2,x2/5,pe/o,x12/6,s1,x13/5,s10,x10/11,pn/a,x4/12,s13,x3/5,s6,x2/10,s12,x14/12,pe/h,s9,x8/13,s15,x11/7,s8,x14/1,s11,x9/12,pk/c,x2/10,pe/d,s6,x13/12,s2,x4/2,s14,x0/8,pg/m,x14/5,s11,x15/3,s15,x11/6,s4,x7/13,s14,x15/10,s1,x0/7,s10,x4/12,s7,x13/2,s4,x4/0,pb/a,x6/10,s10,x7/8,s5,pp/c,x13/10,s9,x11/9,s4,x8/6,pd/n,x10/1,s11,x7/5,pg/m,x13/9,s6,pa/f,x0/12,s3,x2/1,pp/l,x12/7,s2,x1/13,pe/c,x5/10,pk/m,x8/3,po/i,s7,x6/14,pb/d,x11/3,po/m,x2/15,ph/c,x5/10,s12,x6/4,s15,x5/7,s5,x0/10,pa/i,x6/7,s12,x15/0,s5,x7/9,s12,pb/p,x0/8,s2,x12/7,pa/c,x5/9,pm/p,x3/8,s12,x1/5,pn/l,x13/4,ph/o,x6/1,s5,x7/11,s1,pm/f,s15,x6/3,pi/c,x14/13,s3,x10/5,pa/b,x7/6,po/j,x11/5,pe/k,x15/1,pd/b,x9/10,pn/h,x3/12,s1,x6/4,s5,x14/11,s3,x0/5,s5,x12/10,s9,x1/6,s13,x14/15,s13,x4/13,pp/m,x7/10,pi/o,x6/2,s12,x9/14,pb/l,x10/5,s4,x9/2,s11,x11/8,pc/d,x4/12,pl/j,x2/3,s4,x1/4,s4,x8/14,po/b,x9/11,s10,x6/12,s1,x13/14,pk/f,x10/7,ph/b,x6/9,pj/c,x12/0,pf/l,s12,x1/7,s4,pg/k,x5/15,s6,x11/2,s4,x13/12,pi/j,x14/4,s11,x13/7,s14,x3/8,s8,x0/2,s1,x10/3,s14,pg/k,x0/5,s12,x12/8,s7,x0/13,po/i,x6/12,s3,x11/8,s15,x7/2,s15,x8/5,s13,x14/0,s15,x11/9,s10,pe/k,x0/1,pm/n,s8,x9/13,s7,x6/4,s3,x3/1,s2,x4/13,s2,x9/14,s11,x2/0,pg/h,x11/9,s13,x0/7,s11,x11/3,pc/p,x10/14,s9,x9/3,ph/g,x14/5,pl/j,x2/8,s11,x5/12,pe/k,x7/2,s3,x10/13,s13,x5/6,pg/a,x10/14,pf/i,x6/7,s10,x5/8,pp/a,x11/3,s11,x7/2,s15,x8/4,ph/n,x9/13,pl/j,x4/5,pa/b,s11,x11/1,s9,x14/6,pk/h,x11/10,s6,pb/l,x14/0,s3,x11/1,s12,x12/7,s14,x3/13,s5,x14/12,s2,x5/6,s1,x3/14,s11,x9/11,pk/m,x0/15,pb/e,x10/12,ph/f,x9/2,s4,pj/a,x4/6,pd/o,x14/10,pe/n,x7/5,s5,x2/1,s3,pg/o,x6/3,s2,x9/13,pk/p,x11/10,s12,x0/13,s3,x11/2,s13,pd/o,x7/8,s1,x14/10,s3,x0/2,s11,x8/13,ph/a,x5/14,s2,x2/4,pk/m,x15/8,s9,x10/6,s14,x9/0,pe/l,s3,x7/3,pc/f,x10/15,pg/p,x5/8,s9,x13/15,pa/f,x7/10,pj/d,x8/4,pc/k,x1/14,s1,x11/2,pd/i,x0/14,s15,x15/5,s14,pa/e,x1/10,s3,x12/0,po/h,x8/6,s7,x9/7,s2,pn/f,x14/12,pd/p,x9/7,s9,x0/14,pa/k,x5/13,s5,x11/2,s14,x12/5,s1,x14/11,pi/e,x0/7,s7,x15/11,pb/g,x13/6,s1,x11/7,s8,x8/3,s4,x11/15,pp/h,x7/14,pj/d,x8/3,s10,x0/15,s5,x7/2,pc/f,x13/3,s11,x2/12,ph/g,x5/9,s2,x12/0,pi/n,x14/10,s12,x0/6,s11,x1/4,s7,x3/13,s4,x11/0,pe/g,x6/3,pf/i,x9/13,pd/o,s12,x4/5,pg/b,x15/2,pe/i,x14/5,pc/o,x6/10,s7,x2/14,s7,x13/1,pi/g,x2/11,pk/m,s1,x1/9,pe/l,x6/4,po/n,x12/0,s2,x11/5,s12,x8/12,s10,x5/1,s2,x8/10,s14,pk/l,s1,pd/c,x7/11,pg/a,x10/13,s6,x6/2,s6,x12/10,s8,x5/2,pn/i,x12/3,pa/l,s2,x9/11,s8,x2/1,s15,x11/14,pc/g,x2/9,s11,x15/10,pn/a,x9/8,s13,pp/e,x13/14,s14,x9/1,pi/j,s2,x4/15,s13,x10/14,ph/n,x5/8,pe/l,s15,x3/4,pn/p,x0/1,s8,x15/3,s7,x14/5,pj/b,x15/9,s4,x2/13,pe/n,x3/10,s10,x15/5,pa/l,x11/9,po/k,x10/8,s4,x11/3,s15,x8/14,s12,x10/9,s11,x3/12,pm/c,x15/7,po/h,x8/9,s4,x1/2,s3,x6/10,pb/c,x3/12,pj/o,x13/9,s10,x2/3,s4,x9/1,pa/m,x12/8,pg/d,x11/2,pf/e,x5/3,s15,x7/8,s15,x4/12,s9,x11/7,pj/h,x6/0,pi/g,x3/10,s13,x15/13,s12,x7/6,s1,x2/12,s4,x4/0,s10,x12/8,po/p,x15/0,s10,pj/l,x13/1,s6,x6/7,pf/p,s5,x15/1,pi/o,x2/12,s5,x9/8,s5,x6/3,pg/h,x14/15,s12,x0/10,pa/e,s15,x5/15,pc/f,x8/4,s12,x2/3,s12,x5/12,pk/g,x10/14,pb/e,x3/2,pi/p,x13/14,s10,x4/5,pk/n,x10/0,s7,x7/3,pd/i,x4/9,s14,x5/3,s15,x13/1,s5,ph/o,x11/3,s4,pf/d,x15/10,s10,x1/12,ph/p,x11/10,s5,x7/0,pc/e,x12/2,pd/g,s10,pp/e,x11/1,s1,x12/3,pi/m,x10/0,s4,ph/o,x13/2,s12,x9/11,s5,x4/6,pn/b,x5/11,s15,x12/2,s5,pk/f,x1/14,pl/g,x4/6,s14,x8/9,pp/a,x14/2,s12,x7/0,s2,x14/3,s12,x8/13,s12,x12/7,pk/c,x13/4,pa/m,x9/8,s7,x10/11,s1,x2/9,pi/j,x0/4,s1,x9/5,s11,x11/8,s12,x12/7,po/m,x11/15,pn/p,x5/4,s10,x3/14,s10,x6/12,s1,x5/9,pg/i,x15/8,pc/k,x9/11,s4,x6/8,pn/g,x14/7,s5,x6/9,pk/b,x5/10,s11,x3/7,s8,x14/13,s11,x15/0,pp/n,s3,x1/7,pl/j,s10,x10/0,pc/h,s14,x1/15,s15,pm/d,x12/14,pc/e,x1/5,s15,x7/4,s11,x14/8,ph/n,x2/10,s15,pk/p,x8/15,pn/g,x14/6,s5,x2/5,pj/e,x12/0,s5,x6/14,s6,x10/8,s13,x9/12,s14,x6/15,s6,x3/0,pd/o,s14,x2/10,pa/k,x4/0,s14,x8/11,s7,x5/15,s12,pi/l,x6/0,s11,x1/10,pk/e,x12/9,s14,x15/3,pi/j,s12,x6/14,s15,x15/1,s3,x9/14,s6,x10/4,s9,x2/6,pb/h,x8/15,s3,x13/10,pj/k,x11/3,s5,x5/1,s13,x10/0,s13,x4/5,pe/m,s13,x7/15,po/h,x2/13,s4,x5/3,s11,x11/4,s11,x10/12,s13,x14/0,pl/k,x12/11,s14,ph/e,x1/14,s7,x6/7,s6,pf/d,x8/11,s6,x0/14,pg/e,s9,x2/11,s15,x3/5,pf/b,s6,x7/8,s2,x12/14,s13,x7/3,pj/c,x6/11,s6,x4/12,pe/p,x8/6,pd/g,x7/5,s9,x14/13,s7,x6/9,s3,x14/3,pp/l,s14,x5/13,pe/b,x7/8,s2,x11/5,pm/p,x13/2,s10,x0/6,s14,x9/10,pf/k,x1/2,s9,x0/6,s5,x2/7,s8,x12/13,s9,x4/1,s14,x8/10,s1,x12/13,s13,x3/2,s11,pl/i,s13,x0/5,pd/h,x14/12,s11,x0/13,s13,x2/4,s15,x12/0,s8,x11/13,pe/o,x2/12,s13,x3/8,s8,x12/6,pn/m,x13/9,s8,x4/10,pf/k,x6/0,pj/l,x9/10,s3,x11/7,pn/a,x3/6,pb/i,s7,x2/14,s9,x11/6,s7,x10/0,pa/e,x7/13,s4,x14/10,s8,x0/5,po/j,x4/10,pl/m,x3/0,pa/k,x14/1,s6,x8/3,pf/i,x14/4,pa/j,x12/11,s11,x15/4,s3,x9/2,s5,x1/5,s2,x4/10,s10,x12/7,s3,pb/h,x3/6,pj/e,x8/10,s13,x12/6,s8,po/i,x5/2,s10,x7/14,s2,x12/15,s12,x5/0,s4,x1/12,s13,x7/6,pj/m,x5/4,s13,x12/2,s2,x1/15,s11,x10/8,s15,x7/6,pg/l,x2/1,s10,x4/0,s7,x14/15,s8,x8/10,s2,x3/11,s6,x10/12,s15,x4/6,pk/f,x15/7,s9,x5/4,s1,pj/a,x13/0,s2,x10/1,s1,x14/7,ph/d,x12/9,pg/j,x10/5,s15,x11/14,pc/o,x4/1,s13,x10/12,s6,x7/5,s6,x2/12,s8,x8/6,pf/a,x4/2,s11,x11/15,po/j,x5/6,s7,x1/11,pk/i,x12/2,pc/n,x9/13,pf/b,x14/7,s11,x15/10,s9,x9/8,s10,x5/2,s6,pm/e,x10/15,s1,x5/11,s6,x8/15,s6,x2/1,s11,x4/8,ph/a,x3/15,pk/b,s12,x11/4,s8,x12/7,pp/l,x1/2,s8,x0/9,s4,x15/10,s13,x5/14,s1,x12/2,pg/o,x10/13,ph/m,x2/9,s1,x8/15,s2,x14/7,s2,x13/10,pb/p,x9/2,s8,ph/o,x0/10,pm/g,x3/5,po/l,s13,x12/9,pi/j,x4/0,s4,x8/15,pn/e,x0/12,s6,x13/7,s1,x3/5,s2,pm/o,s15,x13/14,pf/n,s5,x10/8,s13,x9/1,po/e,x0/7,s15,x14/9,s13,x8/15,s4,x9/1,pd/c,x5/11,s7,x0/8,pf/k,x10/9,s2,pg/d,x0/11,s4,x1/3,pb/o,x6/13,s11,x10/7,s14,x9/8,pg/e,x5/11,s3,x14/8,pm/p,x7/4,pl/h,s1,x14/0,s8,x11/13,s5,x2/9,pd/e,x11/14,pb/m,x3/7,pl/f,x9/13,s5,x8/5,pn/p,x1/12,pk/e,x5/10,pl/o,x1/13,s9,x7/4,s5,x10/9,pb/c,x7/15,po/l,x11/13,s7,pa/i,s8,x7/15,ph/k,s15,x1/13,pm/j,x9/8,s1,x7/3,s8,x1/5,s1,x10/3,pn/k,x12/13,s15,x0/9,pa/c,x10/11,s11,x5/7,s15,pi/k,x6/4,s5,x3/15,s5,x8/0,s9,x13/11,s13,x2/4,s1,x0/6,s12,x2/1,ph/f,x9/6,po/m,x5/1,pc/d,x6/12,s12,x3/11,pg/e,x5/9,s7,x11/4,pd/c,x15/2,pe/b,x7/5,s2,x8/12,ph/j,x9/1,s10,x12/4,pc/f,x15/5,s13,x3/9,pk/j,x6/12,s9,x11/15,s6,x1/14,ph/d,x0/13,s8,x15/4,pc/n,x13/0,s13,x6/10,s8,x15/9,s6,x12/7,s11,pj/k,x6/11,s3,pm/e,s3,pa/i,s7,x14/15,pf/n,x7/0,ph/o,x4/3,pd/n,x5/10,s4,x4/3,s1,x8/6,s14,x12/10,ph/k,x1/13,pb/p,x0/11,s5,x6/10,ph/e,x0/8,s5,x5/15,s13,x10/2,s6,x6/7,pk/m,s6,x5/10,s8,x12/1,s1,x6/2,s1,x12/7,s8,x10/15,pp/o,x4/6,s12,pi/c,x7/15,pb/o,s5,x2/4,s9,x6/9,pd/h,s4,x1/7,pe/g,x10/11,s11,x15/7,pk/o,x8/9,s4,x2/10,s3,x7/8,pa/m,x1/14,pb/h,x5/3,pl/d,x6/15,s5,x7/4,s3,x8/13,s5,pi/h,x7/4,s5,x1/15,pg/a,x9/0,s1,x12/2,pl/h,s5,x0/15,pm/b,x10/4,s4,x7/8,s11,x0/9,pi/h,x14/5,s10,x13/2,s3,x12/5,pc/k,x15/14,pp/j,x12/6,s15,x5/2,s15,x1/15,pe/f,x2/11,s13,x7/0,pi/b,x11/5,pf/p,x2/8,pd/g,s2,x3/12,pj/c,x1/11,s9,po/m,x6/12,pf/p,x14/0,pj/b,x8/15,s7,x1/2,pf/i,x10/5,pe/p,x14/7,s7,x9/12,s3,x6/0,pl/d,x8/3,pa/p,x7/2,s4,x8/15,pm/o,s6,x7/6,s8,x9/13,pc/n,x15/8,pf/k,x2/11,pn/b,s5,x9/15,pe/k,x13/2,s11,x6/8,s4,x14/4,s3,x11/6,s1,x8/15,s14,pp/i,x0/12,s13,x11/6,ph/a,x15/5,s15,x11/2,s3,x4/13,s1,x15/9,pb/c,x14/8,s12,x1/11,pm/d,x3/12,pb/c,x4/7,pa/k,s7,x6/14,s3,x7/1,pf/l,x2/8,s4,x3/0,pk/c,x11/4,s8,x1/13,s6,x0/7,s3,x15/10,s3,x12/7,s13,x2/8,ph/o,x4/6,s7,x8/12,s6,x15/14,pe/b,s8,x1/6,s14,x4/5,s15,x11/2,s8,x5/1,s15,x6/7,s4,x12/9,s1,x13/8,s8,x5/11,pk/p,x2/15,s10,x13/6,s6,x11/5,s10,x2/13,s12,x5/0,pf/h,x11/15,s1,x3/12,s2,x11/8,s14,x12/7,pb/k,x13/9,s6,x14/0,s14,x12/2,s14,x14/1,s3,x7/2,po/e,x5/0,pm/g,x12/10,s1,x9/15,s2,x8/5,po/c,s12,x12/6,s5,x11/10,s10,x4/9,s2,x11/7,s9,x2/1,pm/i,x7/10,pd/l,x4/15,pb/i,x10/7,pc/o,x11/14,s6,x10/0,pi/n,x9/6,pa/k,x8/1,s5,x3/4,pi/e,x6/13,pl/p,x9/0,s6,pc/h,x14/11,s3,x0/1,s13,x15/13,po/m,x11/7,pc/e,x10/2,po/h,x14/4,s8,x0/1,pd/a,s1,x5/15,s11,x3/14,s12,x0/8,s10,x6/11,s9,x13/7,s5,x15/14,pe/n,x2/12,s8,pi/d,x5/10,s10,x9/0,pj/b,x4/15,ph/l,x10/2,s8,x9/6,pp/g,x12/10,s4,pd/k,s7,x6/11,s8,x8/13,s8,x15/7,s2,x0/14,pl/a,x7/3,s9,x4/5,s9,x11/1,s11,x2/14,pp/h,x13/0,s4,x1/7,pg/f,x15/10,s5,x9/6,s7,x13/10,s7,x2/5,s4,x1/0,s13,x4/5,s2,x15/6,s4,x0/12,s15,x2/4,pn/o,x13/7,s9,x4/12,s11,x14/9,pi/b,s13,pm/c,x0/6,s11,x2/3,s3,x11/10,pg/j,s10,x5/12,s6,x9/2,pc/p,x5/1,s2,x2/11,pe/d,x0/12,s7,x3/6,s2,x0/5,pc/b,x3/12,pp/d,s11,x1/7,s14,x2/5,pk/h,x1/7,pg/o,x4/2,s11,pm/l,x10/15,s11,x14/7,s13,pg/k,x8/1,s10,x2/12,ph/a,x10/8,s8,x4/9,s3,x10/13,s8,x11/4,pf/o,x8/13,pa/h,x5/14,pl/i,x0/7,pf/m,x6/13,pb/p,x5/12,s4,x4/15,s4,x10/11,po/i,x5/1,pj/e,x10/9,s14,x6/1,pp/n,x13/0,pf/g,x6/8,s2,x9/2,s14,x7/3,s12,x6/15,s3,x1/5,s4,x15/3,s7,x10/7,s13,x4/2,pc/e,x14/12,pi/d,x15/0,s9,pf/p,x9/4,pi/j,x10/1,s14,x2/5,pd/e,x10/8,s4,x11/13,pp/k,x15/4,s5,x9/14,pj/g,x13/7,pk/n,s9,x8/14,s11,x10/11,s5,x7/12,s15,x9/8,s14,x2/12,s4,x14/1,s6,x10/6,pa/g,s8,pi/f,x13/3,s9,x12/6,s14,x7/15,pj/h,s9,x6/0,pn/l,x13/7,pk/o,x1/0,s13,x9/8,s3,x14/10,pl/g,x3/2,s4,x9/15,s1,x4/10,po/k,s15,x14/13,pg/l,x8/6,pb/n,x11/9,pe/d,x13/7,ph/l,x8/2,s2,x15/11,s8,x1/12,s11,x2/8,s7,x12/5,pd/a,x10/8,pi/n,s12,x7/2,s4,x11/5,s13,x10/4,ph/g,x9/7,s5,pm/b,x1/8,s8,x11/12,s5,x0/8,po/g,x11/9,pc/a,s8,x4/7,pd/g,x2/14,s4,x10/9,s1,x5/4,pa/p,x3/9,po/d,x10/15,s10,x7/11,s13,x1/5,pe/f,x10/3,s2,x14/8,pj/p,x2/15,s10,x6/5,s7,x9/11,po/g,x1/8,s6,x6/2,s12,x4/7,ph/a,x9/2,s1,x11/0,s4,x5/15,pf/d,x2/10,s2,x1/5,pe/a,s7,x3/6,s12,x7/8,ph/f,x12/6,s13,x10/1,s1,x14/5,pk/b,x13/15,pa/g,x9/7,s9,x6/8,s13,x12/10,s12,x3/15,s9,x0/10,pf/c,x15/9,s13,pj/l,x0/1,s15,x12/10,s5,x0/11,s12,pg/b,x14/5,pe/l,x4/9,pd/m,s11,x11/15,s15,x13/3,s12,x10/14,s9,x0/11,pc/o,x7/10,s7,x2/13,pf/m,x4/1,pa/l,x2/11,pi/k,x0/7,s13,x14/8,pm/j,x2/4,s9,x9/13,s13,pi/k,x10/15,s7,x6/11,s3,x13/3,pp/m,x2/4,s13,x14/10,pf/b,x7/0,s5,x3/2,s9,x1/5,pm/o,x14/4,s4,x15/0,s12,x12/13,s8,x6/14,pl/i,x8/11,s4,x6/4,s12,x8/1,s1,x14/0,s14,x8/9,s9,po/c,s8,x12/2,s11,x0/10,s7,x11/9,pl/e,x15/14,s12,x6/2,s12,x12/4,s3,x10/9,po/p,x11/6,pf/e,x15/0,s14,x6/2,pl/n,x7/9,s8,x13/3,ph/f,x8/9,s14,x1/14,pd/e,x0/10,s12,x3/11,pn/f,x2/10,po/m,x4/0,s11,x14/11,pj/b,s8,x13/10,s3,x15/5,s5,x12/9,s5,x3/2,s13,x9/12,pa/i,x13/6,ph/e,x3/7,s2,pc/o,x11/6,pg/l,x15/8,s14,x6/5,s5,x0/10,s5,x9/15,pf/p,x1/10,po/h,s14,x0/6,s3,x3/5,pb/j,x9/15,s8,x8/4,pe/o,s10,x9/5,pk/n,x3/8,s2,x2/7,s7,x12/15,pm/h,x8/13,pp/g,s14,x4/7,s1,x6/12,s2,x13/9,pa/m,x8/0,s7,x4/5,s9,x7/8,s13,x15/4,s5,x11/0,pb/k,x6/2,s12,x12/11,pm/j,x9/6,s2,x8/15,po/n,s15,x5/11,pj/b,x12/3,s7,x13/10,s13,x9/5,s7,x7/3,s5,x2/4,s13,x9/14,s14,x2/3,s9,x9/12,pk/d,x0/4,s5,x5/6,s12,x12/10,s1,x2/5,pa/m,x9/7,pe/f,x0/8,s7,x5/15,pl/o,x3/0,s8,x11/10,s7,ph/c,x2/0,pk/e,x1/13,s15,po/i,x3/7,s5,x6/10,s3,x0/14,s13,x2/13,s15,x7/3,pd/c,x5/8,s3,x1/15,pf/g,x5/8,pk/l,x1/10,pn/p,x0/11,s8,pd/f,x2/8,s10,x9/13,s10,x3/11,pj/l,x15/2,s2,x10/9,pm/b,x2/0,s3,pa/i,x14/12,s7,x9/10,s6,x15/13,pg/n,x6/7,s14,x14/3,pd/b,x0/6,pf/i,s13,x7/4,s14,x13/8,s13,x4/11,pc/l,s14,x12/15,pa/h,x13/1,pd/c,x8/15,s8,pk/j,s2,x1/9,pa/b,x14/0,s10,x5/8,s9,x4/15,s6,x12/3,pg/e,x9/2,s2,x7/1,s6,x0/9,s7,x1/10,po/f,x8/5,pj/g,x14/1,s7,x10/12,s3,x0/3,s3,x15/14,s6,x11/5,pm/p,x15/0,s9,x14/7,pg/k,x2/4,pd/b,x10/11,pe/c,x7/2,pd/h,x13/10,pm/n,x11/5,s7,x12/8,s5,pb/d,x14/3,s14,x5/10,pe/f,x13/1,s15,x9/3,s4,x10/7,pn/l,x6/13,pf/d,x9/7,s4,pc/g,x10/4,s2,x6/1,s8,x9/15,s3,x3/6,pp/h,x8/2,s1,x1/12,pm/k,x4/8,ph/l,x14/2,s4,x10/7,pc/k,s2,x0/3,pn/j,x2/4,s2,x11/8,s11,x6/0,pl/e,x8/1,s14,x0/15,s7,x8/5,s11,x14/10,s4,x15/6,pk/d,x7/5,pp/m,x0/14,s6,x10/1,s3,x15/11,pc/d,x1/5,s11,x2/0,s3,x11/8,s13,x5/6,pn/a,x2/15,s3,x6/11,s3,x7/10,s5,x3/5,s5,x1/13,s11,x10/6,s4,x14/5,s10,x1/12,s2,x5/8,s11,pi/c,x1/0,s9,x9/12,s2,x14/7,pd/j,x12/4,s14,x9/6,s9,pe/p,x8/3,s5,x12/5,pm/g,x10/7,s2,pn/h,x9/1,s6,x3/10,s9,x14/2,s15,x12/10,s14,x14/11,s4,x3/2,pp/l,x13/4,s7,x12/15,ph/f,s10,x0/10,pc/g,x15/13,s7,x1/9,s9,x11/14,s3,x2/7,pf/n,x3/14,pg/j,x15/4,pl/k,x14/12,pd/b,x15/7,pi/j,x8/2,s2,x11/4,s9,x14/12,pf/a,s5,ph/j,x4/0,s3,x14/8,s14,x13/7,pn/k,x2/15,s13,x12/3,pi/o,x15/2,s15,x7/0,s9,x5/4,s10,x6/15,s14,x0/11,pl/j,s3,x14/6,s5,ph/p,x3/2,s6,x7/15,s5,x4/5,s10,x3/7,po/d,x0/12,pi/c,x1/13,pl/h,x0/15,pp/a,x4/6,s13,x13/3,s14,x4/5,pc/h,s12,x15/0,pa/i,s15,x9/11,po/f,x1/0,pl/h,x13/3,pj/c,x0/12,s5,x2/7,pl/g,x0/10,pc/b,x8/3,s13,x13/7,po/a,x1/2,s2,x7/0,pk/b,x10/4,pl/j,x3/5,s6,x14/9,s12,x4/13,po/h,x0/6,pd/k,x10/7,s2,x4/12,s8,x13/8,pi/h,x2/14,pk/j,x6/7,s2,x1/4,pl/a,x11/6,pp/i,x13/14,pf/c,x12/10,s9,x9/2,s5,x14/1,pm/a,x2/3,s4,x10/11,pn/c,x5/1,s9,x6/10,s1,x15/4,pe/k,x13/3,po/g,x12/1,pd/l,x0/8,s2,x4/14,s1,x10/7,pn/c,x12/3,s8,x6/11,s4,x12/7,s6,pj/h,x13/9,s13,x5/8,s2,x6/13,s12,x4/15,s12,x13/1,pn/e,x3/2,pg/k,x11/1,s6,x12/4,s5,x13/1,s4,x11/7,pl/f,x3/2,s1,x14/4,s12,x9/7,s15,x2/8,pd/p,x9/12,pc/k,x4/0,s4,x11/5,s6,x0/12,pe/b,x13/14,pn/c,x7/1,po/a,x10/3,s5,x14/2,s15,x12/9,s10,x1/11,pd/j,x9/0,s11,x13/3,pn/i,x4/11,s3,x8/2,s3,pp/o,x15/12,pa/h,x10/2,s15,x12/8,s5,x9/2,pc/b,x12/3,s6,x11/2,s6,x15/8,pn/d,x14/9,pa/g,x13/10,s15,x14/4,pe/b,x13/3,s10,x9/0,s5,x3/5,pp/a,x12/11,pf/o,x0/6,s12,x4/14,s6,x8/15,s15,x4/13,s10,x7/11,s12,pm/n,x12/3,s6,x10/2,pi/o,x15/11,ph/e,x12/14,pm/d,x3/5,s8,x2/9,s7,x10/11,s7,x9/15,s9,pj/k,x6/5,s6,x15/11,s9,x5/13,pl/a,x9/4,s5,x13/0,pe/c,x9/10,pg/m,x12/11,s4,x15/9,s13,pa/l,x4/12,pc/g,x7/6,s6,x4/5,pa/o,x6/14,pj/n,x3/7,pm/i,x6/11,s7,x0/2,s1,x3/7,s11,x8/5,pa/g,s12,x12/9,pl/m,x8/15,s15,pc/f,s2,x9/2,pk/p,x1/5,s7,x15/0,pa/c,x9/6,s12,x15/3,s9,x14/7,s6,pp/i,x10/1,ph/e,x4/12,pm/k,x1/6,pb/e,x14/3,pp/m,x7/9,s13,x14/4,s1,x3/13,pi/d,x1/5,s4,x13/12,ph/a,x15/2,s2,x14/3,pe/c,x0/4,pa/n,x6/2,pe/o,x0/7,s2,x6/14,s11,x3/11,pd/m,x5/2,s4,x1/9,pn/k,x6/0,pe/j,x7/11,s14,x9/0,s2,x5/2,ph/l,x8/0,s6,x4/11,s9,x1/2,s10,x13/3,s3,pb/o,x15/12,pj/m,x13/4,s10,x0/3,pn/d,x6/7,s15,pf/b,x8/9,s10,x1/2,s8,x14/12,s13,x2/13,s2,pi/g,x9/5,pj/p,x15/14,s4,x12/2,s3,x14/13,pd/n,x6/11,pa/i,x14/0,pj/n,s15,x3/9,pp/i,x2/1,po/g,x4/12,s6,x13/6,s15,x5/2,pi/e,x10/0,s5,x7/15,pp/l,s14,x4/0,s5,x1/7,s4,x9/3,s14,x7/0,pn/k,x13/5,pb/a,x0/15,pe/m,x13/2,s3,x9/12,ph/j,x14/3,s13,x4/12,s4,pd/l,x10/6,pn/p,x4/14,pd/o,s5,x10/2,s12,x14/9,s11,x1/13,s6,x2/10,pm/g,s9,x4/15,pf/h,s15,x2/14,s12,x7/10,pe/o,x8/13,s4,x0/15,s4,x6/10,pc/k,x14/2,s8,x4/3,pd/f,x13/5,pp/g,x0/12,s2,pa/l,x15/7,s9,x2/11,s5,x9/1,s7,x8/13,s9,x4/0,s7,x2/5,s11,pn/f,x12/9,pe/i,x7/0,s12,x6/14,pd/h,x9/13,s12,x1/10,pb/l,x5/13,s12,x9/1,s8,x2/6,pj/k,x13/10,s7,x15/11,s10,x7/3,s11,x14/11,s6,x0/4,s2,x3/8,pb/i,x2/0,s4,x12/5,pl/d,x3/0,s9,x11/4,pf/i,x14/15,pc/j,x2/7,s14,x3/5,pa/m,x9/13,ph/k,x4/0,pp/o,s3,x7/9,s3,x3/0,s10,x5/15,ph/g,x10/8,s11,x1/14,s3,x8/13,s4,x15/10,pb/l,x8/0,pm/g,x3/15,po/e,x0/8,s15,x1/15,s10,pm/b,x12/7,pn/h,x11/5,pl/e,x12/10,s4,x1/14,s14,x9/15,s2,x3/5,ph/d,s6,x0/8,s14,x7/6,pc/p,s15,x1/15,s5,x7/14,s14,x11/0,pk/i,x3/1,s10,x14/8,s5,x7/3,s15,x4/13,s14,x0/10,pl/a,x4/6,s15,x12/7,pd/e,s2,x1/15,pk/j,x13/3,s15,pc/l,x5/0,pk/m,x3/2,s12,pl/p,x14/1,s2,x13/8,pb/a,x14/15,s11,x8/11,pi/c,x7/0,s2,x12/4,s15,x13/1,pn/d,x12/5,pk/h,x6/11,pf/b,x8/15,s2,x5/14,pm/c,s3,x2/3,s9,x6/14,po/d,x0/15,s14,x6/12,pl/c,x14/10,pj/f,x13/7,s4,x5/10,s14,x6/4,pg/c,x10/7,s5,x3/9,s11,x6/7,pm/o,x2/4,s5,x5/11,pk/a,x4/8,pg/n,x3/14,ph/i,s15,x0/11,pg/e,x8/4,s9,x11/0,pb/d,x5/14,s7,x12/8,s4,x6/9,s5,x2/11,pg/h,s10,x14/15,pp/n,x13/2,s5,x9/6,s12,pb/a,x13/11,s10,x12/0,pe/j,x11/5,po/l,x6/1,pa/b,x3/8,s11,x0/9,pp/l,x1/12,s2,x10/6,s5,x13/14,s4,x8/15,pf/g,s3,x2/4,pk/i,x12/5,s7,x14/7,s12,x8/2,s3,x3/12,pl/j,x9/11,po/m,x13/3,pk/c,x14/6,ph/p,x4/3,pd/b,x8/14,pa/c,x13/7,pm/g,x5/4,pd/e,s1,x15/13,s6,x3/6,s6,pi/h,x7/2,s5,x4/11,s8,x1/8,po/m,s7,x2/3,s3,x14/0,s9,x6/10,s15,x4/14,s7,pi/l,x7/12,s1,x15/3,pp/c,x13/2,pk/l,x5/8,s12,x4/0,pg/p,x8/12,s11,x10/13,s8,x0/11,s15,x5/2,s7,x6/8,s13,x5/11,pm/f,s3,x10/2,pk/n,x3/5,pj/a,x13/12,s6,x0/7,s14,x14/1,pb/n,x5/10,s12,x15/7,s6,x9/1,pc/j,x14/10,pd/l,x15/6,pe/a,x8/3,s9,x10/14,s2,ph/j,x15/7,s13,x5/9,pf/c,x3/11,pg/a,x13/10,pe/d,s4,x5/4,s13,x7/10,s13,x11/9,s7,x14/1,pm/j,x6/13,s9,x8/15,pk/i,x7/6,ph/j,x1/12,po/i,x4/10,s14,pm/n,s10,x9/3,s11,x13/8,s15,x1/10,s4,x7/2,s5,x4/3,s3,x10/8,pl/h,x11/12,pb/n,x9/7,s8,x0/10,s1,pj/i,x9/5,s9,x10/14,pf/b,x15/1,s1,pk/a,x3/5,s7,x9/12,s14,x11/7,pi/l,x0/14,pm/j,s9,x1/5,pb/p,x7/9,pc/e,x13/10,s6,x7/3,s8,x5/0,s11,x8/9,ph/p,x6/11,pd/c,x8/9,s9,x12/10,s12,x11/1,pn/e,x14/13,s7,x8/2,pl/h,x9/10,pp/j,x6/11,s2,x12/14,pc/i,x8/2,pf/e,x5/15,s5,x4/8,s7,x2/15,s10,x1/10,pg/j,s6,x2/7,pe/c,x13/6,po/b,s12,x15/9,s13,x0/4,pa/l,s9,pp/g,x8/2,pn/m,x13/1,s1,x11/4,pg/a,x10/1,pm/d,x12/15,s14,x8/6,s13,x12/1,pn/g,x5/2,pi/e,s3,x13/7,s14,x5/14,s5,x3/10,pc/l,x15/14,s7,x2/10,s15,pj/f,s11,x12/5,s7,x0/14,s8,x2/11,s13,x10/6,s11,x11/7,s3,x14/1,pk/m,x7/12,s15,x4/11,pp/o,x0/2,s13,x14/9,pg/d,s12,x10/1,pi/m,x0/7,s1,x1/4,s12,x14/7,s2,x3/4,s3,x12/14,s4,x7/6,s1,x4/8,s9,x6/0,s13,x9/5,pd/f,x15/14,po/b,x7/11,s11,x2/12,s10,x9/11,s9,x5/3,s13,x0/12,pc/n,x10/2,s5,x8/12,pk/f,x2/4,s1,x13/1,s3,x8/12,s3,x15/0,po/h,x14/6,pm/a,x15/9,s3,x12/13,pf/p,x10/9,s5,x6/8,po/d,x9/5,pm/h,x10/0,s12,x14/1,pg/b,x4/8,s1,x6/11,s3,x2/12,s12,x3/5,s11,x9/7,s14,x14/5,s7,x13/7,s12,x3/5,pd/n,x4/2,pe/a,x15/12,pg/b,x3/10,s13,x2/0,s13,x1/3,pa/h,x14/13,pm/p,x5/2,s14,x1/12,pb/f,x10/8,s12,x0/2,pg/c,x5/3,pm/l,s6,x13/6,ph/a,x1/3,s14,x8/5,s7,x7/4,pd/l,x8/12,pb/a,s12,x5/14,po/f,x9/6,s9,x7/12,s11,x3/6,s5,x1/10,s10,x0/14,s9,x6/5,s3,x13/4,pi/e,x3/10,s3,x4/8,pn/o,x5/12,pe/i,x1/2,pb/n,x4/3,s11,x9/7,pa/d,s2,x15/11,s15,x7/0,pm/f,x15/8,ph/k,x5/7,s4,x0/12,s10,x5/3,s4,x11/13,s10,x14/7,pg/b,x10/12,pk/o,x9/3,s6,x2/4,s9,x11/14,s7,x5/1,s8,pn/l,x6/2,pd/b,x1/13,ph/f,x4/15,pn/j,x14/5,s2,x6/15,s3,x9/2,s15,x3/4,s7,x9/14,ph/l,x0/10,pj/g,x6/13,pf/b,x11/8,pe/c,x6/9,pd/b,x0/13,s3,x9/7,pi/g,x1/2,pf/h,x9/13,s3,x10/2,pe/c,x13/3,s12,x15/7,s8,x5/13,s14,x10/8,s2,x13/6,s10,x0/8,s1,x9/11,s4,pp/n,x3/0,pm/g,x4/1,pl/h,x5/12,s12,x10/6,s5,x4/3,po/b,x7/5,pl/c,x2/10,s7,x5/12,pa/n,x6/0,s9,x14/12,s3,x4/15,s9,x3/11,s1,x1/4,s5,x13/3,s4,x12/15,s11,x6/2,s5,x5/8,s11,x10/3,s2,x6/1,s1,x8/15,s7,x13/2,pi/c,x9/10,s13,x14/0,s13,x4/5,s4,pe/j,x1/13,s5,pp/f,x8/5,s12,x1/4,s4,pk/i,x2/0,s11,x5/13,pe/f,x9/14,s5,x2/3,s12,pl/n,x6/0,s11,pc/k,x14/3,s5,x9/4,s13,x8/3,pl/f,x1/0,pb/i,x7/2,s11,x4/1,s10,x2/10,po/p,x11/12,pn/m,x15/5,s12,x1/9,pk/g,x3/4,pn/j,x15/8,pb/k,x4/2,pf/o,x9/15,pa/p,x13/4,s10,x10/8,s3,x15/7,s5,x4/10,s14,x11/14,s14,x15/10,s3,x8/4,s12,x2/1,s15,x10/7,pb/l,x3/13,s4,x7/8,s11,x14/9,pn/a,x0/7,s10,x6/9,pc/m,x1/8,s3,x11/7,pi/l,x4/9,s7,ph/k,s10,x11/13,s9,pc/n,x1/7,pl/m,x6/3,s11,x0/2,s5,x9/14,pg/h,x1/2,po/k,x8/0,pb/l,x10/5,ph/k,s3,x8/15,pg/e,x7/3,s13,x6/14,po/p,x13/5,s2,x10/9,s11,x0/11,s15,x3/7,pn/g,s7,x9/10,pl/i,x14/3,pk/j,x10/13,s10,x0/6,s15,x9/14,s11,x12/4,pi/g,x10/8,po/m,x4/11,s1,x14/7,s2,x8/10,s11,x1/15,s9,x2/6,s7,ph/k,x10/3,pl/n,x2/12,pi/f,x7/0,s1,x8/12,pk/g,x1/9,pf/m,x13/15,pb/j,x7/0,po/p,x12/5,pc/i,s4,x2/8,pf/j,x5/9,s12,x13/2,s1,x5/14,s13,x0/11,pk/e,x1/4,s15,pi/f,x3/12,pb/g,x7/13,pn/d,x11/0,s11,x13/14,s6,x7/1,s5,x11/0,pf/e,x10/15,pm/n,x9/5,pa/p,x0/14,pf/l,s13,x7/13,s2,x2/9,pp/e,x13/10,s4,x15/7,s3,x14/1,s6,x7/2,pf/n,x8/11,s1,x5/4,pk/a,x2/0,s9,x7/14,pg/l,x13/10,pc/k,x3/12,s11,pm/g,x13/10,pa/p,x5/7,pi/f,x3/0,s11,x5/11,s11,x13/15,ph/o,s11,x0/14,s6,pp/m,x9/8,s8,x2/12,pa/l,x6/10,s6,x5/8,pf/h,s3,x3/11,s13,x14/4,s14,x8/6,s8,x1/7,s7,x6/3,pk/m,x2/15,s10,pi/p,x10/12,s8,x2/15,s6,x14/13,s10,x1/0,pg/f,x6/9,pj/i,x15/4,pd/e,s14,x11/8,s1,pl/j,x9/6,s3,x10/0,po/d,x9/13,s7,x5/2,pa/l,x7/0,s10,x3/1,s7,x0/11,pb/n,s7,x2/12,pm/a,x5/4,s9,x10/3,s11,x12/0,s15,pf/l,x6/1,po/h,x7/5,s8,x15/8,pa/n,s9,x12/4,s2,x3/8,s7,x4/10,s2,x2/5,s4,x13/0,s9,x6/5,pg/o,x13/11,s1,x10/9,s15,x8/15,s11,x0/9,pc/l,x1/11,pd/g,x13/10,pk/o,x7/2,pp/h,x14/4,pi/k,x5/0,s12,x4/9,pn/d,x13/3,s8,x12/8,s1,x13/5,s11,x15/11,ph/j,x1/2,s6,x5/3,pl/p,x14/1,s14,x0/5,s15,x9/10,s12,x3/4,pd/m,x0/5,ph/j,s13,x15/7,s2,pm/o,s6,x2/12,s5,x10/7,s14,x15/4,pe/k,x7/14,po/m,x2/4,s5,x5/10,s13,x4/15,s6,x1/8,pn/c,x12/14,s9,x8/1,pb/p,x2/15,s4,x10/14,s7,x0/2,pc/a,x5/6,ph/e,x7/12,s11,x5/9,s7,x7/3,s5,x9/2,pd/c,x5/7,pk/a,x8/3,pn/f,x11/12,pc/b,s9,x6/5,pm/a,x9/15,pb/e,x7/11,s12,x2/15,s7,x5/6,s5,x1/8,s10,x7/15,po/l,s15,x0/10,s1,x5/11,s11,x8/15,pa/m,x11/4,s3,x5/0,s11,x13/14,s4,x8/2,pc/h,x0/7,s6,x13/1,s8,x0/9,pg/e,x2/1,s6,x13/0,pj/o,x7/12,pi/l,x6/11,s10,x8/10,s15,x4/7,s11,x15/0,pe/d,x12/8,pp/j,s1,pa/l,x14/7,s10,pe/b,x15/8,s6,x5/6,s2,x9/4,pn/h,x10/8,s15,x7/0,s14,x11/4,pm/d,s7,x6/10,pn/a,x3/0,s9,x14/4,pk/b,x5/6,pj/d,x4/2,ph/i,x14/6,pg/j,x7/2,pa/l,x5/3,s11,x6/8,s15,x11/10,pn/m,x3/9,s3,x12/2,pc/f,x0/8,po/i,x14/5,pf/e,x10/12,pl/p,s11,x2/3,pf/k,x1/12,s14,x4/3,s11,x11/14,s7,pb/e,x5/10,s7,x13/8,s15,x3/10,po/p,x9/2,pd/h,x13/6,s6,x1/15,s8,x5/14,pa/n,x10/7,s9,x15/6,s2,x0/10,s4,x6/15,s8,x3/9,s2,x11/0,s10,x14/5,pp/c,x12/0,pk/b,x13/10,pc/h,s15,x5/4,s6,x1/2,s12,x3/14,pk/g,x4/15,pd/e,s15,x9/3,s10,x7/15,pc/b,x2/0,pp/m,x15/12,s3,x3/11,pe/o,x13/10,pp/g,x5/6,s9,x1/9,s13,x13/12,pb/n,x5/3,s13,pe/c,x10/9,s4,x1/15,pp/j,x8/13,pd/i,x2/3,pm/h,s14,x15/8,pe/f,x3/13,po/i,x14/4,s13,x15/9,s11,pb/k,x13/6,s12,x11/3,pe/g,x8/5,s13,x3/1,s11,x5/9,s13,pc/i,x4/14,pk/m,s14,x3/9,s2,x10/14,s8,x5/0,s5,x2/12,s10,x9/7,s13,x13/15,pn/i,x7/5,s8,x2/14,pb/h,x3/8,s9,x14/6,s4,x3/10,s11,pd/j,x7/11,pa/l,x12/3,pd/h,x4/11,s14,x2/13,s10,x4/6,pi/o,x7/0,s12,x14/2,s5,x1/11,s12,x2/4,pe/p,x13/7,s11,x12/9,pf/a,x0/7,s6,x14/2,s7,x7/12,pm/c,x11/4,s1,x14/9,s3,x7/13,ph/p,x1/12,pn/k,s12,x2/10,pa/b,x3/15,s9,x1/8,ph/k,x9/0,pd/i,x10/11,pc/p,s12,x5/9,s13,x2/12,s15,pk/m,x15/13,s13,x11/2,pi/j,x6/7,s5,x11/0,pe/d,x5/15,s7,pp/l,s4,x3/0,s9,x1/4,s15,x12/5,po/g,x10/15,pb/d,x12/4,s12,x8/6,ph/o,s9,x15/7,pg/j,x3/1,s1,x8/13,s5,x2/15,s14,x9/10,ph/b,s13,x5/6,s7,x9/10,s4,x2/14,s10,x9/10,s8,x11/6,pi/k,x8/4,s4,x15/3,s10,x13/2,s1,x0/7,pd/e,x10/13,pa/c,x0/8,s3,x4/9,s9,pi/j,x15/12,pp/b,x11/7,s4,x4/0,s13,x10/6,pn/l,x12/3,pa/k,x2/13,s8,pb/j,x3/7,s15,x6/15,pg/m,x3/5,s12,x11/13,pl/k,s13,x6/7,s7,x14/11,s1,x4/7,s4,x2/1,s13,pm/a,x0/15,pp/e,x10/3,ph/a,x11/13,pe/i,x8/7,s14,x4/2,s7,x12/7,s14,x13/0,s15,x6/9,ph/n,x2/0,s1,x15/1,s1,x14/13,pe/l,x0/12,pn/o,x8/9,s14,x1/2,s13,x12/6,pf/e,x15/11,pp/o,x0/1,s6,x4/9,s11,x15/14,pe/c,s2,x3/13,pm/n,x4/11,s6,x14/9,s15,x5/6,ph/d,x10/1,pk/l,x9/8,s4,pn/p,x14/4,pg/i,s2,x13/7,s8,pc/n,x2/15,pa/k,x8/14,s1,x2/1,s4,x7/15,po/j,x0/2,pk/m,x13/12,s15,pl/j,x1/3,s13,x2/14,pb/e,x7/0,s8,pl/k,x1/14,s11,pc/o,x10/0,s12,x14/6,pl/h,x3/15,s9,pm/a,x6/1,s6,x10/3,s14,x11/15,s3,x9/13,s13,x7/1,pf/i,x15/10,s14,x7/14,s12,x5/3,pk/j,x15/12,s11,x8/3,pn/c,x15/5,s8,x13/4,pp/b,x11/14,pc/g,x6/5,s9,x8/9,pk/m,x11/10,s1,x14/13,s11,x5/3,po/j,x0/10,pg/c,x11/5,ph/b,x10/7,s7,x12/9,pk/p,x13/5,s1,x0/4,pd/n,x10/8,pp/k,x6/13,pe/i,x12/4,pf/m,s12,x11/2,s14,pd/p,x9/3,pl/m,x13/7,s2,x4/10,s5,x9/13,s6,x5/14,pa/f,x3/4,s6,pn/p,x12/10,s4,pm/c,x15/1,pb/e,x5/14,s10,x10/3,pm/h,x9/5,s8,x7/8,s3,x6/0,pg/f,x12/15,pd/h,x11/13,pm/l,s12,x4/10,s10,x2/8,s10,x15/6,po/d,x11/1,s8,x3/4,s11,x2/8,pp/h,x3/10,pg/n,x6/7,s14,x11/1,s6,x2/4,pe/o,x0/11,pk/b,x2/13,pj/f,x9/6,s14,x1/5,pa/g,s10,x6/10,s1,pf/h,s6,x1/2,pm/i,x3/6,pk/n,x14/8,s15,x4/2,s1,x14/5,s6,x9/11,s2,x7/8,pa/p,x12/5,s8,x1/0,pc/n,x9/7,s5,pa/k,x1/4,pp/h,x15/5,po/n,x3/0,pb/c,x10/11,pf/j,x7/14,s2,x6/15,s2,ph/d,x7/2,pg/n,x11/5,s11,x2/6,s10,x4/13,s13,x12/11,pa/f,x5/6,s9,x9/3,s5,x15/5,s14,x4/12,s14,x6/15,s12,x11/10,s7,x6/14,s6,pb/m,x0/3,ph/a,s12,x11/13,s12,x0/10,s1,pf/m,x14/1,s8,x5/0,pn/c,x15/11,pe/m,x2/7,pk/h,s3,x8/11,pa/d,x4/15,s1,x11/14,s8,x7/13,pb/j,x2/1,s1,x11/12,pa/m,s3,x8/7,s13,x10/1,s11,x2/15,pk/d,x6/3,pa/j,x4/0,pg/o,s14,x14/15,pp/h,x10/12,s1,x14/11,s5,pa/o,x8/3,s15,x15/10,s12,x12/9,s15,x15/1,pi/c,x6/12,s5,x2/10,s9,x13/9,pa/p,x0/4,s11,x6/12,pe/c,s13,x8/13,pb/p,x12/15,ph/g,s8,x0/2,pm/e,x6/4,s4,x12/2,po/h,x4/13,pf/l,x5/11,s15,x6/0,ph/p,x8/4,s8,x1/14,pa/k,x6/10,pb/h,x14/13,s8,x6/12,s9,x9/7,s6,x0/11,s14,pp/i,x6/5,s2,x0/2,s11,x14/4,s10,x7/9,pb/c,x13/4,po/k,x15/5,pp/b,x6/2,s12,x1/8,s13,x4/13,s6,x15/10,pn/m,x9/7,s10,x13/10,pa/b,x6/4,pl/p,x5/14,s10,x3/12,pk/b,x6/9,pg/m,x8/2,s4,x3/15,pj/l,x6/7,s8,x4/10,s7,x1/8,s2,x6/14,s6,x0/13,s13,pg/b,x14/9,s13,x13/6,pa/i,x15/4,s5,x0/2,pm/f,x12/7,s15,x5/15,s7,x4/12,s8,x14/6,s6,x1/0,s10,x10/9,s2,x8/1,po/g,s5,pd/j,x5/0,pf/a,x1/8,s15,pg/i,x4/0,s9,x11/15,s7,x9/5,pk/b,x6/7,pi/d,x10/11,s12,x2/1,pf/a,x3/11,s6,x1/4,pg/h,x7/5,pk/m,x3/10,ph/n,x14/2,s13,x9/15,s2,x6/14,s13,pp/b,x8/2,s9,x1/4,pe/g,x3/2,s12,x4/6,s9,x8/13,s9,x4/11,s15,x15/2,s8,x12/3,s7,pl/p,x4/1,pa/j,x0/13,pf/i,x7/9,pk/a,s11,x3/5,s13,x2/7,pi/h,x8/13,s15,x9/3,s14,x10/5,s2,x9/8,s8,x0/3,pm/o,x8/6,pc/j,s10,x12/4,pa/p,x6/14,s9,po/k,x5/13,pl/h,s13,x4/0,s10,x3/13,s12,x2/10,po/d,x13/8,s15,x0/5,s5,x13/4,s13,x15/10,s14,x9/11,ph/m,x7/2,s4,x15/1,s6,x13/11,pi/b,s14,x10/1,s12,x2/8,pf/c,x5/0,s15,x15/3,s8,x9/6,pg/i,x2/11,pe/d,x9/5,s14,pb/p,x14/2,pg/h,x1/0,s8,x5/14,s12,x0/10,pn/o,x8/5,pe/c,x9/7,s2,x2/5,pf/n,x15/13,pl/d,x10/9,s8,pg/k,s15,x0/15,pn/d,x4/3,pf/h,x6/12,s15,x2/14,pi/e,x3/0,s15,x15/4,s12,x0/5,s5,x9/14,s15,x6/7,s14,x11/10,s9,x3/6,s12,x5/9,pf/n,x6/14,pd/m,x3/13,pi/g,s5,x1/0,pe/p,x8/12,pa/i,x2/13,s6,x5/9,s11,pj/c,x3/6,po/m,x15/13,s14,x3/6,s1,x5/15,pe/k,s10,x2/9,pd/b,x11/13,s15,x7/4,s1,x14/8,s11,x6/15,po/k,s14,x12/2,s1,x10/15,s9,x6/11,pe/l,x9/7,s8,pd/o,x8/14,pn/g,x7/10,s9,x4/13,s13,x1/6,s5,x3/8,pm/d,x4/2,pj/f,x3/8,s1,x10/13,pp/d,x15/6,pa/k,x11/13,s9,x14/5,s4,x1/7,s7,x5/8,s10,x14/4,pg/j,x0/12,s7,x7/6,pc/d,s9,x10/5,s5,x13/7,pg/m,x2/6,pn/c,s1,x1/5,pm/b,x12/7,pd/e,s10,x1/8,s10,x0/6,pl/n,x13/2,s8,x10/14,s11,x9/0,s5,pf/c,x6/7,s7,pd/e,x15/5,pm/n,s8,pe/l,x10/6,s7,x11/4,s5,x7/3,s1,x10/1,pi/f,x9/5,s11,x7/2,pb/g,x15/12,s2,x9/5,s6,x10/14,s6,x4/3,s6,x10/9,pc/h,x3/0,s9,x11/4,s10,x3/14,s6,x4/8,s1,pk/o,s11,x2/5,s11,x12/8,s9,x11/2,s9,x4/1,pj/g,x15/7,s1,x2/0,s13,x11/6,s15,x12/10,s8,x6/15,pb/l,x14/7,s14,x11/2,s10,x9/15,s3,x8/2,s14,x15/3,s4,x11/2,s11,x4/12,s10,pp/c,x9/2,po/j,x0/14,s7,x12/3,s3,x15/9,s6,x5/4,pn/d,x7/9,s3,x14/0,po/f,x1/4,s14,x5/9,pi/l,x2/8,pd/b,x4/13,s10,x6/15,pk/n,x13/9,s7,x3/8,pg/p,x1/13,s15,x5/6,pj/e,x11/10,s3,x9/5,s6,x12/13,s5,x6/4,ph/a,x0/10,s1,x8/14,s12,x9/13,s1,pb/d,x4/6,pg/i,x10/2,pj/a,x14/5,pm/p,x7/15,s1,pl/i,x13/0,s4,x3/14,s11,x1/7,pb/f,x8/15,s7,x4/11,pg/j,x2/6,s7,x10/1,s4,x11/4,pl/m,x15/14,s3,x1/9,pd/k,x3/4,pg/i,x0/2,s14,x9/4,pj/d,x1/12,pe/l,x8/10,s14,x15/3,pg/p,x12/6,pe/b,x10/0,ph/l,s11,x1/11,s3,pd/a,x3/7,pl/g,x5/14,pb/n,s5,x0/4,s6,x13/2,pf/c,x11/6,s11,x12/15,s13,x10/9,pm/k,x8/15,pg/h,s8,pb/p,x3/10,pf/n,x7/14,pe/g,x10/3,s10,x9/13,pm/b,x7/2,pp/g,x0/12,pe/k,x10/14,s5,x13/1,pj/o,x8/12,s15,x3/13,pm/f,x9/1,s7,x8/12,ph/l,x6/14,pa/c,x13/2,s5,pd/m,x7/12,pb/h,x2/8,s12,x14/3,pj/f,x12/15,pp/i,x4/10,s7,x12/3,pn/a,x5/9,s15,x11/8,s5,x1/3,s10,x14/6,s5,x1/0,pd/c,x4/14,s7,x9/7,s10,x10/2,pp/h,x3/12,s12,x0/14,pn/l,x15/9,s9,x13/4,s1,pi/c,x5/2,s9,x15/6,s12,x7/11,s2,x13/3,s3,x1/15,pf/m,x3/7,s13,x15/10,s8,po/n,x2/13,s1,x9/15,pi/g,x0/5,s1,x3/13,pp/n,x1/6,s12,x13/10,s14,x0/11,pe/h,s15,x10/13,pl/b,x12/1,pg/d,s6,x15/13,s5,x9/3,s1,x0/12,pj/b,s7,x1/3,s3,x2/15,s15,x5/13,s13,x3/6,pk/o,x4/13,s12,x3/15,pp/i,x2/10,s12,x5/1,pc/g,x3/0,s1,x10/4,s8,x15/14,s7,x4/1,s3,x0/13,s7,x1/2,ph/f,s9,x6/5,s13,pl/e,s9,x4/11,s2,x10/6,s3,x9/1,s11,x11/2,ph/f,x15/13,pp/k,s4,x5/11,pa/n,x13/15,s5,x9/4,s8,x11/15,pi/p,x7/14,s8,x1/13,pe/m,x0/11,s8,x6/9,pa/o,x10/13,s7,x12/5,s2,x4/13,pg/c,x12/2,pj/h,x9/3,s3,x2/14,s4,x15/10,s13,x8/11,pd/e,x15/4,s4,x2/9,pj/g,x14/5,pl/k,x6/13,s10,x11/3,ph/c,x6/0,pb/f,x2/14,s1,x12/13,s3,x14/4,ph/c,x11/15,s5,x9/8,pm/a,x13/10,s2,x6/8,pf/h,s7,x9/10,pm/k,x14/0,s6,x3/8,pi/l,x11/12,s5,pm/b,x13/3,s11,po/a,s7,x8/10,s2,x7/12,s2,x0/1,s13,x7/3,s10,x12/2,s14,x3/7,s1,x12/13,pf/b,x5/3,pa/l,x10/4,po/h,x5/3,pi/n,x6/1,s5,x15/14,s6,pd/a,x3/0,s12,x12/6,pp/f,x11/4,s7,pa/d,x3/12,s15,x9/8,pb/e,x0/1,s13,pj/o,x5/8,pn/f,x10/7,po/i,x14/12,pe/g,x4/15,s2,x7/2,po/d,x0/9,s3,x8/2,ph/l,x15/3,s8,x12/9,pf/g,x4/14,pi/c,x12/15,pa/h,x6/3,pk/e,x1/15,s14,x5/10,s13,x13/6,s9,x15/10,pd/g,x1/12,s8,x10/15,s11,x8/0,pp/h,x1/6,pb/l,x3/9,s7,x15/0,s11,x9/4,s3,x2/7,ph/p,x11/12,s9,x2/5,s10,x3/12,pj/n,x4/6,pa/o,x13/5,s2,pf/c,s4,x1/10,s1,x15/7,s14,x4/0,s5,x3/15,pi/m,x11/13,s13,x5/12,pl/o,s10,x9/3,pm/d,s4,x10/12,pj/a,x4/5,pp/b,x7/11,s1,x1/3,s8,x5/10,s10,x1/2,s4,x5/8,pk/d,x1/9,pe/f,s10,x5/4,s13,x0/12,ph/b,x3/5,s11,pc/l,x15/1,s11,x4/7,s6,x11/2,pd/f,x4/0,pe/b,x2/12,s6,x9/7,s3,x11/12,pa/g,x6/10,s1,pp/i,x11/12,pe/b,x13/10,pf/i,x8/14,s15,x1/11,pm/p,x12/3,s7,x0/5,s4,x11/3,s13,x6/5,pd/b,x12/7,pk/o,s13,x0/2,s9,x13/9,s10,pe/a,x7/3,s1,x11/13,pd/n,x3/5,s4,x0/6,s2,x4/14,s4,x6/2,pb/e,s3,pj/m,x13/7,s12,x8/5,pb/f,x10/6,s5,x5/3,pe/a,x0/2,pc/b,x3/11,s8,x14/5,s4,x3/9,ph/g,x0/11,pp/k,x4/5,pc/h,s15,x6/9,pl/p,x0/10,pc/a,x13/9,s13,x8/7,pm/k,x10/4,po/c,x6/5,s13,x8/9,pe/h,x12/6,s8,x7/15,s14,x3/6,s1,x13/4,pb/a,x7/9,pi/c,x1/5,s6,x2/13,pk/p,x0/7,pg/l,x5/2,s11,pp/e,x12/6,s1,x3/2,s6,x10/9,s10,x11/13,s12,x15/6,pi/l,x11/9,s1,x10/6,s9,x11/15,s5,x6/0,s7,x5/10,s3,x2/6,s2,x9/15,pn/o,x10/4,s14,x5/7,ph/a,s3,x4/15,pl/k,x12/6,s12,x7/8,s6,x13/4,s13,x11/3,pa/b,x12/14,s5,x6/8,s4,x0/10,s2,x11/9,pe/l,s1,x14/7,s5,x0/10,pi/n,x9/5,pm/o,x13/3,s6,x2/11,s15,x3/9,s3,x1/6,pb/e,x5/9,s10,x0/11,s14,pc/p,s1,x15/14,s11,x9/13,pg/j,s6,x6/8,ph/e,x3/2,s5,x13/7,s3,po/i,x3/10,s13,pm/a,x2/13,pp/f,x7/15,pi/n,x14/13,pp/a,x15/4,s4,x7/6,s15,x14/11,s5,x12/15,s11,x13/7,pf/j,x8/9,s7,po/a,x2/6,s2,x13/3,s6,x14/6,s2,x5/11,pi/b,x1/0,s11,x13/12,pc/m,s12,pb/d,x14/8,s11,x15/3,s13,x8/5,s12,x12/0,pa/c,x3/15,pi/k,s3,x14/13,s12,x5/4,s6,x9/6,pj/c,x8/4,pf/n,x9/1,s3,x12/3,pp/e,x13/5,s9,x15/10,pl/m,x13/9,pa/i,x10/7,s6,x0/15,ph/l,x3/4,s11,pf/i,s1,x12/1,s4,x4/2,pj/d,x11/13,pf/g,s1,x14/7,ph/d,s4,pg/i,x12/5,pa/p,s1,x10/13,s4,x3/1,pd/c,x6/7,s3,x13/11,pk/f,x9/8,pb/p,x2/4,pi/f,x0/12,s7,x7/15,s15,x13/10,s1,x5/9,s12,x4/7,pp/d,x8/10,s3,pe/n,x3/7,pc/k,x11/14,pi/g,s11,pm/a,s4,x0/9,s8,x10/5,pf/o,s4,pk/m,x2/0,pa/n,x11/9,s3,x2/7,s1,x4/6,s6,x8/13,s1,x14/5,pg/i,x10/9,pe/a,s1,x2/0,pp/d,s11,x10/13,s14,x3/7,pl/a,s11,pb/i,x4/14,pc/j,x8/11,s15,x9/10,s4,x8/6,ph/n,x4/7,s8,x14/11,s15,x4/15,pc/i,x10/13,pn/m,s13,x1/3,s7,x5/4,s9,x10/8,s3,x5/9,pp/b,x8/13,pn/g,x7/10,s7,x13/1,pi/e,x14/4,pc/p,x9/1,s6,x12/11,s2,x4/14,pj/h,x13/5,s1,x1/7,pb/d,x11/9,pi/c,x10/8,s13,x9/5,s4,x3/15,s2,x6/0,s3,x14/2,s11,x12/1,s7,x10/15,s9,x13/3,s1,x7/5,pa/k,x14/1,pj/b,x10/7,s8,x4/1,pi/l,x14/7,s15,ph/m,x13/9,s13,x2/1,pk/f,x12/4,s11,x9/15,pb/d,s4,x1/14,pm/e,x2/10,s8,x13/15,s5,x12/5,s2,x2/14,s12,x15/5,s10,x11/13,pn/o,x0/7,s3,x15/13,s5,x4/14,s9,x12/7,pb/m,x15/5,pc/e,x6/7,pa/l,x15/10,pm/f,x1/11,s12,x12/7,s14,x9/14,s7,x11/3,pd/n,x9/1,s10,x10/14,pa/b,x3/15,pc/i,x4/2,pd/m,x7/5,s3,x11/2,pb/p,x14/9,pn/j,x10/5,s12,x15/12,s5,x8/9,s9,x3/12,s7,x7/0,s11,x5/15,s8,x14/3,ph/f,x12/10,s15,x13/15,pk/l,x11/10,s13,x9/6,s14,x14/5,s11,x15/8,s4,x9/4,pa/i,s2,x7/6,pn/g,x15/0,pi/l,x11/8,s10,pf/o,x5/1,s8,x9/0,s5,x10/12,s9,pj/k,x8/2,s11,x13/9,s9,x14/4,pg/d,x11/13,pj/f,x9/1,s4,x5/3,s1,x2/7,s12,x10/14,pl/o,x7/15,s14,x13/9,s1,x7/14,s9,x6/8,s5,x5/9,s11,x1/8,s7,x6/15,s14,x7/11,s10,x12/0,pb/d,x15/13,s6,pc/a,s10,x9/8,s12,x15/14,s7,x6/10,pd/f,x12/7,s3,x11/2,pk/p,x0/8,s11,x13/12,s9,x14/10,s15,x8/1,pf/l,x6/0,s8,pm/n,x13/9,pg/p,x10/14,s9,x11/1,s12,x4/10,pf/i,x1/12,s9,x3/8,s10,x9/4,s1,x14/10,pa/m,x7/13,s9,x0/9,pj/e,s5,x8/4,s3,x13/11,s7,x10/8,s2,x13/3,s12,x0/7,pm/l,x4/1,s4,x9/8,pf/a,x11/5,s5,x3/10,s4,x6/1,s8,x11/13,s2,x14/12,pb/h,x3/9,pn/j,x10/0,s11,x15/7,pb/a,x2/13,pp/j,s12,x1/9,s12,x2/6,s5,x12/10,s6,x4/9,pg/n,x14/5,s8,x15/9,pd/h,s5,x13/7,s8,x11/6,s4,x3/4,s9,x12/8,s10,x2/14,pj/o,x5/15,pg/e,x14/4,s14,x10/15,s9,x3/0,pi/o,x6/8,s14,x1/12,s7,x15/2,pn/h,x6/13,s5,pj/m,x2/15,pb/g,x8/12,pa/p,x1/5,pg/n,x8/0,pm/c,x6/1,s3,x11/15,s13,x1/0,s12,x8/15,pb/o,x0/10,pm/p,x2/13,pc/h,s9,po/n,s5,pk/c,x8/1,pd/g,x3/12,s2,pa/i,x2/7,s6,x4/9,s12,x6/10,s8,x2/1,s14,x8/15,s9,x3/10,pp/f,x5/6,s3,x9/1,pj/n,x2/7,pf/p,s6,x12/1,s3,x8/13,pm/e,x2/7,s10,x14/12,s11,x3/1,s5,x11/12,s5,x13/9,s13,x3/11,pl/k,s12,x12/10,pp/j,s14,x13/15,s4,x0/1,pg/e,s11,x5/3,s5,x11/8,s1,x1/6,s14,x10/5,s15,x9/15,s15,x2/11,pk/a,s14,x6/9,pf/e,x10/0,pa/h,x15/6,po/b,x1/4,pg/e,x12/9,s2,x8/11,pl/k,s4,x2/7,s15,x15/11,pf/d,x14/5,s3,x3/7,s3,x10/2,pc/k,s6,x1/12,pj/b,x11/5,po/n,x12/10,pi/h,x7/9,pb/j,x6/15,s4,x5/11,s3,x10/1,pp/o,s5,x8/2,s8,x3/12,s5,x2/15,s5,pf/e,x7/4,s12,x15/0,s13,x5/4,s5,x8/14,s5,pl/p,x2/10,pc/o,x15/6,s15,x4/5,s12,x10/14,s8,x11/13,s3,x12/6,s13,x9/8,pk/f,x7/4,pa/j,x6/1,pn/l,x15/8,s10,x11/1,s15,x4/7,s8,pc/a,x10/14,pl/f,x11/4,pd/j,x1/0,s6,x5/13,pg/f,x14/10,pe/c,x12/7,pn/h,x2/4,pk/j,x5/9,pb/m,x2/14,s10,x1/6,s9,x15/9,pg/d,x8/11,s6,x7/10,s8,x14/2,po/f,x6/13,pm/n,x4/11,pf/p,x0/5,pg/a,x11/4,pb/i,x9/12,s2,pk/n,x2/6,s12,x0/10,s4,x4/15,pc/m,s11,x10/0,pe/i,x9/4,pm/j,x11/5,pc/i,x4/10,s4,x2/12,s11,x3/9,s13,x8/2,pf/d,x9/7,s1,x15/3,s3,x12/10,pk/m,s6,x3/11,s7,x10/0,s3,x5/2,pj/l,x1/10,s12,x12/3,s1,x6/8,s10,pd/e,x13/7,po/l,x14/6,s6,x8/1,pc/p,s2,x3/10,s3,x7/4,s10,x1/9,s3,x4/12,s14,x2/14,s10,x1/9,s4,x11/5,s12,pd/a,x13/8,pb/g,x3/7,s11,x9/6,pm/n,x10/12,pl/c,x8/13,s6,x4/6,s1,po/p,x7/11,s15,x9/12,s2,x3/14,s15,x6/5,s8,x4/7,s1,x15/5,s5,x6/10,s12,x12/5,s13,x10/4,s5,x15/6,s5,x1/13,pf/c,x14/5,s3,x13/8,pk/m,x11/2,s6,x7/13,s9,x4/8,s1,x1/11,pf/l,s7,pk/g,x3/5,s5,x13/11,s13,x1/7,pc/b,x12/10,s3,x1/11,pp/o,x3/2,s7,x14/11,s10,x9/3,pd/m,x0/6,s4,x7/10,s6,x9/1,s8,x3/14,s8,ph/i,x0/4,s4,x14/9,s10,x11/6,s9,pd/m,x13/8,s14,x6/3,s14,x8/4,pf/n,x15/0,pc/m,x2/13,s3,pl/j,x6/12,s5,x4/2,pc/i,s10,x12/1,ph/p,x14/9,s8,x3/2,pd/e,x1/10,pb/o,x6/3,s12,x14/0,s2,pd/j,x12/5,s11,pl/f,s13,x10/14,s7,x7/6,s3,x13/10,pi/c,x9/14,s10,x13/8,s5,x5/10,s3,x7/6,s10,x0/8,pe/l,x5/14,s3,x12/13,s2,x4/8,s6,x13/3,s11,x15/10,s15,x6/11,s1,pk/h,x4/2,pa/e,x6/3,pi/o,s1,x8/2,pl/n,x13/9,pf/o,x0/14,s2,x4/10,s4,x6/13,s15,pg/l,x8/1,s2,x4/10,pd/m,x11/7,s6,x0/3,s3,x10/8,s5,x15/12,s1,x11/9,s1,x8/5,pe/f,x7/6,po/a,x5/9,s9,x10/12,s7,x4/6,pi/d,x2/8,s12,x9/6,s12,x15/13,s3,x1/9,pf/h,s2,x2/0,s12,x15/13,s7,x8/10,po/e,x0/9,pn/d,x3/2,pp/l,x9/11,pf/i,x2/8,s8,x11/4,s12,pl/a,x7/1,pn/d,s5,pi/l,x0/10,pk/m,x3/8,s3,x14/12,s5,pp/h,x0/1,s15,x15/2,pl/b,x4/3,pe/g,x12/8,s6,x10/7,s5,x1/2,s3,pp/n,x15/14,pc/l,x1/11,s2,x3/15,s6,x2/14,s1,x6/7,s15,x15/13,pd/m,x9/0,s9,x14/4,pc/g,x7/6,s4,x5/14,pk/l,x6/4,s3,x2/10,s12,x12/4,pj/p,x3/7,s5,x10/9,pe/d,x1/6,pc/j,x7/5,s5,x13/10,pa/m,x4/15,s12,pb/f,x13/1,pd/k,x8/0,pc/n,x13/7,po/l,s14,x4/15,pa/b,x8/10,s5,x15/12,s10,x0/6,s3,x10/11,s1,x3/6,pi/d,x8/5,s6,pp/g,x10/6,pa/e,x15/7,s12,x2/13,s6,x7/4,s10,x10/1,pk/p,x8/2,s15,x4/12,pa/e,x15/0,s3,pm/g,x2/6,s12,x4/5,pe/d,x7/2,s1,x0/10,s14,x14/13,s4,x9/12,pi/p,x10/4,s7,x11/12,s14,x4/6,s6,x11/3,pm/g,x9/4,s2,x1/10,pc/i,x2/3,s13,x7/10,pd/o,x0/9,s15,x10/4,s8,x9/14,pi/h,x13/1,pk/d,x3/0,pi/h,x10/9,s13,pp/e,x11/14,s15,x13/1,pk/a,s15,x11/8,s12,x14/10,pp/m,x11/15,s12,pf/j,x14/12,s3,x4/6,s3,x7/3,ph/p,x11/14,s1,x7/12,s8,x8/4,pi/a,x1/7,s6,x6/13,pc/b,x12/10,pp/m,x4/3,pc/f,x7/12,s10,pi/p,x13/15,s2,x2/7,s6,x5/13,s4,x1/6,pn/j,x9/13,pf/a,x8/2,s12,x13/3,s10,x4/7,s14,x10/2,s11,pi/h,x11/0,pa/d,x7/14,s14,x13/4,pm/k,x0/7,s9,x8/10,s8,x12/7,pl/o,x14/11,s9,pk/a,x8/13,pe/d,s8,x4/12,pi/m,x8/2,s13,ph/a,x12/6,pe/k,s12,x5/14,s8,x9/8,ph/o,s14,x5/15,pn/g,x4/6,s1,x3/8,s3,x15/11,pp/l,x10/8,pj/b,x9/5,pn/h,x8/6,pd/i,x5/4,s11,x8/12,s6,x11/1,s12,x14/0,s3,x12/7,pe/p,x6/1,pd/j,x15/0,s8,x9/8,pl/f,x4/13,s12,x2/0,pa/m,x12/9,s5,x8/3,pn/c,x12/10,s12,x6/0,s7,x9/7,pm/a,x12/0,s13,po/c,x2/8,s9,pi/e,s12,x9/14,s1,x12/7,s7,x10/5,pn/k,x0/6,s7,pg/m,x15/2,pb/c,x0/9,pe/j,s10,x8/2,s9,x0/14,pg/f,x6/12,pb/i,x15/7,pg/f,x12/14,s2,pn/a,x1/15,pg/p,x7/9,pj/h,x0/10,pd/f,x14/6,s1,x15/8,s15,x11/0,pg/p,x1/5,pi/k,x9/4,pc/l,s14,x8/13,s1,x7/2,s3,x4/8,pb/a,x2/3,s5,pl/e,x5/14,s9,x1/15,s13,x11/4,s9,x1/10,pi/j,s2,x6/4,pc/b,x15/8,s10,x2/6,pm/l,x11/1,s3,x14/10,s10,x0/9,s4,x4/6,s9,x2/8,s5,x3/15,pf/b,x12/4,po/c,x3/11,pf/g,x13/5,s12,x9/10,pn/b,x8/2,s10,x5/12,s6,x1/4,pi/a,x6/11,s14,x13/12,s1,x14/15,pl/g,x11/9,pk/i,x0/13,pc/n,s14,x6/8,pd/l,x10/1,s12,x4/11,s3,x8/6,pc/b,x12/4,s11,x10/11,s14,x3/13,pf/o,x10/1,pa/k,x0/4,s6,x13/11,s5,x3/6,pm/p,x9/4,s6,x11/14,s8,x12/3,pf/a,s11,x8/4,s7,x9/14,s2,x0/10,s11,x9/13,pl/n,x2/10,s6,x3/6,s9,x5/4,s9,x0/6,pb/k,x3/12,s7,x7/14,s1,x0/10,s7,x5/7,pg/j,x2/9,pl/k,x12/1,s13,x13/5,s3,x2/11,s2,x10/5,s13,x15/3,s13,x10/11,s8,x6/1,s13,pp/c,x11/15,ph/l,x1/5,pj/k,x0/13,s10,x12/15,s13,x14/10,s9,x7/13,s10,x14/8,pl/o,x5/0,pa/g,s11,x3/1,s11,x9/2,pi/e,x4/5,pb/k,x1/8,pn/m,x12/6,s1,x8/3,pe/d,x5/2,s13,x13/8,s9,x12/15,pk/n,x8/13,s3,x2/14,s2,x13/11,pd/e,x15/6,s14,x14/0,s7,x8/10,s15,po/p,x2/12,s14,pa/f,x5/11,s12,x10/3,s13,x6/9,pl/n,x10/7,po/b,x12/9,s13,x15/11,s5,x2/13,pl/k,x6/9,s3,x3/4,s5,x11/0,pi/m,x14/7,pf/j,x3/8,s13,x0/2,s8,x12/11,pn/d,s4,x2/14,s7,x10/7,pl/a,x3/6,s1,x2/0,s12,pd/p,s6,x5/14,pe/b,x1/4,pd/h,x3/10,pn/k,x11/9,po/f,x14/2,s15,x13/8,pb/c,x5/1,s5,x2/8,pp/g,x11/4,pj/h,s13,x15/14,pd/i,x4/8,s3,x6/10,pp/n,x14/1,s12,x11/15,s8,x0/10,s10,x12/15,s9,pg/c,x4/5,s14,x9/2,s7,pn/a,x3/7,pp/l,x9/10,s7,x5/11,pm/k,x0/10,pi/o,x15/6,s13,pa/e,x1/0,s10,x8/11,s14,x15/12,s5,pm/g,x5/9,pk/h,x6/12,pd/m,x11/4,s9,x5/8,pk/j,x4/2,s3,x5/11,pd/m,x0/6,s5,x1/4,s14,x8/0,s3,x15/6,s5,x0/11,pl/k,x3/1,pj/m,x6/14,s8,x13/0,s2,x6/15,s5,x0/12,s9,x9/4,s1,x8/1,ph/k,x15/4,pb/l,x9/14,pe/f,x4/1,s5,x5/11,pn/j,x4/15,pe/o,s2,x7/1,pi/a,x2/13,pg/b,x14/8,s14,x13/7,s10,x0/11,s11,x3/15,s6,x4/5,s8,x10/12,s7,x3/2,pp/n,s5,x7/1,pb/d,s3,x14/9,pl/h,x4/1,pc/i,s1,x2/12,pk/b,x9/13,s11,x8/0,ph/c,x9/3,s10,x2/6,s4,x1/14,s7,x12/15,s13,x4/1,s7,x0/5,pn/k,x12/2,s5,x10/9,s14,x0/2,s15,x14/7,pf/d,x15/6,s12,x5/7,s4,x2/12,s13,x15/10,s1,x5/14,s10,pc/k,x12/1,s6,x2/4,pg/l,x12/0,s15,x13/3,s4,x2/0,s7,x9/12,pd/c,x7/11,s3,x3/15,pn/l,x10/0,s13,x8/4,pk/j,x0/13,pi/c,x14/1,s11,x8/12,s10,x5/10,s7,x15/11,s14,x10/13,pd/e,x3/1,pc/p,x6/0,s15,x5/4,pl/k,x10/0,pe/j,x9/2,s5,x10/11,s14,x2/8,s8,x10/1,pc/n,x12/9,s2,x0/4,pl/o,x6/12,s14,x1/11,s8,x0/3,s11,x6/11,s1,x9/5,pi/p,x1/13,pj/n,x5/7,pl/e,x13/12,pd/c,x15/10,s7,x4/7,pm/h,s3,x2/9,pn/j,x1/0,pl/h,s6,x5/12,pi/g,x15/6,s3,x3/11,pf/k,x14/1,pi/c,x5/10,pp/d,x12/4,s15,x1/2,s15,x5/11,po/f,x13/7,pk/m,x12/11,s4,x6/4,s9,x15/5,s13,x0/10,ph/j,x11/8,s7,x3/2,s1,x5/14,pi/e,x1/12,s3,x2/5,pn/d,x3/11,s14,x5/12,pi/m,x10/0,s4,x15/13,pk/l,x10/8,s2,x5/12,s10,x1/10,s14,x5/12,s15,x6/15,s11,x0/1,s10,x2/15,pm/d,x0/14,s2,x1/13,pc/k,x9/4,s2,x13/8,s5,x15/14,pm/g,x2/7,pl/c,s10,x14/6,pp/i,x9/3,pl/e,x10/11,pk/d,x6/12,pj/l,x14/15,s12,x8/13,pg/a,s1,x4/9,pl/h,x14/2,s1,x7/8,po/g,x1/4,s12,x3/12,s12,x9/2,s3,x0/1,s7,x3/7,pp/i,x13/1,s6,pa/f,x2/12,s6,x1/3,s3,x11/4,s14,x12/5,pp/c,x6/4,ph/o,x3/0,pn/c,x2/13,pg/k,x11/5,s14,x12/4,pn/i,x8/5,s11,pp/b,x9/1,pn/m,s12,x4/13,s6,x7/1,pl/h,x11/12,s11,pm/a,s15,x2/6,s14,x12/0,s9,x5/3,pe/g,x1/10,pl/j,x5/4,s5,pk/p,x13/8,s7,x0/4,pb/g,x5/8,s7,x6/3,s12,x12/14,s9,x5/0,s6,x13/15,s2,x12/4,s6,x6/1,s10,x8/14,s14,x0/1,pk/d,x12/5,s5,x10/9,pm/h,s12,x15/2,po/p,x6/3,s14,x9/7,s5,x1/4,s13,x10/7,s2,x4/8,s12,x13/6,s10,x3/5,s15,x14/11,s13,x12/7,s2,x4/8,s9,x9/14,pf/e,x4/12,pp/m,x1/10,s14,x12/11,s12,pc/o,x5/3,s4,x0/8,s15,x9/13,pm/i,s7,x14/8,pn/p,x5/0,pk/a,x1/13,s6,x15/2,pe/n,s6,x9/6,s12,x14/3,pd/m,x1/8,s10,x6/10,s12,pg/a,x0/15,s3,x7/14,pn/i,s11,x15/4,s8,x9/7,pf/c,x5/0,s15,x12/14,s12,x3/8,s11,x1/11,pk/m,x5/14,s9,pi/g,x4/12,pc/l,x10/0,s13,x1/7,s12,x5/11,pm/g,x1/9,pn/j,x7/4,pi/p,x13/12,ph/l,x11/1,pb/n,x3/5,pa/m,x7/4,s11,x13/11,s14,pp/b,x6/7,s1,x5/12,pd/k,x3/14,s14,x2/11,pe/a,x10/6,s9,x11/8,s4,x7/6,s13,x8/15,s14,x0/10,s13,x3/1,pk/n,x6/0,s12,x5/9,pg/p,x2/12,s3,x9/0,s10,x4/7,s10,x8/10,s13,pd/i,s5,x11/15,s12,x13/14,s9,pk/f,s3,x2/3,s13,x10/9,ph/j,x13/8,pn/a,x3/2,s6,x12/8,s12,x9/3,pe/h,x10/11,pb/d,x13/12,pk/c,x15/6,s9,x7/10,pp/l,s9,pe/d,x9/12,s8,x8/13,s6,x9/1,s2,pk/l,x11/14,s10,x3/1,pp/i,s8,x4/14,s9,x2/15,s7,x13/0,pa/f,x3/6,s1,ph/m,x15/10,s9,x3/2,s1,x6/12,s14,x5/7,s8,x2/3,pp/a,x13/9,s8,x2/0,pb/f,x9/13,s13,x1/0,po/c,x5/14,s13,x4/2,s15,x13/10,s15,x4/3,s7,x6/0,s7,x1/12,pp/j,x9/7,s6,pd/f,x13/3,pb/k,x2/12,pl/n,x3/8,pm/h,x6/14,pk/f,x11/1,s11,x15/4,pc/l,s9,x3/5,s8,x4/7,s13,x6/13,po/b,x5/1,pf/k,s9,x11/3,s6,x15/6,s9,x11/8,s12,x12/1,pa/n,x9/8,pj/m,x0/2,pe/h,x5/15,pn/d,x1/10,s10,pp/m,s5,x14/9,pj/d,x2/5,pi/g,x0/7,s5,x2/15,s10,x12/11,s13,x1/4,s5,x8/6,s9,x12/1,s14,x2/13,s14,pp/b,x4/6,po/f,x15/8,pg/m,s13,x13/4,s3,x9/14,s15,x13/0,pk/b,x2/4,pe/f,s10,x6/1,pg/c,x4/5,s12,x0/10,s15,x11/5,s1,x15/3,s1,x12/1,pk/p,x5/0,s5,x7/10,s7,x1/3,pa/f,x4/13,s11,x1/2,po/i,x3/14,s9,x5/10,s12,x1/12,s6,x9/13,s5,pm/h,x2/5,pf/p,s4,x13/9,pn/i,x2/10,s11,x0/1,pf/k,x3/6,s2,x10/7,s3,x13/11,s11,x1/9,po/i,x11/4,pb/n,s7,x5/2,pa/f,x10/9,s6,x6/5,s15,x12/13,pc/p,x10/5,s7,x13/4,pk/i,s12,x8/1,s14,x3/13,pb/g,x0/1,s4,x4/15,s2,x1/0,pf/h,x9/7,pp/i,x12/15,pn/o,x11/13,s5,x14/9,s6,x11/12,pk/f,x4/3,po/e,x7/12,s1,x8/3,s3,pf/i,x4/7,pk/d,x12/10,s4,x1/14,pn/g,x9/6,pl/h,x1/5,s7,x4/11,pc/o,s2,x12/6,pn/b,x2/8,pm/e,s12,x3/14,pb/h,x5/4,pl/a,x6/2,pe/m,x9/7,s11,x4/14,s11,x0/13,pc/p,x3/15,pa/j,x1/13,pc/i,x14/11,s8,x3/9,pp/k,x15/1,s4,x11/7,pm/l,x14/3,pd/p,x1/8,s8,x10/12,pm/n,x14/7,s1,x11/8,s1,x10/12,s15,x2/4,pb/o,x13/8,pj/l,x3/9,pi/e,s5,x0/13,s12,x4/9,pk/l,s6,x3/10,pf/g,x2/6,s9,x3/11,s6,x7/5,pm/n,x12/9,s8,x8/15,s1,pc/h,s6,x14/9,s11,x4/10,pe/j,x0/12,s15,x4/14,s7,x11/15,s3,x5/14,pa/f,x4/9,pb/m,x5/10,s10,x12/3,po/g,x6/5,pk/n,x11/13,po/p,s1,x10/1,s5,pj/e,x13/0,s5,x6/11,s2,x10/7,s10,x14/3,s6,x10/11,pk/l,x7/15,s11,pb/o,x9/8,s9,x2/10,pf/p,x13/1,s11,x8/12,s4,x10/0,s13,x14/3,s13,x5/4,s8,x7/1,s6,pi/g,s11,x11/0,s4,x6/15,s7,x1/4,s5,x8/3,s13,x2/0,s2,pe/f,x7/14,s2,x4/13,pb/m,x14/15,s4,x9/12,s2,x14/11,s15,x6/15,s8,pk/i,s2,x13/4,pb/m,x2/12,pa/d,x1/14,pc/o,x6/13,pb/j,x1/8,s13,x15/10,pi/n,x2/9,s2,x10/15,s6,x8/4,s3,x2/5,pd/j,s15,x15/7,ph/e,x14/11,s5,x9/6,s10,x10/13,pa/g,x8/3,s7,x7/6,s5,x0/3,s6,x1/12,pe/c,x14/13,s3,x4/5,s1,x12/10,s6,x7/1,pi/f,x12/5,s5,x11/14,pn/o,x13/6,s3,x8/1,pl/d,s14,x13/7,s7,x6/8,pf/o,x2/11,s11,x1/10,s10,x12/9,pa/g,s7,x10/11,pn/l,x12/1,s15,x13/10,s11,x2/11,s6,x0/1,s13,x11/8,po/j,x0/5,pk/l,s14,x2/12,s13,pg/b,x8/13,pf/m,x1/6,s3,x14/12,s15,x5/9,s1,pn/o,x7/12,s6,x10/11,pl/e,x4/9,s10,pa/i,x15/5,s15,x6/4,pe/j,x5/0,s2,x7/6,s14,x9/8,pd/o,s8,x6/13,s5,x0/3,s6,x9/13,s8,x2/3,ph/m,x9/0,s13,x6/12,pe/o,x5/14,pn/j,x0/3,s1,x6/2,s9,x8/1,s15,x10/12,s1,x1/14,pd/h,x15/7,s6,x14/9,s7,x15/7,pp/n,x4/6,s12,x5/2,s2,pk/c,x14/0,s9,x9/10,s11,x13/2,s7,x15/6,s15,x14/1,s14,x11/12,s2,x15/13,pa/l,s11,x10/12,s13,x4/13,s7,x11/12,pc/g,x1/10,pd/e,x13/11,ph/l,x1/5,s5,x8/13,s10,x2/0,pd/j,x1/15,pe/p,x12/5,s11,pn/j,x0/15,po/b,x9/2,pg/a,x1/15,pj/e,x8/11,s8,x15/13,s8,x7/9,pd/i,x3/4,s2,x10/7,pf/p,x3/1,s14,x14/7,pk/n,s1,x13/8,s14,ph/f,x10/7,s13,x0/6,s5,x8/10,pg/j,x5/6,s3,pk/b,x4/14,s13,x9/0,pn/c,x4/15,po/e,x6/5,s1,x13/0,s15,x5/10,pl/i,x7/8,s5,x2/1,s10,x7/9,pm/a,x14/11,s13,x6/8,pd/j,x10/12,s10,x0/3,s8,x11/6,s3,x10/15,s8,x5/8,s2,x13/6,s9,pp/e,x9/10,s7,x11/14,pd/b,x13/5,pp/h,x3/4,s14,x1/14,pc/d,x9/10,pe/o,s4,x4/12,s3,x8/2,pi/p,x9/0,s10,x12/14,pk/j,x3/9,po/i,x0/12,s8,x9/11,pj/d,x8/14,s11,x15/4,po/l,s13,x2/9,s4,x11/15,s14,x2/5,s9,x15/4,pk/m,x13/10,pj/p,x0/8,pg/a,x10/13,pb/h,x2/0,s6,pl/m,x8/7,ph/f,x3/4,s6,x13/5,s10,x14/1,s5,x10/6,s15,x3/9,s1,x10/13,s11,pm/b,x7/3,s14,x15/13,pl/a,x2/10,pm/i,x13/8,pa/h,x15/11,s1,x10/8,pi/c,x7/2,pb/g,x15/9,pe/c,x1/3,s1,x11/14,pl/d,x0/10,s15,x3/1,s2,x6/15,ph/b,x7/12,pl/e,s11,x3/1,s10,x9/10,pf/o,x11/5,s7,x8/15,pc/k,x2/13,pa/h,x5/15,s15,x11/8,pc/b,x10/0,s9,x7/1,pg/h,x6/12,s10,x11/13,po/a,x12/1,s12,x9/11,pm/e,s2,x6/0,pa/g,x9/3,pb/n,s5,x7/1,pl/h,x11/2,s3,x5/3,pf/b,x15/0,s9,pn/e,x3/13,s10,x8/15,s15,x2/7,s15,x9/14,s11,x2/15,s12,x5/4,s5,x9/3,s5,x4/11,ph/a,x3/0,s5,x14/9,s15,pi/e,x12/13,s7,x3/0,pm/k,x12/2,s7,x6/7,s10,x2/8,po/p,x11/6,pf/h,s11,po/a,x12/13,pb/e,x14/0,s1,x13/15,pk/i,x1/9,pf/b,x13/11,s14,x14/2,pd/o,x5/15,s11,x3/1,pg/m,x10/13,s6,x14/6,pk/n,x5/9,s11,x1/13,s15,x10/15,pg/m,x3/6,s9,x15/4,s12,pn/f,x0/12,s13,x11/15,s11,x6/0,s6,pk/c,s10,x15/3,pp/n,x5/14,pb/m,x12/3,s1,x13/6,pp/c,x12/8,s10,x3/14,pa/l,x0/1,s2,x10/14,s15,x6/8,s14,x4/12,s5,x13/3,s3,x8/6,s1,x10/2,s11,x0/1,s14,x13/5,s4,x11/2,s12,x13/8,s10,x14/1,s1,x3/6,pn/j,x1/10,s7,x8/9,pc/b,x11/14,pk/p,s5,x2/10,ph/j,s2,x8/0,s6,x2/13,s3,pb/l,x7/4,po/c,x8/14,s14,x0/13,pl/h,x15/1,po/m,x9/12,ph/d,x1/4\"\"\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "test_input = \"s1,x3/4,pe/b\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from functools import lru_cache" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "@lru_cache(maxsize=None)\n", "def parse_moves(input, programs, debug=False):\n", " \"\"\"Parse moves and returns final position.\"\"\"\n", " for action in input.split(','):\n", " if action.startswith('s'):\n", " spin = int(action[1:])\n", " programs = programs[-spin:] + programs[:-spin]\n", " if debug:\n", " print(programs)\n", " elif action.startswith('x'):\n", " left, right = action[1:].split('/')\n", " left, right = int(left), int(right)\n", " first, second = programs[left], programs[right]\n", " programs = list(programs)\n", " programs[left], programs[right] = second, first\n", " programs = \"\".join(programs)\n", " if debug:\n", " print(programs)\n", " elif action.startswith('p'):\n", " left, right = action[1:].split('/')\n", " first, second = programs.index(left), programs.index(right)\n", " programs = list(programs)\n", " programs[first], programs[second] = programs[second], programs[first]\n", " programs = \"\".join(programs)\n", " if debug:\n", " print(programs)\n", " return programs" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "parse_moves(test_input, 'abcde')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "parse_moves(\"x12/6,pk/e,s1,x5/7,s6\", 'abcdefghijklmnop', debug=True)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "parse_moves(input, 'abcdefghijklmnop')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Part 2 " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here comes brute force memoized." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "len('pabcdmfkhijelgno')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import tqdm" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "current = 'abcdefghijklmnop'\n", "for _ in tqdm.tqdm_notebook(range(1000000)):\n", " current = parse_moves(input, current)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "current" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Noter to self: the brute-force method is dumb. It would have been easier to just see how the inputs and outputs are related and then to apply the sequence 1 -> 14, 2->3 etc. Repeatedly." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "first = 'abcdefghijklmnop'\n", "second = parse_moves(input, first)\n", "second" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "mapping = {}\n", "for ind, item in enumerate(first):\n", " mapping[second.index(item)] = ind" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "mapping" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "mapping_tuple = list([mapping[key] for key in range(16)])\n", "mapping_tuple" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "How long does the Python version take?" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def apply_mapping_py(programs):\n", " mapping = [3, 2, 12, 11, 7, 4, 9, 13, 8, 5, 15, 14, 10, 6, 1, 0]\n", " return \"\".join([programs[index] for index in mapping])" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "apply_mapping_py(first) == second" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%timeit apply_mapping_py(first)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "What about numpy?" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We convert the string to an array of strings." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "arr = np.array(list(first))\n", "arr" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%timeit arr[mapping_tuple]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "With an array of the mapping?" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "mapping_arr = np.array(mapping_tuple)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%timeit arr[mapping_arr]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Okay this is really fast." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "current = np.array(list(first))\n", "for _ in tqdm.tqdm(range(100000000)):\n", " current = arr[mapping_arr]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Cython maybe?" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%load_ext cython" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%cython -a\n", "from cpython cimport array\n", "import array\n", "\n", "def apply_mapping_cy(str programs):\n", " cdef array.array mapping = array.array('i', [3, 2, 12, 11, 7, 4, 9, 13, 8, 5, 15, 14, 10, 6, 1, 0])\n", " cdef str out = \"\"\n", " for index in range(len(mapping)):\n", " out += programs[mapping[index]]\n", " #return \"\".join([programs[index] for index in mapping])\n", " return out" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%timeit apply_mapping_cy(first)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 17 " ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "638" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "step = 3\n", "spinlock = [0]\n", "index = 0\n", "for val in range(1, 2018):\n", " index += step\n", " index = index % len(spinlock)\n", " spinlock.insert(index + 1, val)\n", " index = index + 1\n", "spinlock[index+1]" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[1512, 1134, 151, 2017, 638, 1513, 851]" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "spinlock[index-3:index+4]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's try again with my own value:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "180" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "step = 316\n", "spinlock = [0]\n", "index = 0\n", "for val in range(1, 2018):\n", " index += step\n", " index = index % len(spinlock)\n", " spinlock.insert(index + 1, val)\n", " index = index + 1\n", "spinlock[index+1]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## part2 " ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "import tqdm" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "c3fb2e84a2b84c0eb2e19550e33a7cfb", "version_major": 2, "version_minor": 0 }, "text/html": [ "

Failed to display Jupyter Widget of type HBox.

\n", "

\n", " If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n", " that the widgets JavaScript is still loading. If this message persists, it\n", " likely means that the widgets JavaScript library is either not installed or\n", " not enabled. See the Jupyter\n", " Widgets Documentation for setup instructions.\n", "

\n", "

\n", " If you're reading this message in another frontend (for example, a static\n", " rendering on GitHub or NBViewer),\n", " it may mean that your frontend doesn't currently support widgets.\n", "

\n" ], "text/plain": [ "HBox(children=(IntProgress(value=0, max=50000000), HTML(value='')))" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n" ] }, { "data": { "text/plain": [ "13326437" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "step = 316\n", "spinlock = [0]\n", "spinlock_len = 1\n", "index = 0\n", "next_to_zero = None\n", "for val in tqdm.tqdm_notebook(range(1, 50000001)):\n", " index += step\n", " index = index % spinlock_len\n", " if index + 1 == 1:\n", " next_to_zero = val\n", " index = index + 1\n", " spinlock_len += 1\n", "next_to_zero" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 18" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [], "source": [ "input = \"\"\"set i 31\n", "set a 1\n", "mul p 17\n", "jgz p p\n", "mul a 2\n", "add i -1\n", "jgz i -2\n", "add a -1\n", "set i 127\n", "set p 826\n", "mul p 8505\n", "mod p a\n", "mul p 129749\n", "add p 12345\n", "mod p a\n", "set b p\n", "mod b 10000\n", "snd b\n", "add i -1\n", "jgz i -9\n", "jgz a 3\n", "rcv b\n", "jgz b -1\n", "set f 0\n", "set i 126\n", "rcv a\n", "rcv b\n", "set p a\n", "mul p -1\n", "add p b\n", "jgz p 4\n", "snd a\n", "set a b\n", "jgz 1 3\n", "snd b\n", "set f 1\n", "add i -1\n", "jgz i -11\n", "snd a\n", "jgz f -16\n", "jgz a -19\"\"\"" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [], "source": [ "test_input = \"\"\"set a 1\n", "add a 2\n", "mul a a\n", "mod a 5\n", "snd a\n", "set a 0\n", "rcv a\n", "jgz a -1\n", "set a 1\n", "jgz a -2\"\"\"" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [], "source": [ "import re" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "from ipywidgets import interact" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "lines = test_input.split('\\n')" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "492fcf68697145b29c498ebf65b10b95", "version_major": 2, "version_minor": 0 }, "text/html": [ "

Failed to display Jupyter Widget of type interactive.

\n", "

\n", " If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n", " that the widgets JavaScript is still loading. If this message persists, it\n", " likely means that the widgets JavaScript library is either not installed or\n", " not enabled. See the Jupyter\n", " Widgets Documentation for setup instructions.\n", "

\n", "

\n", " If you're reading this message in another frontend (for example, a static\n", " rendering on GitHub or NBViewer),\n", " it may mean that your frontend doesn't currently support widgets.\n", "

\n" ], "text/plain": [ "interactive(children=(IntSlider(value=4, description='index', max=9), Output()), _dom_classes=('widget-interact',))" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "@interact\n", "def p(index=(0, len(lines) - 1)):\n", " m = re.match(\"(set|add|mul|mod|snd|rcv|jgz) (\\w)\\s?([-\\w\\d]+)?\", lines[index])\n", " if m is not None:\n", " print(lines[index])\n", " print(m.groups())\n", " else:\n", " print(\"not parsed:\", lines[index])" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [], "source": [ "def isdigit(s):\n", " try:\n", " int(s)\n", " is_dig = True\n", " except ValueError:\n", " is_dig = False\n", " return is_dig" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "isdigit(\"-1\")" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"-1\".isdigit()" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"-1\".isnumeric()" ] }, { "cell_type": "code", "execution_count": 24, "metadata": { "scrolled": true }, "outputs": [], "source": [ "from collections import defaultdict\n", "\n", "def until_recovered(assembly, debug=False):\n", " get_val = lambda s, registers: int(s) if isdigit(s) else registers[s]\n", " registers = defaultdict(int)\n", " played = []\n", " lines = assembly.split('\\n')\n", " index = 0\n", " while index > -1 and index < len(lines):\n", " jump = False\n", " line = lines[index]\n", " m = re.match(\"(set|add|mul|mod|snd|rcv|jgz) (\\w)\\s?([-\\w\\d]+)?\", line)\n", " assert m is not None\n", " instruction, arg1, arg2 = m.groups()\n", " if instruction == 'set':\n", " registers[arg1] = get_val(arg2, registers)\n", " elif instruction == 'add':\n", " registers[arg1] += get_val(arg2, registers)\n", " elif instruction == 'mul':\n", " registers[arg1] *= get_val(arg2, registers)\n", " elif instruction == 'mod':\n", " registers[arg1] = get_val(arg1, registers) % get_val(arg2, registers)\n", " elif instruction == 'snd':\n", " played.append(get_val(arg1, registers))\n", " elif instruction == 'rcv':\n", " if get_val(arg1, registers) != 0:\n", " recovered = played[-1]\n", " print(\"recovered\", recovered)\n", " return recovered\n", " elif instruction == 'jgz':\n", " if get_val(arg1, registers) > 0:\n", " jump = True\n", " index += get_val(arg2, registers)\n", " else:\n", " break\n", " if debug:\n", " print(registers, index)\n", " if not jump:\n", " index += 1" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "recovered 4\n" ] }, { "data": { "text/plain": [ "4" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "until_recovered(assembly=test_input)" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "recovered 7071\n" ] }, { "data": { "text/plain": [ "7071" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "until_recovered(assembly=input)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## part 2 " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now I need two parallel executions of the program. One has to wait for the other." ] }, { "cell_type": "code", "execution_count": 152, "metadata": {}, "outputs": [], "source": [ "get_val = lambda s, registers: int(s) if isdigit(s) else registers[s]\n", "\n", "class Program:\n", " def __init__(self, program_id, assembly):\n", " self.registers = defaultdict(int)\n", " self.registers['p'] = program_id\n", " self.lines = assembly.split('\\n')\n", " self.index = 0\n", " self.sent = []\n", " self.received = []\n", " \n", " def step(self, debug=False):\n", " jump = False\n", " line = self.lines[self.index]\n", " m = re.match(\"(set|add|mul|mod|snd|rcv|jgz) (\\w)\\s?([-\\w\\d]+)?\", line)\n", " assert m is not None\n", " instruction, arg1, arg2 = m.groups()\n", " if instruction == 'set':\n", " self.registers[arg1] = get_val(arg2, self.registers)\n", " elif instruction == 'add':\n", " self.registers[arg1] += get_val(arg2, self.registers)\n", " elif instruction == 'mul':\n", " self.registers[arg1] *= get_val(arg2, self.registers)\n", " elif instruction == 'mod':\n", " self.registers[arg1] = get_val(arg1, self.registers) % get_val(arg2, self.registers)\n", " elif instruction == 'snd':\n", " self.sent.append(get_val(arg1, self.registers))\n", " elif instruction == 'rcv':\n", " if len(self.received) > 0:\n", " self.registers[arg1] = self.received[0]\n", " self.received = self.received[1:]\n", " else:\n", " return None\n", " elif instruction == 'jgz':\n", " if get_val(arg1, self.registers) > 0:\n", " jump = True\n", " self.index += get_val(arg2, self.registers)\n", "\n", " if debug:\n", " print(self.registers, self.index)\n", " if not jump:\n", " self.index += 1\n", " return 0" ] }, { "cell_type": "code", "execution_count": 153, "metadata": {}, "outputs": [], "source": [ "test_input2 = \"\"\"snd 1\n", "snd 2\n", "snd p\n", "rcv a\n", "rcv b\n", "rcv c\n", "rcv d\"\"\"" ] }, { "cell_type": "code", "execution_count": 154, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3" ] }, "execution_count": 154, "metadata": {}, "output_type": "execute_result" } ], "source": [ "program0 = Program(0, assembly=test_input2)\n", "program1 = Program(1, assembly=test_input2)\n", "program1_counter = 0\n", "\n", "while True:\n", " data_was_sent = False\n", " retval1 = 0\n", " while retval1 is not None:\n", " retval1 = program0.step()\n", " if len(program0.sent) > 0:\n", " program1.received = program0.sent[:]\n", " program0.sent.clear()\n", " data_was_sent = True\n", " retval2 = 0\n", " while retval2 is not None:\n", " retval2 = program1.step()\n", " if len(program1.sent) > 0:\n", " program1_counter += len(program1.sent)\n", " program0.received = program1.sent[:]\n", " program1.sent.clear()\n", " data_was_sent = True\n", " if not data_was_sent:\n", " break\n", "\n", "program1_counter" ] }, { "cell_type": "code", "execution_count": 155, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "8001" ] }, "execution_count": 155, "metadata": {}, "output_type": "execute_result" } ], "source": [ "program0 = Program(0, assembly=input)\n", "program1 = Program(1, assembly=input)\n", "program1_counter = 0\n", "\n", "while True:\n", " data_was_sent = False\n", " retval1 = 0\n", " while retval1 is not None:\n", " retval1 = program0.step()\n", " if len(program0.sent) > 0:\n", " program1.received = program0.sent[:]\n", " program0.sent.clear()\n", " data_was_sent = True\n", " retval2 = 0\n", " while retval2 is not None:\n", " retval2 = program1.step()\n", " if len(program1.sent) > 0:\n", " program1_counter += len(program1.sent)\n", " program0.received = program1.sent[:]\n", " program1.sent.clear()\n", " data_was_sent = True\n", " if not data_was_sent:\n", " break\n", "\n", "program1_counter" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 19 " ] }, { "cell_type": "code", "execution_count": 188, "metadata": {}, "outputs": [], "source": [ "input = \"\"\"\n", " | \n", " +-------+ +---------------------+ +-----------+ +---------------------------------------+ | +-+ \n", " | | | | | | | | | | | \n", " | | +---------------|---------------------|-----------------------------------------------------------------------------+ +---------------------+ | | \n", " | | | | | | | | | | | | | | | \n", " | +-----------------+ +---+ +-----------+ | | | | +-------------+ | | | | | | \n", " | | | | | | | | | | | | | | | | | | | \n", " | | | +-|---------|-----------|---------+ +-----------+ | +-----------------------------|-------+ | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | +---+ | +-------------------------------|-------------------------------------|-----------------------------+ | | | +-------------+ | \n", " | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | +-|-----|---|---------------------------|-----------+ | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | +-----|-----+ | | | +-------|---|-------+ | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | +-|-------------------------+ +---------|-------|---------------------------------------|---------|-------------------|-+ +-+ | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | +-|-------------|-----|-----------------------+ | | | | | | | | | | | +-|-+ | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | +-----|-------|-------------|-------------------|---------+ | | +-------------|---------|I|-------------------------+ | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | +-----------+ | | +-----|------C------------------------------------+ | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | +-------|---------|-----|---------------|-|-------------|---------+ | | | +---|-------+ | | +---------|-----+ | | +-+ | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | +-------|-|-----|---|-----|---------------------|---------|---------|-------------|---+ | | | | | | | | | | | | +---+ | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | +-------------------|-|---------------------+ | +-----------------------|-----------------|---|---------------------|-----------------------------------------|-|-------|-+ | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | +---------------|---------|N--------------|-----+ | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | +-----------+ | | | +---|-----|-----------------|---+ | | | +-|---|-------------------|---------|---------|-----|---|-----------------|-|-|---+ | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | +-------|-|---+ | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | +-+ | | | | | | | +-------------------|---------+ | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " +---|-------|---------------|---|-|-----------+ | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | +---|-+ | | | | | | +-+ | | | +-+ | +-------------------------|-----------------------|-----------------|---+ | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | +-------|-------------|---------------|-------------|-------------------|-------------------+ | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | +-------|-----|-------+ | | | | | | | | | | | | | | | | | | | | | | | | | +-+ | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | +---------|---------------|---------|-----------|-----------------------------|-------------|---------|---------------|-|-----------|---+ | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | +-----|-|-----|-----|-----|-------+ | | | | | | | | +-----------------------+ | | | | | | | | | +-------+ | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | +-----------------------------------|---|-------------|---------|-----|-------------------------------|-+ +-+ | \n", " | | | | | | | | | | | | | | | | | | | | | | O | | | | | | | | | | | | | | \n", " | | | | +-------|-------|-----------|-------|-------------|-----|---|-|-------|---------|---|-------------------|-----------------------------|-----------------+ | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | +-+ | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | +---|-|-----|-----|-|--R|-------|-------------|---|---------------|-------------|-------|-|---------|---------|---|---------|---------|-----------------|-|-----------|-+ | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | +-----+ | | | | | | | | | | | | | | | | +---------------------------|-------------------|-----------------------+ | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | +-----------|-------|-|-------|-------|-----------|-------|-------|-------------|---------------------------------+ | +-------+ | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | +-----|-------|---------|-----------|---|-----|-------------|-|---------------------------------+ | | | | | | | +-----|-------|---+ | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | +---------------|-------|S------|---|-----+ | | | | | | | | | | +-------|---------|---------|---------|---|-------+ +---------|-------------+ | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | +-----------------|-----|-------|-------------|-----|---|---|-----|-|-----------|-------|-|-----|---|-|-+ | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | +-------------|-------------|-|---|-------|-------------|---------|-------------------------------|-------|-------------|-------+ | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | +-|---|-|-----|-|---------------|-------|-----------|-------------------|-------------|-|---------------------|-----|---|-|-------|-------|---|---------+ | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | +---------|-----|-|-------+ | | | | | | | | | | | | | | | +-------------|-----------------|-----+ | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | +-|---|---|---------|-------|-------------------------------------------------|---|-----+ | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-|-|-----------|-------------------+ | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | +---+ | | | | | | | +-+ | | | | +-+ +---|-|---|-------|-----|-|-------------|-----------|---|---------|-|-------|-----|---------|-------------|-+ \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-------|-------|-----+ \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " +---|-|-|---|-------|-|-----|---------|-----|-----|---|---+ | | | | | | | +-|-|---|-------|-----|---|-----------|---+ | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | +-------|-----|-|-----|-----|---|-----------|-------------------|-|---|-----|-----|-+ | | | | | | | | +-----------|---|-------+ | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | +-+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | +-----|-------|-|---|-|-+ | +-----|---------------------|-----|---|-----|-----|---|-|---|-------------------------+ | | | +-------|---|-|-|---|-----+ | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | +-------------------|---------------------------|---------+ +---|-----------+ +-|-+ | +-------|-+ | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | +---------------|---------------------------------------------+ | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | +---|---|---|-----------------|-----|-----------|-|---------------|-|---+ | | | | | +-|-------+ \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " +---|-----|---|-|-----|-|-----|-----|--U--------|---|-----------------------+ | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | +-----------+ | | | | | | | | | | | | | | | +-----+ | +---|-+ | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | +-----|---|-|---------|---|-|-|-+ | | | | | | | | | | | | | +---+ | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | +-----------------+ | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | +---|-|D--|-------+ +---------|---|---------|-----|-----|---------|---|-|---+ | | | | | | +-|---------------|---------------|-|---------|-|---|-------+ | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | +---|---|-|-|-------------------|-----------------------+ | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | +---|-------|---+ +-------|-|---|---------|-----+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | +---|-----|---+ | | | | | +---------------------------------------|-|-|-|-|-|---|-----------------|-----|-------------|---------------------------+ | | +-----|-----|-------+ | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | +---|-+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | +-------------|---------|---|-------|---|-|-|---|---|-----------------|-----|---------|-----------------------|-------|---|-----|-------|---|-+ | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | +---|-|---------|-----------------|---------|---------|-|-----+ | | | | | | | | | | | | | | | | | | | | +-----------|-----+ | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | +-|-|---|-|-----+ | | | | +-----------|-------|---|---|-+ +-------|-----|-----|-+ | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | +---------------|---|---------|-|-----|-|-|-------------------|---------------|---|---------------|-|-|---|-------|-----+ | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | +-|-|-------------------|-----|---------------+ +-----------|-|---------|-------|---------|---|-----|-+ | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | +-----------+ | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | +---------|---|-|---|---------+ | | | | | | +-------|-|---------------|---------------------------|---|-----------------|-----+ | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | +-------+ | | | | | | | | +---------------------------|-------------|---|---------------|---------------------------------------------------|---------------|-|-----------------|-+ | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | +-----|-|---|-----------------------------------------|-------------------|-|-------------------+ | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | +-|---------------|-------------|---|-------|-|---|-----|---+ \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | +-------|---|-|---------------------------|---|---------------|---|---------|-----------|-------------------------|---------|-----|-+ | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | +---|-----------|-------------+ | | | | | | | | | | | | | | | | +-------------|-------------|---------+ | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | +-----|---+ | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | +-|-----|---|---------------------|---------------|-|-|---------|---|-|---|---------------------------|-----------------------|-----------------|-------------|-|-+ | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | +-----------------------------------|-+ | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | +---------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | +---------------------------------|---------------+ | | +---------------|-----------------------|-----|-|---------|---------------|-----------|-|-+ \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | +-------------|-|-----------------------+ | +-----|---------|-----------------|-----|-+ | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | +---|-|-------|-|-------------------------|-----|-------------|-----------|---|-----+ | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | +-----------------|-----------|-------------------|-|---------------|---------|-|-----------------|-|---------|---|-----+ | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | | | | | | +-----|-----------|-|---------|---|-----|-+ | | +-------|---------|---------------------------------------|-----|---+ | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | +-----|-------+ | +---|---+ | | | | | | | | | | | | | | +-|---------------|-------|-------------------------|-----|-|---+ | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | +-----|-----------------|-|---|-----------------|---------|---------|-------------|---|---------------|-|-------|-----|-----------|-----|-------------|-----------|---|-----+ | | +-----+ | +-+ \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | +-------|-+ +-|-+ | | | | | | | | | | | | | | | | | | | | | | | | +-+ | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | +-|-----------------------------------------|-------------|-+ +-|-------------+ | | | | | | | +-------------|-----------|-----|---|---|-|---|-|-|---|---+ \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | +-------------------------|-----------------------|---------|-----------|-|-|-----------|-+ | | | | +-----------|-|-----------------------------------------|---|-|---|---|-|---|-|-|---+ | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | +---------|-----|-|---+ | | | | | +-----------|-------------|-------|-------------|---------|-|---------+ | | | | | | | | | | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | +---------------------|-----|-------------------|---------|-----------|---------------|-----|---------|---------------+ | | | +-----+ | | | | | | | +-----|-----+ | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " +-+ | +---------------+ +---------------------------------------------|---+ | | | | | | | | | | | +-------|---------------------------+ +-------+ | +-+ | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " +-----+ +---------------------------------------------------|-----------+ | | +-------------------|-------|---------+ | | | | | | | | +-------|---+ | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | +-----+ +-----------|-|-----------------|-------------------+ | | +---|-------------+ +-----------------|---------------|-------------------+ | | +-+ | +-+ | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " +-+ +-----------|---------------|-------------------+ | | | +---|---|-------------------|-|-----------|---|-----------|-+ | | | | | | | | +-+ \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | +-------------|-----------------|-----------------------------------------------------|-|---|---|-------|-|-------------|---------------------------------|---------|---|---------------|-+ | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | +-----------|-----------------|---------------------------|-----------------------------------|---|---|-|-|-------------------+ | | | | | | | +-+ | | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | | | | | +-------|---|---|-+ | +-+ | | +---------|---|---+ | +-------+ | | | \n", " | | | | | | | | | | | | | | | | | | | | | | | \n", " | | | +-------------------------------------------------------------|---|-------|-----------------------|-----+ +-+ | | | +-----------+ | \n", " | | | | | | | | | | | | | | | | | \n", " +-|-------------------------------------+ | +-----+ +---+ +---+ +---------------+ +-+ +-------------|---------------------------+ | \n", " | | | | | | | | | | | \n", " | | +-------------+ +---+ +---------------------------------------------------------------------------------------|---------------|-------------|-------------+ | \n", " | | | | | | | | | \n", " +-----------------------------------------------------------------------------------------------------------------------------------------------+ K-+ +-------------+ | \n", " | | | | \n", " +---+ +-------------------------------------------------------------------------------------------------------------------------------------------------------+ \n", " \"\"\"" ] }, { "cell_type": "code", "execution_count": 189, "metadata": {}, "outputs": [], "source": [ "test_input = \\\n", "\"\"\"\n", " | \n", " | +--+ \n", " A | C \n", " F---|----E|--+ \n", " | | | D \n", " +B-+ +--+ \"\"\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Idea: change directions only when encountering a \"+\"." ] }, { "cell_type": "code", "execution_count": 194, "metadata": {}, "outputs": [], "source": [ "def get_symbol(lines, rc_coords):\n", " return lines[rc_coords[0]][rc_coords[1]]" ] }, { "cell_type": "code", "execution_count": 217, "metadata": { "scrolled": false }, "outputs": [], "source": [ "def travel(input, start):\n", " lines = input.split(\"\\n\")[1:]\n", " current = start\n", " direction = (1, 0)\n", " steps = 0\n", " while True:\n", " if get_symbol(lines, current) == '+':\n", " if direction in [(1, 0), (-1, 0)]:\n", " # new direction should be horizontal\n", " try:\n", " if get_symbol(lines, (current[0], current[1] + 1)) != ' ':\n", " direction = (0, 1)\n", " else:\n", " direction = (0, -1)\n", " except IndexError:\n", " direction = (0, -1)\n", " elif direction in [(0, 1), (0, -1)]:\n", " # new direction should be vertical\n", " try:\n", " if get_symbol(lines, (current[0] +1, current[1])) != ' ':\n", " direction = (1, 0)\n", " else:\n", " direction = (-1, 0)\n", " except IndexError:\n", " direction = (-1, 0)\n", " current = (current[0] + direction[0], current[1] + direction[1])\n", " steps += 1\n", " if current[0] >= len(lines) or current[0] < 0:\n", " break\n", " elif current[1] >= len(lines[0]) or current[1] < 0:\n", " break\n", " elif get_symbol(lines, current) == ' ':\n", " break\n", " if get_symbol(lines, current) not in '|-+':\n", " print(get_symbol(lines, current), end='')\n", " print()\n", " print(steps)" ] }, { "cell_type": "code", "execution_count": 218, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "ABCDEF\n", "38\n" ] } ], "source": [ "travel(test_input, start=(0, 5))" ] }, { "cell_type": "code", "execution_count": 219, "metadata": {}, "outputs": [], "source": [ "lines = input.split(\"\\n\")[1:]" ] }, { "cell_type": "code", "execution_count": 220, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "163" ] }, "execution_count": 220, "metadata": {}, "output_type": "execute_result" } ], "source": [ "lines[0].index('|')" ] }, { "cell_type": "code", "execution_count": 221, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "UICRNSDOK\n", "16064\n" ] } ], "source": [ "travel(input, start=(0, 163))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 20 " ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "input = \"\"\"p=<-3770,-455,1749>, v=<-4,-77,53>, a=<11,7,-9>\n", "p=<1430,195,-903>, v=<-123,60,20>, a=<5,-5,1>\n", "p=<-2964,-3029,2594>, v=<-8,157,7>, a=<9,-3,-8>\n", "p=<-6383,-4277,-3529>, v=<29,70,67>, a=<16,7,5>\n", "p=<3458,4134,-3451>, v=<-12,-132,64>, a=<-9,-2,5>\n", "p=<-702,5382,6208>, v=<-68,-45,-132>, a=<7,-12,-8>\n", "p=<2353,-1261,-747>, v=<-37,8,-40>, a=<-4,3,5>\n", "p=<481,6074,-5911>, v=<-64,-51,159>, a=<3,-9,2>\n", "p=<-3084,-2792,1033>, v=<-29,43,15>, a=<8,3,-3>\n", "p=<-325,1951,-7399>, v=<-86,50,47>, a=<6,-7,12>\n", "p=<4170,-2482,2893>, v=<-135,-63,-125>, a=<0,9,2>\n", "p=<8851,1021,-4299>, v=<-30,-80,-69>, a=<-16,3,13>\n", "p=<543,6446,4505>, v=<62,-175,-1>, a=<-5,-2,-9>\n", "p=<-263,-715,-7368>, v=<56,-8,142>, a=<-3,2,6>\n", "p=<4127,-3461,1895>, v=<-62,-20,-9>, a=<-6,10,-4>\n", "p=<5681,1033,-3439>, v=<13,-79,22>, a=<-15,3,7>\n", "p=<767,543,-5161>, v=<0,40,-47>, a=<-2,-4,16>\n", "p=<585,-2411,1951>, v=<-95,-14,-69>, a=<5,7,0>\n", "p=<4505,-2033,6515>, v=<-148,-42,-116>, a=<-1,8,-8>\n", "p=<991,-3405,1951>, v=<-37,94,-69>, a=<0,2,0>\n", "p=<1215,-3055,-3957>, v=<129,-20,55>, a=<-12,9,6>\n", "p=<-2495,6955,215>, v=<44,-131,22>, a=<3,-8,-2>\n", "p=<1285,3567,-2123>, v=<141,-68,-25>, a=<-13,-4,7>\n", "p=<2188,2627,722>, v=<-47,11,-5>, a=<-1,-5,-1>\n", "p=<-5326,5738,-4021>, v=<104,7,82>, a=<3,-10,2>\n", "p=<-2181,6826,-621>, v=<64,-60,17>, a=<0,-8,0>\n", "p=<5758,-7199,8049>, v=<58,-50,-168>, a=<-13,15,-4>\n", "p=<1117,4157,1283>, v=<37,-139,66>, a=<-4,1,-6>\n", "p=<-14268,1301,-3341>, v=<122,-125,62>, a=<17,5,2>\n", "p=<-1110,-2830,-1607>, v=<120,14,-59>, a=<-5,4,6>\n", "p=<-736,-4513,5958>, v=<39,11,-159>, a=<-1,7,-1>\n", "p=<3174,2117,-13218>, v=<-6,26,160>, a=<-5,-5,13>\n", "p=<13952,-4292,450>, v=<-148,22,3>, a=<-15,6,-1>\n", "p=<-6015,3481,5912>, v=<77,-68,-198>, a=<8,-3,0>\n", "p=<6270,1846,152>, v=<-38,2,25>, a=<-11,-4,-2>\n", "p=<3600,-1784,-3433>, v=<-42,61,67>, a=<-5,0,3>\n", "p=<5985,-4319,5207>, v=<-75,6,27>, a=<-8,9,-13>\n", "p=<-5775,2866,-733>, v=<-55,-125,8>, a=<16,2,1>\n", "p=<1020,2536,-598>, v=<13,-114,19>, a=<-3,2,0>\n", "p=<3555,5322,-2095>, v=<-41,-30,75>, a=<-6,-11,0>\n", "p=<-1177,4790,1699>, v=<41,-11,70>, a=<0,-11,-9>\n", "p=<-3193,-3078,-3243>, v=<113,-49,0>, a=<0,11,8>\n", "p=<3639,-768,1307>, v=<-44,-59,26>, a=<-6,6,-5>\n", "p=<3107,1458,-3733>, v=<-112,50,-26>, a=<0,-7,11>\n", "p=<3415,-1552,-1983>, v=<-123,-31,-16>, a=<0,6,6>\n", "p=<1651,-1118,-5777>, v=<-60,-3,47>, a=<0,3,11>\n", "p=<-3529,1500,1867>, v=<-20,-111,35>, a=<10,4,-7>\n", "p=<-3865,-4044,-4405>, v=<137,145,56>, a=<0,0,7>\n", "p=<5263,-2294,-6225>, v=<-44,39,121>, a=<-10,3,7>\n", "p=<-721,-1274,2648>, v=<40,56,-29>, a=<-1,-1,-3>\n", "p=<4130,904,2813>, v=<-56,-61,34>, a=<-4,2,-7>\n", "p=<1160,3643,-3391>, v=<-34,-42,69>, a=<0,-4,2>\n", "p=<-2272,-4178,3374>, v=<19,25,-102>, a=<3,6,0>\n", "p=<5516,-4904,-520>, v=<-98,13,-120>, a=<-4,8,8>\n", "p=<1127,1663,4034>, v=<1,-101,-37>, a=<-2,3,-5>\n", "p=<-358,-2396,-1246>, v=<-22,90,-30>, a=<2,-1,4>\n", "p=<3965,-6356,-4645>, v=<0,6,-148>, a=<-7,11,17>\n", "p=<-2731,11,9>, v=<225,-62,-43>, a=<9,11,8>\n", "p=<454,1126,-286>, v=<-99,-69,47>, a=<10,-8,-3>\n", "p=<509,-819,109>, v=<0,98,2>, a=<-9,-3,-2>\n", "p=<1194,771,14>, v=<-74,-61,-16>, a=<-8,-3,3>\n", "p=<2545,1808,1212>, v=<-183,-93,17>, a=<5,0,-8>\n", "p=<493,-1764,-1809>, v=<-15,-75,86>, a=<-1,17,1>\n", "p=<-4751,1143,965>, v=<91,52,-30>, a=<16,-11,-2>\n", "p=<1272,1295,1098>, v=<-56,-66,-37>, a=<-1,0,-2>\n", "p=<2786,-538,-770>, v=<-7,-3,-14>, a=<-4,1,2>\n", "p=<-329,-1623,-2065>, v=<10,-98,-31>, a=<0,8,5>\n", "p=<-1554,3522,-9275>, v=<171,-11,13>, a=<-7,-5,14>\n", "p=<-259,2717,-385>, v=<-28,12,29>, a=<2,-5,-1>\n", "p=<6601,-3303,1645>, v=<-62,-32,79>, a=<-7,7,-7>\n", "p=<8316,2927,6405>, v=<-3,-12,-147>, a=<-13,-4,-2>\n", "p=<4781,2647,14805>, v=<-28,-94,-81>, a=<-6,1,-19>\n", "p=<-5614,-3618,-560>, v=<107,13,-56>, a=<3,5,4>\n", "p=<3346,1597,5880>, v=<-59,170,48>, a=<-2,-12,-12>\n", "p=<-749,-654,1454>, v=<33,63,-141>, a=<7,0,-1>\n", "p=<-49,-659,-241>, v=<-15,3,-21>, a=<3,11,8>\n", "p=<-234,-674,1524>, v=<9,65,-137>, a=<2,0,-3>\n", "p=<-179,306,749>, v=<42,-44,-65>, a=<-5,2,-2>\n", "p=<-2410,-1167,-3859>, v=<130,55,7>, a=<-3,-1,9>\n", "p=<-6946,-2833,-289>, v=<2,100,-77>, a=<17,0,6>\n", "p=<1860,1927,103>, v=<-66,17,112>, a=<0,-6,-8>\n", "p=<656,5651,-5063>, v=<-23,-145,50>, a=<0,-4,9>\n", "p=<1314,-187,-2865>, v=<113,-38,-14>, a=<-11,3,8>\n", "p=<1986,-1027,-2207>, v=<-56,-8,6>, a=<-1,3,5>\n", "p=<-2914,1059,-779>, v=<61,-39,13>, a=<3,0,1>\n", "p=<-1458,-705,173>, v=<9,53,66>, a=<3,-2,-5>\n", "p=<-8834,7793,-285>, v=<116,-10,8>, a=<6,-10,0>\n", "p=<-75,-5336,5073>, v=<22,4,-16>, a=<-1,7,-6>\n", "p=<-1842,478,3819>, v=<88,85,95>, a=<-2,-5,-10>\n", "p=<3269,4126,608>, v=<12,-50,4>, a=<-5,-3,-1>\n", "p=<-1500,-1042,-1729>, v=<40,8,46>, a=<0,1,0>\n", "p=<-4996,4563,3629>, v=<54,-81,22>, a=<4,-2,-6>\n", "p=<-2051,6938,-2299>, v=<-4,-46,61>, a=<3,-7,0>\n", "p=<-1329,3670,4066>, v=<55,1,-87>, a=<-1,-5,-1>\n", "p=<-992,-1369,120>, v=<-12,62,112>, a=<5,0,-10>\n", "p=<-3038,1557,780>, v=<58,-25,13>, a=<7,-4,-4>\n", "p=<878,1106,-4698>, v=<64,-39,147>, a=<-9,-1,6>\n", "p=<-915,-2502,-2355>, v=<-27,125,75>, a=<6,-1,3>\n", "p=<-750,292,1616>, v=<0,-94,-25>, a=<3,7,-4>\n", "p=<1791,853,-727>, v=<-127,-39,-68>, a=<4,0,9>\n", "p=<-860,3548,3222>, v=<51,-12,-29>, a=<-1,-13,-10>\n", "p=<-3016,1557,5037>, v=<126,67,-123>, a=<1,-12,-9>\n", "p=<-992,633,208>, v=<103,40,108>, a=<-5,-6,-10>\n", "p=<-2863,-3533,-1419>, v=<114,-118,78>, a=<-1,16,-2>\n", "p=<-7126,-923,-752>, v=<36,2,-5>, a=<14,2,2>\n", "p=<-456,2383,-4667>, v=<-14,-82,25>, a=<2,0,9>\n", "p=<-4835,6095,2873>, v=<2,-75,-100>, a=<11,-9,0>\n", "p=<4619,-4432,-85>, v=<-9,18,47>, a=<-10,9,-3>\n", "p=<3053,904,-2666>, v=<-105,-136,46>, a=<0,7,3>\n", "p=<-2544,962,-3971>, v=<-2,-3,76>, a=<6,-2,4>\n", "p=<-166,1832,1887>, v=<51,-18,-126>, a=<-3,-3,4>\n", "p=<-2747,-1503,872>, v=<65,-23,44>, a=<2,5,-5>\n", "p=<501,208,-2637>, v=<-17,-7,60>, a=<0,0,2>\n", "p=<-140,-1564,228>, v=<-74,92,-2>, a=<12,4,-2>\n", "p=<-413,2232,-708>, v=<122,-130,14>, a=<-13,-6,6>\n", "p=<1381,724,1905>, v=<-16,-35,-54>, a=<-13,-3,-13>\n", "p=<-1160,-3258,578>, v=<-35,67,-73>, a=<8,8,4>\n", "p=<3838,1131,2216>, v=<-97,1,-96>, a=<-8,-5,-1>\n", "p=<-1496,-486,-1942>, v=<-8,-10,47>, a=<7,3,4>\n", "p=<60,301,-439>, v=<-6,-36,13>, a=<0,2,1>\n", "p=<-1310,1011,2191>, v=<31,-61,-171>, a=<3,1,6>\n", "p=<1380,1891,-939>, v=<-30,-21,101>, a=<-4,-7,-5>\n", "p=<-380,2051,1>, v=<-5,-92,-9>, a=<2,-1,1>\n", "p=<760,-3939,-1019>, v=<-104,92,105>, a=<6,10,-5>\n", "p=<-2230,-4779,811>, v=<35,218,24>, a=<7,2,-6>\n", "p=<740,-2819,1341>, v=<2,-6,-13>, a=<-4,14,-5>\n", "p=<8674,1471,562>, v=<-215,-112,-51>, a=<-4,4,2>\n", "p=<10069,9376,4871>, v=<-116,-175,2>, a=<-13,-8,-10>\n", "p=<2288,1130,-2724>, v=<-41,59,23>, a=<-2,-6,4>\n", "p=<-2160,-2895,-1731>, v=<70,125,-8>, a=<0,-2,4>\n", "p=<2800,-601,3074>, v=<102,-13,-115>, a=<-12,2,1>\n", "p=<2893,-2554,5089>, v=<-109,18,-100>, a=<1,4,-4>\n", "p=<-7802,5103,-1359>, v=<44,-117,-100>, a=<13,-3,9>\n", "p=<2366,-2430,625>, v=<84,62,-100>, a=<-10,1,5>\n", "p=<1715,112,7600>, v=<-87,-20,-149>, a=<2,1,-6>\n", "p=<-2439,2871,-987>, v=<-49,3,176>, a=<8,-6,-9>\n", "p=<-2594,6436,-5079>, v=<4,-160,-60>, a=<5,-3,14>\n", "p=<-1181,742,-1682>, v=<-49,5,-3>, a=<6,-2,4>\n", "p=<-2718,-476,638>, v=<79,62,22>, a=<1,-3,-3>\n", "p=<5199,-4681,0>, v=<1,87,29>, a=<-12,5,-2>\n", "p=<2937,-2448,-1740>, v=<-116,115,-46>, a=<1,-2,7>\n", "p=<588,-911,3712>, v=<-65,-28,-84>, a=<3,4,-3>\n", "p=<762,-911,-725>, v=<64,32,-66>, a=<-6,0,6>\n", "p=<743,-2261,753>, v=<-140,54,36>, a=<9,4,-6>\n", "p=<963,2480,-4505>, v=<80,-12,114>, a=<-11,-9,8>\n", "p=<-1325,-5495,-1997>, v=<23,40,-23>, a=<3,18,10>\n", "p=<2074,742,-4241>, v=<41,-94,148>, a=<-12,5,4>\n", "p=<-2722,1655,-1711>, v=<6,-9,56>, a=<10,-6,2>\n", "p=<166,-634,-1439>, v=<46,28,87>, a=<-9,3,5>\n", "p=<1102,-2008,211>, v=<-97,162,-57>, a=<1,0,6>\n", "p=<358,86,739>, v=<-35,7,-49>, a=<1,-3,-2>\n", "p=<958,14,-1175>, v=<19,0,65>, a=<-15,-1,5>\n", "p=<1036,-1708,1081>, v=<-85,98,-45>, a=<0,6,-7>\n", "p=<190,-208,205>, v=<-8,12,28>, a=<-1,0,-7>\n", "p=<1018,-412,91>, v=<-77,29,-21>, a=<-1,0,2>\n", "p=<1168,566,-1685>, v=<8,-85,88>, a=<-16,5,8>\n", "p=<-254,-1354,1465>, v=<146,36,-103>, a=<-19,11,-3>\n", "p=<-5599,-2221,740>, v=<70,-8,-20>, a=<5,4,0>\n", "p=<3536,-6631,-1115>, v=<-11,64,-39>, a=<-5,7,4>\n", "p=<-804,-5406,6830>, v=<-13,-43,-14>, a=<2,11,-10>\n", "p=<-5004,1069,-3880>, v=<35,6,76>, a=<6,-2,2>\n", "p=<-6439,3344,-2130>, v=<22,-23,-118>, a=<9,-4,10>\n", "p=<-11864,-8801,-4055>, v=<141,18,27>, a=<11,13,5>\n", "p=<6301,4429,2805>, v=<0,108,-7>, a=<-10,-13,-4>\n", "p=<-3359,-4811,-11895>, v=<6,120,53>, a=<5,1,16>\n", "p=<-6474,1279,-4265>, v=<-49,-54,-3>, a=<13,1,7>\n", "p=<7421,-4076,4380>, v=<-122,27,20>, a=<-5,5,-8>\n", "p=<229,10,429>, v=<62,-8,43>, a=<-11,1,-11>\n", "p=<60,-120,338>, v=<5,51,64>, a=<-1,-6,-13>\n", "p=<463,-1017,-1001>, v=<-26,-41,76>, a=<-1,17,0>\n", "p=<-954,2298,-975>, v=<76,-79,109>, a=<0,-14,-5>\n", "p=<-2475,1180,-819>, v=<144,-98,-1>, a=<7,1,9>\n", "p=<-889,1648,-546>, v=<85,-78,55>, a=<-2,-7,-2>\n", "p=<151,2064,1495>, v=<-86,-117,-109>, a=<11,-6,-1>\n", "p=<-2241,10,936>, v=<140,-29,-80>, a=<5,4,1>\n", "p=<21,-133,611>, v=<22,-39,-62>, a=<-3,7,2>\n", "p=<-3131,229,765>, v=<47,-52,-62>, a=<15,4,2>\n", "p=<1629,-893,3145>, v=<-80,50,-94>, a=<-2,0,-10>\n", "p=<1340,1912,-1377>, v=<-27,-88,64>, a=<-6,-3,2>\n", "p=<3040,1963,2261>, v=<-118,-19,-96>, a=<-7,-11,-4>\n", "p=<-1193,195,-1649>, v=<59,-50,-64>, a=<1,4,18>\n", "p=<-487,-1545,572>, v=<65,64,-27>, a=<-4,3,-1>\n", "p=<975,138,-40>, v=<-12,19,27>, a=<-5,-3,-3>\n", "p=<1204,154,-678>, v=<-119,-22,66>, a=<-1,1,0>\n", "p=<64,1744,462>, v=<-27,-82,29>, a=<3,-17,-14>\n", "p=<-536,1289,897>, v=<22,-119,-20>, a=<5,-2,-13>\n", "p=<-349,-2111,-1389>, v=<39,101,51>, a=<-2,1,2>\n", "p=<-349,3988,112>, v=<59,-130,-48>, a=<-4,-8,4>\n", "p=<392,-933,-439>, v=<-20,19,31>, a=<0,3,-1>\n", "p=<-919,2297,-1522>, v=<-11,-71,58>, a=<6,-5,2>\n", "p=<1551,-3821,758>, v=<-91,21,48>, a=<1,18,-9>\n", "p=<1171,3475,1860>, v=<-11,-113,-90>, a=<-5,-7,-1>\n", "p=<2748,-819,1955>, v=<-44,63,45>, a=<-10,-2,-15>\n", "p=<-15077,2445,7629>, v=<66,-67,22>, a=<18,0,-12>\n", "p=<2017,6737,155>, v=<-35,-145,-61>, a=<-1,-2,3>\n", "p=<-4902,4850,-2879>, v=<19,-37,192>, a=<6,-5,-6>\n", "p=<-12265,4554,5927>, v=<85,-67,-46>, a=<13,-3,-6>\n", "p=<-7492,-774,-1473>, v=<-63,1,-131>, a=<14,1,9>\n", "p=<-5309,1890,-3064>, v=<-27,-33,83>, a=<9,-1,0>\n", "p=<5458,-2069,-8947>, v=<43,74,-24>, a=<-10,-1,14>\n", "p=<-584,4972,5510>, v=<86,-83,-81>, a=<-4,-4,-5>\n", "p=<2287,5302,9107>, v=<-69,-76,-54>, a=<0,-5,-13>\n", "p=<-122,6556,3101>, v=<-13,5,-25>, a=<1,-12,-4>\n", "p=<967,-2057,2540>, v=<39,79,60>, a=<-4,-1,-8>\n", "p=<4993,2365,494>, v=<-117,132,3>, a=<-2,-12,-1>\n", "p=<43,-2354,-2773>, v=<-18,20,34>, a=<1,3,3>\n", "p=<-2234,847,4487>, v=<-119,-9,-16>, a=<11,-1,-7>\n", "p=<4440,409,-5661>, v=<24,-48,10>, a=<-8,2,8>\n", "p=<-8268,-167,-423>, v=<7,5,-6>, a=<12,0,1>\n", "p=<-4596,-2381,5949>, v=<-132,-26,-146>, a=<14,5,-1>\n", "p=<561,-1562,-1060>, v=<93,64,46>, a=<-16,5,3>\n", "p=<1236,658,1385>, v=<-56,36,-45>, a=<-3,-10,-6>\n", "p=<-1674,-962,-145>, v=<18,128,-23>, a=<12,-8,4>\n", "p=<381,-1532,200>, v=<-7,46,-46>, a=<-2,7,4>\n", "p=<66,-1307,-1060>, v=<-34,55,14>, a=<4,4,7>\n", "p=<-609,718,1715>, v=<147,-40,13>, a=<-13,-1,-16>\n", "p=<-339,-347,-1135>, v=<25,23,19>, a=<0,0,7>\n", "p=<1401,523,1850>, v=<-11,-19,-68>, a=<-10,-2,-7>\n", "p=<-3880,-4930,-4999>, v=<3,159,126>, a=<6,-1,1>\n", "p=<-6995,-2690,181>, v=<110,77,-4>, a=<5,0,0>\n", "p=<5395,-4055,13376>, v=<26,-46,-183>, a=<-10,9,-11>\n", "p=<-5280,2770,6446>, v=<169,65,-39>, a=<-1,-8,-8>\n", "p=<110,-2305,321>, v=<-75,-6,64>, a=<4,4,-4>\n", "p=<-3229,-920,1526>, v=<-23,33,-53>, a=<9,0,0>\n", "p=<918,1603,1410>, v=<44,36,-64>, a=<-5,-6,1>\n", "p=<-6187,2560,1352>, v=<124,-12,-2>, a=<6,-5,-3>\n", "p=<-1083,-2834,-620>, v=<8,129,21>, a=<2,-2,0>\n", "p=<-2685,3997,-1222>, v=<-66,7,119>, a=<10,-9,-5>\n", "p=<-2820,1792,-3967>, v=<16,-59,9>, a=<5,0,8>\n", "p=<2827,286,-1978>, v=<-60,-81,56>, a=<-6,6,3>\n", "p=<-143,-3685,-2737>, v=<-17,19,56>, a=<2,13,6>\n", "p=<4686,-418,4600>, v=<-18,43,-36>, a=<-17,-2,-15>\n", "p=<-2277,-4961,-405>, v=<149,31,-119>, a=<-4,17,12>\n", "p=<-2761,-3058,-1505>, v=<56,2,-69>, a=<6,12,12>\n", "p=<-748,1969,-295>, v=<22,-123,14>, a=<1,3,0>\n", "p=<2024,-891,-3122>, v=<80,7,85>, a=<-15,3,5>\n", "p=<979,-1650,519>, v=<-68,-16,46>, a=<2,8,-6>\n", "p=<1441,-968,3390>, v=<-43,45,-50>, a=<-2,0,-9>\n", "p=<1920,-2294,-651>, v=<-174,-26,100>, a=<7,16,-7>\n", "p=<-1500,154,-5313>, v=<149,-10,188>, a=<-7,0,11>\n", "p=<-2751,-2456,-3783>, v=<0,135,84>, a=<16,0,13>\n", "p=<219,1243,-30>, v=<-13,-80,-1>, a=<0,1,0>\n", "p=<-789,388,861>, v=<43,-23,-98>, a=<0,0,5>\n", "p=<-1820,-2022,-5756>, v=<67,52,8>, a=<-1,0,7>\n", "p=<8749,-2412,-2480>, v=<-124,62,-36>, a=<-5,0,5>\n", "p=<-6500,-6273,-6926>, v=<-33,-59,-22>, a=<10,11,10>\n", "p=<-5447,84,-4391>, v=<0,78,33>, a=<7,-4,4>\n", "p=<5239,-7989,-491>, v=<-94,45,153>, a=<-2,8,-7>\n", "p=<598,-5181,4033>, v=<5,53,-43>, a=<-1,4,-3>\n", "p=<-2405,-5064,-12503>, v=<102,-90,1>, a=<-2,11,16>\n", "p=<442,8196,133>, v=<-11,10,-63>, a=<0,-11,3>\n", "p=<-455,4413,-6653>, v=<12,-93,31>, a=<0,-1,7>\n", "p=<-5876,-1398,-11255>, v=<91,-24,149>, a=<3,3,7>\n", "p=<467,1357,1470>, v=<-54,-38,-59>, a=<2,-12,-10>\n", "p=<-7,-1571,-1734>, v=<-8,141,169>, a=<1,-2,-4>\n", "p=<2045,379,-462>, v=<-114,-67,63>, a=<-9,5,-4>\n", "p=<-349,-1595,-1284>, v=<1,26,34>, a=<4,16,11>\n", "p=<1199,-1259,-1212>, v=<-89,76,80>, a=<-2,4,3>\n", "p=<-3704,-1371,-1025>, v=<115,11,-64>, a=<8,6,12>\n", "p=<-2792,624,96>, v=<137,-124,-13>, a=<1,9,1>\n", "p=<589,390,-229>, v=<-28,-74,35>, a=<-6,7,-2>\n", "p=<-1261,-675,-694>, v=<113,82,87>, a=<2,-2,-3>\n", "p=<9,545,-1744>, v=<-36,-51,104>, a=<6,0,13>\n", "p=<-686,30,451>, v=<28,-27,-44>, a=<7,5,0>\n", "p=<-516,-305,-219>, v=<33,12,1>, a=<3,4,4>\n", "p=<-996,105,-1449>, v=<37,-7,124>, a=<11,0,4>\n", "p=<1638,-3532,-519>, v=<136,-39,-65>, a=<-14,12,6>\n", "p=<3744,5459,-2517>, v=<-138,6,107>, a=<0,-15,-1>\n", "p=<-358,1728,130>, v=<56,-54,-13>, a=<-4,-12,0>\n", "p=<-761,-482,-923>, v=<59,4,26>, a=<0,4,6>\n", "p=<-1177,155,-754>, v=<77,53,27>, a=<2,-10,4>\n", "p=<435,1091,-1027>, v=<23,-89,-1>, a=<-8,0,11>\n", "p=<84,-846,-1716>, v=<36,32,129>, a=<-6,4,0>\n", "p=<1722,-1704,-299>, v=<-13,98,76>, a=<-17,4,-8>\n", "p=<1358,-1548,-572>, v=<-104,51,-22>, a=<0,9,9>\n", "p=<-1697,727,-598>, v=<47,-68,8>, a=<12,1,5>\n", "p=<-150,571,416>, v=<-16,-14,35>, a=<4,-5,-10>\n", "p=<435,-8451,531>, v=<-12,19,0>, a=<0,14,-1>\n", "p=<798,13692,-8478>, v=<-23,-176,154>, a=<0,-14,6>\n", "p=<171,1779,5052>, v=<13,-53,-86>, a=<-1,0,-4>\n", "p=<-3558,-3072,-3528>, v=<92,-42,-13>, a=<1,8,7>\n", "p=<-4218,-2313,-4122>, v=<129,-31,107>, a=<0,6,1>\n", "p=<-2766,7356,-3066>, v=<0,-35,58>, a=<5,-11,2>\n", "p=<-4331,7140,-11515>, v=<-24,10,90>, a=<11,-16,19>\n", "p=<3484,2565,-880>, v=<10,-101,-125>, a=<-8,1,10>\n", "p=<7564,-1275,-1420>, v=<-126,-35,48>, a=<-8,5,0>\n", "p=<-3251,-9690,3485>, v=<-29,168,-38>, a=<9,10,-5>\n", "p=<2367,-3580,4558>, v=<72,36,-12>, a=<-8,4,-7>\n", "p=<7892,-1625,-2344>, v=<-108,101,86>, a=<-7,-3,-1>\n", "p=<-7969,-469,6819>, v=<96,-3,-96>, a=<8,1,-6>\n", "p=<-2240,823,7618>, v=<-125,-41,-67>, a=<11,1,-9>\n", "p=<6702,11312,-4163>, v=<32,-87,-18>, a=<-13,-14,8>\n", "p=<-8853,-1659,2739>, v=<157,-73,-81>, a=<6,7,0>\n", "p=<3647,-2764,-635>, v=<-8,19,66>, a=<-9,6,-3>\n", "p=<623,2501,-2525>, v=<-36,-120,38>, a=<1,2,4>\n", "p=<-7045,-955,229>, v=<94,-34,62>, a=<12,5,-5>\n", "p=<5402,6470,-1796>, v=<-87,-57,67>, a=<-8,-13,0>\n", "p=<-1045,-2592,2778>, v=<68,60,-126>, a=<-2,4,1>\n", "p=<-7249,3372,-5394>, v=<164,-76,127>, a=<11,-5,8>\n", "p=<1103,-2460,-6378>, v=<66,-8,68>, a=<-9,9,16>\n", "p=<-1633,3072,-2442>, v=<-20,-51,104>, a=<7,-6,0>\n", "p=<659,924,642>, v=<-28,-24,63>, a=<0,-1,-7>\n", "p=<599,-4248,3630>, v=<37,204,-124>, a=<-5,-2,-2>\n", "p=<-4669,888,-3654>, v=<119,-110,67>, a=<6,6,7>\n", "p=<1175,-3060,2454>, v=<38,17,-125>, a=<-7,9,2>\n", "p=<-4808,-3374,1978>, v=<72,12,-39>, a=<4,5,-1>\n", "p=<-1425,1726,8115>, v=<25,-68,-132>, a=<1,1,-6>\n", "p=<-915,-1691,533>, v=<-60,-20,56>, a=<5,4,-4>\n", "p=<-9262,-2082,465>, v=<98,114,23>, a=<10,-3,-2>\n", "p=<-235,1692,-6199>, v=<-80,-137,44>, a=<5,5,8>\n", "p=<1006,-2745,3967>, v=<-29,11,60>, a=<0,4,-10>\n", "p=<734,910,4545>, v=<49,-9,113>, a=<-4,-1,-14>\n", "p=<-4400,5245,1145>, v=<95,-84,108>, a=<2,-4,-8>\n", "p=<-5137,-4813,-3931>, v=<170,99,130>, a=<0,4,0>\n", "p=<-1237,362,4664>, v=<71,-27,-48>, a=<-2,1,-7>\n", "p=<4118,3047,-4426>, v=<-30,23,7>, a=<-7,-8,9>\n", "p=<3953,-5713,2879>, v=<-40,129,-35>, a=<-6,4,-4>\n", "p=<6098,467,284>, v=<28,-108,-119>, a=<-15,6,7>\n", "p=<-5257,-463,-1006>, v=<81,78,-14>, a=<6,-4,3>\n", "p=<-2392,-4483,-781>, v=<1,88,-6>, a=<5,4,2>\n", "p=<2392,-3365,691>, v=<-86,94,96>, a=<-2,5,-11>\n", "p=<38,100,4266>, v=<44,17,-170>, a=<-4,-2,-2>\n", "p=<-1986,-3255,-651>, v=<44,66,-27>, a=<4,7,5>\n", "p=<-4813,-582,2253>, v=<92,2,2>, a=<11,2,-9>\n", "p=<-4351,-4146,460>, v=<94,95,-20>, a=<9,8,0>\n", "p=<654,-351,-2928>, v=<-53,3,134>, a=<2,1,0>\n", "p=<-1711,870,2814>, v=<20,5,-58>, a=<5,-4,-6>\n", "p=<269,-4707,1637>, v=<-47,132,-62>, a=<3,7,-1>\n", "p=<-3141,2135,4365>, v=<108,-18,-94>, a=<3,-7,-9>\n", "p=<-326,254,-1121>, v=<46,-14,57>, a=<-3,0,1>\n", "p=<830,-290,1599>, v=<5,27,-49>, a=<-6,-1,-5>\n", "p=<-1591,14168,-6462>, v=<136,-117,76>, a=<-5,-16,6>\n", "p=<-5651,3843,-5132>, v=<126,-38,110>, a=<2,-4,2>\n", "p=<-10131,1288,9673>, v=<56,-37,-7>, a=<13,0,-15>\n", "p=<6424,-4347,-1982>, v=<-39,52,-16>, a=<-8,4,4>\n", "p=<-1158,-4508,3667>, v=<70,88,-149>, a=<-1,13,-3>\n", "p=<2522,3462,-253>, v=<-135,-111,47>, a=<1,-6,-3>\n", "p=<1452,-3418,-1613>, v=<-50,44,-11>, a=<-2,12,9>\n", "p=<-4388,2692,1047>, v=<11,-104,-39>, a=<20,-3,-1>\n", "p=<1672,592,-913>, v=<-61,-104,143>, a=<-2,7,-9>\n", "p=<1792,-968,317>, v=<-88,37,-13>, a=<0,1,0>\n", "p=<3902,-2518,-2033>, v=<-141,62,94>, a=<-5,6,1>\n", "p=<-1618,-4358,-1043>, v=<51,175,-29>, a=<3,4,8>\n", "p=<-58,-1808,2057>, v=<78,37,26>, a=<-7,5,-12>\n", "p=<2272,1312,-633>, v=<-70,-98,129>, a=<-4,3,-9>\n", "p=<-1750,755,1487>, v=<26,-47,18>, a=<10,0,-13>\n", "p=<-46,-2101,1943>, v=<98,72,-70>, a=<-11,7,-6>\n", "p=<-870,1043,791>, v=<22,-65,-49>, a=<4,0,0>\n", "p=<1618,243,-257>, v=<-74,-168,59>, a=<-3,18,-5>\n", "p=<2066,155,-2385>, v=<-102,-1,107>, a=<-3,-1,5>\n", "p=<10,115,-633>, v=<-16,-7,23>, a=<2,0,2>\n", "p=<418,1539,471>, v=<18,-96,39>, a=<-5,0,-8>\n", "p=<-1462,235,-233>, v=<127,-74,32>, a=<-4,7,-2>\n", "p=<125,463,-834>, v=<19,20,-50>, a=<-3,-5,11>\n", "p=<-2034,-999,-1565>, v=<38,7,56>, a=<9,6,4>\n", "p=<-215,140,-1293>, v=<-24,-51,76>, a=<4,5,0>\n", "p=<-895,1398,645>, v=<-56,-17,-38>, a=<12,-7,0>\n", "p=<-1048,225,951>, v=<34,25,-65>, a=<3,-4,1>\n", "p=<1077,2350,271>, v=<-64,-55,-61>, a=<0,-9,5>\n", "p=<3813,2408,4701>, v=<-35,30,-184>, a=<-7,-8,1>\n", "p=<-1297,-3052,-59>, v=<46,-123,-72>, a=<0,16,5>\n", "p=<-7569,-98,1677>, v=<9,-11,11>, a=<18,1,-5>\n", "p=<-3733,7084,823>, v=<46,-50,-89>, a=<6,-14,4>\n", "p=<145,-490,-1221>, v=<-20,61,42>, a=<1,-3,0>\n", "p=<-639,224,-6499>, v=<8,-8,-16>, a=<1,0,17>\n", "p=<-3397,98,4183>, v=<121,40,-93>, a=<0,-3,-4>\n", "p=<1714,-5869,-7053>, v=<-6,174,-30>, a=<-2,-1,11>\n", "p=<-4119,2852,1022>, v=<11,-114,-28>, a=<5,2,0>\n", "p=<-4100,-8852,1687>, v=<30,77,13>, a=<4,8,-3>\n", "p=<-5544,-1176,6418>, v=<146,-86,25>, a=<0,6,-10>\n", "p=<-102,595,-2723>, v=<16,-3,20>, a=<-1,-3,14>\n", "p=<-2694,-1646,-878>, v=<8,131,79>, a=<15,-4,-3>\n", "p=<-606,523,256>, v=<120,1,-41>, a=<-9,-3,3>\n", "p=<-2636,5944,-1281>, v=<-39,-63,124>, a=<7,-7,-5>\n", "p=<3535,-4088,6705>, v=<80,-65,-33>, a=<-11,11,-10>\n", "p=<-3461,-5936,864>, v=<71,178,-26>, a=<2,0,0>\n", "p=<73,-410,-1012>, v=<-5,27,70>, a=<0,0,0>\n", "p=<878,654,1417>, v=<-145,-4,-141>, a=<11,-6,5>\n", "p=<-417,-606,-1369>, v=<0,-4,58>, a=<4,6,5>\n", "p=<-46,-1495,-634>, v=<-4,52,28>, a=<1,7,2>\n", "p=<213,1249,-1936>, v=<0,-24,46>, a=<-2,-9,12>\n", "p=<-1280,328,161>, v=<-57,-17,15>, a=<10,0,-2>\n", "p=<-334,-805,1151>, v=<84,-23,-53>, a=<-6,5,0>\n", "p=<876,-1861,-1665>, v=<-63,25,-17>, a=<2,5,8>\n", "p=<-301,4959,1173>, v=<71,-147,61>, a=<-5,-7,-10>\n", "p=<1822,-1223,1404>, v=<-83,-27,-99>, a=<0,7,3>\n", "p=<-2776,856,-1071>, v=<80,-64,25>, a=<4,2,2>\n", "p=<1264,-2025,375>, v=<4,-98,47>, a=<-2,8,-3>\n", "p=<-7024,4746,-2363>, v=<152,-91,26>, a=<2,-2,2>\n", "p=<2337,3599,5037>, v=<51,35,-136>, a=<-6,-7,0>\n", "p=<-3176,6115,2225>, v=<-28,-128,-117>, a=<6,-2,3>\n", "p=<-7542,3599,-5841>, v=<14,-60,-70>, a=<10,-2,12>\n", "p=<-2510,-10868,2484>, v=<30,84,47>, a=<2,11,-6>\n", "p=<1375,5042,560>, v=<-94,-118,-15>, a=<3,-1,0>\n", "p=<572,-184,9935>, v=<121,83,-129>, a=<-9,-5,-13>\n", "p=<3317,1631,-3265>, v=<-110,-55,32>, a=<0,0,5>\n", "p=<-1213,-4699,2240>, v=<41,32,-43>, a=<0,8,-2>\n", "p=<-778,7046,4100>, v=<135,-96,19>, a=<-7,-9,-10>\n", "p=<-4558,-7279,-910>, v=<106,-37,-31>, a=<3,18,4>\n", "p=<4472,4916,770>, v=<-164,6,6>, a=<1,-11,-2>\n", "p=<-2371,9,-1448>, v=<161,37,64>, a=<0,-5,4>\n", "p=<1934,-141,-2153>, v=<-94,103,23>, a=<-4,-12,15>\n", "p=<1004,2454,532>, v=<-32,-166,-84>, a=<-4,0,6>\n", "p=<449,1374,-23>, v=<-27,-70,-7>, a=<0,-3,1>\n", "p=<-46,189,742>, v=<-2,-7,38>, a=<1,-1,-11>\n", "p=<-1921,-486,-1268>, v=<51,-26,-4>, a=<10,7,11>\n", "p=<-8594,-6964,453>, v=<37,85,-79>, a=<14,8,4>\n", "p=<-3426,4252,1909>, v=<24,-117,-9>, a=<5,-1,-3>\n", "p=<4734,-8724,949>, v=<-33,74,153>, a=<-7,12,-11>\n", "p=<1470,-7028,-2683>, v=<-63,87,85>, a=<1,8,0>\n", "p=<-2834,-7572,5093>, v=<-11,137,73>, a=<6,6,-14>\n", "p=<-2082,-2212,-10699>, v=<-84,-47,121>, a=<9,7,13>\n", "p=<-8770,7388,-1531>, v=<59,-83,49>, a=<13,-9,0>\n", "p=<1550,-4996,-2219>, v=<-16,-59,21>, a=<-2,13,3>\n", "p=<-3570,-5748,-6619>, v=<-87,80,43>, a=<12,6,10>\n", "p=<3694,-11780,-3643>, v=<-17,186,16>, a=<-6,11,6>\n", "p=<216,-1664,-1581>, v=<32,40,67>, a=<-4,4,1>\n", "p=<-3484,-344,959>, v=<175,58,-60>, a=<0,-4,1>\n", "p=<-524,-854,-1941>, v=<-36,31,64>, a=<6,1,3>\n", "p=<1556,-1314,829>, v=<-77,75,-64>, a=<0,-1,2>\n", "p=<-1804,1036,-1481>, v=<-35,10,62>, a=<12,-6,1>\n", "p=<-6204,1486,1019>, v=<122,-23,42>, a=<18,-5,-9>\n", "p=<106,-1634,769>, v=<-99,7,2>, a=<9,7,-4>\n", "p=<-744,-1114,1239>, v=<-25,-61,-32>, a=<6,11,-3>\n", "p=<1326,-1514,-2681>, v=<-13,-20,164>, a=<-5,9,-3>\n", "p=<-6024,1756,-2991>, v=<176,-47,148>, a=<12,-4,0>\n", "p=<-1185,1891,-1377>, v=<-169,271,-196>, a=<2,-18,15>\n", "p=<2450,-113,1689>, v=<347,-19,245>, a=<-24,4,-14>\n", "p=<-2696,798,-390>, v=<-385,115,-51>, a=<23,-7,3>\n", "p=<-253,-2657,-1113>, v=<-39,-378,-160>, a=<2,28,15>\n", "p=<941,-2221,-1739>, v=<134,-319,-247>, a=<-10,22,17>\n", "p=<-2571,622,692>, v=<-367,83,94>, a=<26,-10,-6>\n", "p=<887,-469,2889>, v=<123,-69,414>, a=<-14,8,-28>\n", "p=<2493,-978,-1309>, v=<353,-130,-187>, a=<-24,10,10>\n", "p=<2150,1501,-1594>, v=<311,209,-227>, a=<-18,-15,13>\n", "p=<1856,2988,-329>, v=<269,430,-53>, a=<-19,-31,3>\n", "p=<1148,1977,-2139>, v=<164,283,-301>, a=<-16,-24,28>\n", "p=<-2743,629,-1085>, v=<-390,89,-162>, a=<29,-3,14>\n", "p=<1933,946,-1573>, v=<275,130,-224>, a=<-19,-9,15>\n", "p=<-2305,-1290,388>, v=<-331,-184,57>, a=<22,13,-4>\n", "p=<464,-149,-3139>, v=<67,-21,-447>, a=<-5,4,30>\n", "p=<479,-1038,-2341>, v=<72,-149,-337>, a=<-1,8,23>\n", "p=<1839,-337,1939>, v=<261,-46,278>, a=<-21,-3,-21>\n", "p=<257,2019,-2008>, v=<41,295,-285>, a=<-3,-19,16>\n", "p=<-1160,-1445,2476>, v=<-164,-204,355>, a=<15,11,-23>\n", "p=<-889,2702,851>, v=<-125,388,122>, a=<11,-31,-3>\n", "p=<-1514,1718,1230>, v=<-217,249,178>, a=<20,-13,-12>\n", "p=<-2265,-358,624>, v=<-323,-49,84>, a=<21,8,-5>\n", "p=<825,-2007,-2588>, v=<117,-286,-369>, a=<-10,18,22>\n", "p=<2389,1568,1685>, v=<343,221,242>, a=<-21,-16,-20>\n", "p=<-1230,2091,-604>, v=<-173,298,-84>, a=<15,-18,3>\n", "p=<-2333,857,1449>, v=<-336,118,209>, a=<24,-12,-11>\n", "p=<558,-2136,1370>, v=<79,-305,192>, a=<-5,21,-12>\n", "p=<-2414,1497,576>, v=<-344,215,80>, a=<24,-17,-5>\n", "p=<-1901,2046,695>, v=<-270,288,101>, a=<19,-21,-4>\n", "p=<373,1186,-2417>, v=<55,170,-343>, a=<0,-16,25>\n", "p=<-1470,-340,-2620>, v=<-217,-48,-373>, a=<10,5,28>\n", "p=<-501,847,2590>, v=<-74,121,370>, a=<7,-8,-29>\n", "p=<863,-1755,-1964>, v=<119,-250,-279>, a=<-5,19,17>\n", "p=<-2564,816,-1585>, v=<-366,112,-226>, a=<23,-8,16>\n", "p=<2452,-1521,-1441>, v=<356,-217,-203>, a=<-19,11,10>\n", "p=<-426,2546,-2083>, v=<-62,366,-300>, a=<1,-19,17>\n", "p=<51,788,2731>, v=<10,112,390>, a=<2,-11,-29>\n", "p=<191,617,-2860>, v=<27,89,-407>, a=<-4,-3,30>\n", "p=<2197,-762,-1985>, v=<314,-110,-283>, a=<-22,12,20>\n", "p=<-1336,1043,2127>, v=<-190,147,303>, a=<13,-10,-21>\n", "p=<-2534,-988,2164>, v=<-358,-146,311>, a=<26,9,-17>\n", "p=<1028,-2556,-47>, v=<147,-360,-6>, a=<-12,25,2>\n", "p=<1301,-1925,-1704>, v=<182,-278,-243>, a=<-19,14,14>\n", "p=<-1982,194,1860>, v=<-285,27,261>, a=<16,-5,-18>\n", "p=<1264,1574,-2430>, v=<177,224,-351>, a=<-16,-15,25>\n", "p=<1841,411,-2245>, v=<262,61,-316>, a=<-18,-2,27>\n", "p=<-2439,1764,774>, v=<-345,252,110>, a=<24,-25,-5>\n", "p=<561,772,-2215>, v=<77,114,-313>, a=<-3,-9,25>\n", "p=<-326,-877,-3157>, v=<-42,-124,-451>, a=<3,9,31>\n", "p=<53,2546,-1341>, v=<12,362,-189>, a=<-5,-25,10>\n", "p=<1588,1660,2255>, v=<226,242,326>, a=<-15,-15,-25>\n", "p=<-65,780,-2718>, v=<-11,112,-387>, a=<-4,-7,27>\n", "p=<-2660,-340,538>, v=<-381,-48,70>, a=<26,3,-5>\n", "p=<-1538,303,2055>, v=<-219,40,294>, a=<11,0,-19>\n", "p=<-227,-2448,-2132>, v=<-32,-344,-304>, a=<3,25,22>\n", "p=<2226,-1561,-1043>, v=<316,-223,-152>, a=<-22,14,8>\n", "p=<1033,1427,2456>, v=<151,204,354>, a=<-12,-16,-24>\n", "p=<2625,-1026,-1869>, v=<374,-143,-268>, a=<-26,11,22>\n", "p=<-2217,-2660,57>, v=<-319,-380,8>, a=<22,29,3>\n", "p=<770,606,-2745>, v=<113,85,-392>, a=<-2,-4,26>\n", "p=<2143,1913,402>, v=<309,273,58>, a=<-22,-16,1>\n", "p=<-2528,1344,-281>, v=<-361,192,-37>, a=<23,-13,3>\n", "p=<2732,456,414>, v=<386,65,56>, a=<-27,-7,-4>\n", "p=<2490,-1902,315>, v=<355,-277,44>, a=<-24,19,-1>\n", "p=<-10,-462,3021>, v=<-4,-62,431>, a=<-2,-1,-29>\n", "p=<-3044,1288,861>, v=<-433,189,124>, a=<30,-9,-7>\n", "p=<-552,301,2652>, v=<-86,49,379>, a=<1,-1,-29>\n", "p=<1577,1507,1914>, v=<224,220,270>, a=<-16,-15,-19>\n", "p=<2804,542,-194>, v=<398,77,-28>, a=<-22,-9,4>\n", "p=<1989,1071,1788>, v=<284,152,253>, a=<-19,-11,-22>\n", "p=<2939,-331,-1719>, v=<416,-50,-246>, a=<-28,5,9>\n", "p=<-596,-2447,1601>, v=<-85,-351,228>, a=<0,24,-13>\n", "p=<1887,932,-538>, v=<272,130,-76>, a=<-19,-7,5>\n", "p=<857,-260,-2540>, v=<124,-38,-361>, a=<-13,0,18>\n", "p=<-1359,-2481,-778>, v=<-194,-356,-111>, a=<11,25,7>\n", "p=<2695,-449,1496>, v=<384,-64,215>, a=<-28,1,-14>\n", "p=<-1518,2278,953>, v=<-214,325,134>, a=<12,-25,-8>\n", "p=<1233,2135,1600>, v=<175,312,230>, a=<-11,-15,-15>\n", "p=<552,286,2951>, v=<81,40,425>, a=<-4,-5,-30>\n", "p=<-1833,-433,2423>, v=<-257,-69,346>, a=<21,2,-24>\n", "p=<868,-2791,-1661>, v=<126,-403,-234>, a=<-10,24,15>\n", "p=<1124,2180,-1315>, v=<158,312,-184>, a=<-6,-24,10>\n", "p=<2362,1733,-443>, v=<336,249,-63>, a=<-23,-16,9>\n", "p=<-2797,-695,-1637>, v=<-399,-97,-226>, a=<31,2,16>\n", "p=<2080,1064,1457>, v=<295,152,206>, a=<-20,-12,-14>\n", "p=<-2097,-1197,-1723>, v=<-303,-172,-246>, a=<23,13,19>\n", "p=<12,-2706,1595>, v=<2,-386,231>, a=<-2,32,-15>\n", "p=<-2664,-836,354>, v=<-380,-118,48>, a=<24,6,-3>\n", "p=<-626,2290,-1721>, v=<-86,330,-242>, a=<10,-22,17>\n", "p=<1172,-2726,-678>, v=<169,-386,-100>, a=<-9,26,5>\n", "p=<1946,2224,-812>, v=<276,315,-118>, a=<-19,-26,5>\n", "p=<-1546,-1945,-456>, v=<-217,-276,-61>, a=<15,18,2>\n", "p=<-2731,-230,-4>, v=<-390,-32,4>, a=<27,4,0>\n", "p=<488,-1761,-2141>, v=<70,-255,-302>, a=<-9,17,16>\n", "p=<-631,2781,2584>, v=<-88,400,370>, a=<5,-26,-30>\n", "p=<1889,-1146,-1587>, v=<269,-170,-225>, a=<-21,8,12>\n", "p=<-300,-2429,1873>, v=<-50,-347,270>, a=<3,23,-13>\n", "p=<-2819,-517,-187>, v=<-405,-78,-28>, a=<28,2,5>\n", "p=<-1364,-2076,2041>, v=<-194,-295,293>, a=<16,20,-18>\n", "p=<-2689,-145,-379>, v=<-384,-19,-53>, a=<24,3,2>\n", "p=<1165,2759,-18>, v=<165,396,1>, a=<-11,-23,0>\n", "p=<-411,-1272,2205>, v=<-55,-184,315>, a=<8,16,-24>\n", "p=<703,1225,2986>, v=<100,175,424>, a=<-10,-10,-29>\n", "p=<1557,2047,1330>, v=<222,292,196>, a=<-15,-20,-13>\n", "p=<2432,1064,-604>, v=<347,153,-86>, a=<-22,-12,5>\n", "p=<2707,-575,-976>, v=<387,-77,-139>, a=<-29,8,13>\n", "p=<-415,2782,-2030>, v=<-59,397,-293>, a=<4,-27,21>\n", "p=<437,-2795,291>, v=<58,-400,36>, a=<-9,28,-6>\n", "p=<3282,163,-811>, v=<468,23,-113>, a=<-34,-4,9>\n", "p=<1812,-1269,1678>, v=<252,-181,238>, a=<-21,10,-16>\n", "p=<1190,405,-2752>, v=<169,63,-398>, a=<-10,-4,26>\n", "p=<1070,-2048,-997>, v=<154,-287,-145>, a=<-12,21,12>\n", "p=<-2340,-577,-2119>, v=<-339,-80,-302>, a=<28,10,21>\n", "p=<2672,595,1296>, v=<383,84,186>, a=<-28,-5,-14>\n", "p=<-21,52,-2410>, v=<-1,6,-337>, a=<6,-6,22>\n", "p=<501,2436,-1297>, v=<73,350,-186>, a=<-5,-26,12>\n", "p=<-1073,1132,2603>, v=<-156,165,372>, a=<11,-7,-26>\n", "p=<-227,-52,3320>, v=<-31,-7,478>, a=<5,5,-32>\n", "p=<-1156,-1949,2115>, v=<-164,-277,302>, a=<11,19,-18>\n", "p=<2230,-1374,-2410>, v=<319,-194,-346>, a=<-25,13,28>\n", "p=<-891,-772,2519>, v=<-128,-104,357>, a=<8,7,-27>\n", "p=<-1407,-2788,-953>, v=<-205,-398,-135>, a=<10,30,10>\n", "p=<2782,253,-538>, v=<393,39,-77>, a=<-30,-3,8>\n", "p=<-2762,-694,-371>, v=<-393,-98,-52>, a=<26,2,2>\n", "p=<549,2620,-1246>, v=<74,374,-178>, a=<-5,-28,12>\n", "p=<1894,1939,-62>, v=<273,279,-9>, a=<-20,-19,2>\n", "p=<616,2630,-248>, v=<87,375,-36>, a=<-6,-31,4>\n", "p=<1667,2513,-359>, v=<240,358,-51>, a=<-16,-22,2>\n", "p=<-2291,-36,-2460>, v=<-325,2,-350>, a=<22,6,24>\n", "p=<-225,-1066,-3008>, v=<-34,-149,-429>, a=<-1,9,27>\n", "p=<-2072,-2536,70>, v=<-294,-363,8>, a=<23,21,1>\n", "p=<826,-1220,2142>, v=<118,-172,310>, a=<-9,14,-21>\n", "p=<-1769,2052,-229>, v=<-246,296,-28>, a=<17,-21,3>\n", "p=<1964,2481,-738>, v=<288,354,-105>, a=<-24,-26,10>\n", "p=<1322,2501,492>, v=<189,360,68>, a=<-15,-25,-5>\n", "p=<-2049,2194,-775>, v=<-290,311,-114>, a=<22,-24,3>\n", "p=<-1142,-2134,1804>, v=<-161,-305,258>, a=<10,18,-21>\n", "p=<-2405,-1901,523>, v=<-338,-274,71>, a=<28,22,-1>\n", "p=<-390,128,2783>, v=<-60,21,404>, a=<1,-1,-27>\n", "p=<-1011,-2266,1237>, v=<-143,-327,175>, a=<8,19,-12>\n", "p=<-2554,-1987,167>, v=<-364,-280,23>, a=<24,19,1>\n", "p=<604,1223,2588>, v=<85,182,366>, a=<-8,-14,-25>\n", "p=<-1616,-163,-2086>, v=<-232,-24,-305>, a=<12,3,17>\n", "p=<-2698,-239,-252>, v=<-389,-34,-34>, a=<29,1,3>\n", "p=<1232,-72,-3004>, v=<180,-7,-425>, a=<-16,-6,32>\n", "p=<2545,1542,-788>, v=<367,221,-112>, a=<-27,-15,3>\n", "p=<243,-2267,2095>, v=<36,-327,298>, a=<-4,14,-18>\n", "p=<192,-1627,2420>, v=<23,-232,345>, a=<-2,23,-24>\n", "p=<-1838,1657,-477>, v=<-265,235,-68>, a=<15,-22,6>\n", "p=<1739,-728,-2486>, v=<249,-103,-355>, a=<-21,6,25>\n", "p=<-82,-1585,-2878>, v=<-11,-227,-415>, a=<4,11,25>\n", "p=<2105,-1629,-857>, v=<302,-230,-123>, a=<-21,17,10>\n", "p=<-2179,1212,2229>, v=<-312,172,316>, a=<27,-9,-24>\n", "p=<1905,1756,1533>, v=<272,250,220>, a=<-19,-18,-15>\n", "p=<-1918,-1724,1169>, v=<-273,-250,162>, a=<21,21,-10>\n", "p=<104,-2945,352>, v=<14,-420,51>, a=<2,29,-3>\n", "p=<938,192,-2775>, v=<139,27,-391>, a=<-11,-2,27>\n", "p=<-1622,66,2201>, v=<-230,14,319>, a=<12,6,-21>\n", "p=<-456,2516,-452>, v=<-65,363,-65>, a=<4,-25,4>\n", "p=<2495,-1215,1016>, v=<359,-174,148>, a=<-24,16,-8>\n", "p=<-1576,1299,-2319>, v=<-226,185,-330>, a=<15,-15,22>\n", "p=<-2117,-1834,151>, v=<-299,-265,27>, a=<20,17,3>\n", "p=<-1294,-1127,2522>, v=<-185,-161,360>, a=<16,16,-30>\n", "p=<-1101,-2674,738>, v=<-160,-379,105>, a=<16,22,-8>\n", "p=<2009,-1556,-1579>, v=<280,-222,-225>, a=<-22,15,13>\n", "p=<-2802,872,-2008>, v=<-399,126,-283>, a=<23,-8,24>\n", "p=<465,415,-2268>, v=<66,59,-322>, a=<0,-4,25>\n", "p=<133,1403,2447>, v=<19,195,352>, a=<0,-20,-24>\n", "p=<-335,1409,1970>, v=<-52,194,279>, a=<3,-14,-18>\n", "p=<582,-2694,-473>, v=<82,-380,-73>, a=<-3,27,7>\n", "p=<1793,1331,-2287>, v=<256,188,-325>, a=<-17,-7,24>\n", "p=<3093,-123,770>, v=<441,-21,106>, a=<-30,2,-5>\n", "p=<989,-1851,2200>, v=<141,-260,318>, a=<-6,21,-22>\n", "p=<3244,-172,701>, v=<465,-24,100>, a=<-30,-2,-8>\n", "p=<-129,-2951,1212>, v=<-14,-425,171>, a=<-5,30,-7>\n", "p=<1884,877,-1533>, v=<274,125,-219>, a=<-19,-12,15>\n", "p=<-1466,-2618,-346>, v=<-211,-382,-49>, a=<13,28,4>\n", "p=<562,963,-2956>, v=<77,139,-425>, a=<-5,-12,31>\n", "p=<-310,-2462,-856>, v=<-43,-354,-122>, a=<4,25,5>\n", "p=<1678,2238,-1419>, v=<236,321,-198>, a=<-17,-21,20>\n", "p=<1859,-1917,1187>, v=<263,-271,167>, a=<-19,21,-14>\n", "p=<2902,-893,-1497>, v=<411,-124,-217>, a=<-28,8,14>\n", "p=<-133,-2626,-864>, v=<-24,-373,-123>, a=<0,32,7>\n", "p=<-1054,2781,-794>, v=<-148,401,-113>, a=<9,-29,4>\n", "p=<526,689,-2372>, v=<73,103,-337>, a=<-9,-5,31>\n", "p=<-1056,-1107,2500>, v=<-148,-158,356>, a=<12,13,-18>\n", "p=<2996,-826,-419>, v=<424,-117,-58>, a=<-29,8,9>\n", "p=<-1771,1907,656>, v=<-252,270,94>, a=<14,-20,0>\n", "p=<2121,2061,-611>, v=<304,290,-79>, a=<-20,-17,8>\n", "p=<-2368,1603,-253>, v=<-339,224,-36>, a=<23,-16,2>\n", "p=<-2218,-2071,244>, v=<-312,-296,27>, a=<18,19,0>\n", "p=<-1023,-64,-2588>, v=<-147,-6,-366>, a=<10,-6,22>\n", "p=<1831,748,1395>, v=<261,112,196>, a=<-17,-3,-12>\n", "p=<2877,-1441,747>, v=<411,-207,102>, a=<-23,13,-6>\n", "p=<850,1692,1823>, v=<122,241,266>, a=<-11,-16,-20>\n", "p=<2912,-356,-1452>, v=<416,-51,-204>, a=<-25,3,19>\n", "p=<2441,1090,-441>, v=<349,155,-60>, a=<-25,-12,4>\n", "p=<-2420,2114,682>, v=<-341,305,100>, a=<22,-19,-3>\n", "p=<-174,-1003,2392>, v=<-21,-146,342>, a=<2,10,-23>\n", "p=<751,-2676,-811>, v=<105,-380,-113>, a=<-1,26,11>\n", "p=<-2436,2515,-340>, v=<-346,359,-46>, a=<20,-23,5>\n", "p=<-2119,-1482,1270>, v=<-299,-208,186>, a=<28,14,-15>\n", "p=<-1440,605,1931>, v=<-205,86,274>, a=<18,-5,-22>\n", "p=<-824,2827,1983>, v=<-122,400,284>, a=<10,-30,-19>\n", "p=<2686,-1319,979>, v=<383,-185,143>, a=<-25,11,-10>\n", "p=<-437,-3237,-1121>, v=<-62,-463,-160>, a=<3,32,10>\n", "p=<-1379,2833,733>, v=<-198,404,104>, a=<7,-30,-7>\n", "p=<-2851,-268,-153>, v=<-402,-38,-17>, a=<30,1,2>\n", "p=<-1730,1393,-1593>, v=<-248,198,-227>, a=<17,-14,20>\n", "p=<-441,2382,721>, v=<-63,338,103>, a=<-2,-23,-4>\n", "p=<2758,-338,124>, v=<394,-43,24>, a=<-25,3,-4>\n", "p=<1371,2018,-1514>, v=<194,287,-218>, a=<-13,-21,11>\n", "p=<510,-2755,-886>, v=<71,-395,-131>, a=<-7,23,7>\n", "p=<272,629,2616>, v=<39,92,371>, a=<2,-4,-27>\n", "p=<546,2123,1770>, v=<78,312,257>, a=<-1,-19,-17>\n", "p=<2648,127,-1710>, v=<378,18,-244>, a=<-26,2,16>\n", "p=<-309,1136,2477>, v=<-39,160,352>, a=<1,-13,-27>\n", "p=<-260,-3290,-1174>, v=<-34,-469,-168>, a=<2,34,11>\n", "p=<2244,661,-2524>, v=<323,97,-364>, a=<-28,-6,21>\n", "p=<-2431,112,1253>, v=<-347,16,181>, a=<23,-1,-12>\n", "p=<-2815,497,-1110>, v=<-404,71,-161>, a=<28,-7,9>\n", "p=<-56,1941,-3189>, v=<-9,275,-454>, a=<2,-21,30>\n", "p=<-2056,1594,-1735>, v=<-293,228,-247>, a=<22,-20,12>\n", "p=<2014,-2106,-544>, v=<286,-298,-77>, a=<-20,21,9>\n", "p=<-2708,-281,278>, v=<-389,-43,33>, a=<29,2,-1>\n", "p=<1078,2027,-2683>, v=<156,287,-384>, a=<-12,-20,22>\n", "p=<-1261,-2081,-1577>, v=<-179,-294,-220>, a=<12,23,11>\n", "p=<-2183,-474,-2274>, v=<-311,-69,-329>, a=<21,4,22>\n", "p=<-1821,-2105,1524>, v=<-260,-301,219>, a=<17,21,-10>\n", "p=<-2381,1310,-1381>, v=<-341,188,-196>, a=<25,-14,17>\n", "p=<-155,-2635,-32>, v=<-26,-371,-4>, a=<2,25,-7>\n", "p=<-2869,-1101,1206>, v=<-406,-158,172>, a=<32,8,-12>\n", "p=<-421,-18,-3512>, v=<-60,2,-497>, a=<5,0,35>\n", "p=<-1725,-1455,988>, v=<-245,-207,144>, a=<13,12,-6>\n", "p=<-2072,1335,-1575>, v=<-292,191,-229>, a=<21,-17,17>\n", "p=<-3118,-340,-600>, v=<-444,-52,-85>, a=<31,2,3>\n", "p=<-408,1362,2709>, v=<-60,193,387>, a=<5,-11,-31>\n", "p=<-803,-3302,162>, v=<-112,-473,25>, a=<8,33,-5>\n", "p=<-1913,-2082,-1050>, v=<-273,-295,-150>, a=<20,20,13>\n", "p=<-35,1990,3010>, v=<-3,288,429>, a=<-2,-23,-33>\n", "p=<-2235,1599,350>, v=<-319,228,49>, a=<22,-12,-4>\n", "p=<-2875,982,1077>, v=<-407,138,153>, a=<30,-11,-10>\n", "p=<-1099,2301,1861>, v=<-159,326,263>, a=<10,-21,-18>\n", "p=<2751,807,-1186>, v=<396,115,-167>, a=<-27,-11,11>\n", "p=<789,-822,2735>, v=<112,-117,390>, a=<-7,7,-30>\n", "p=<714,-2468,-633>, v=<99,-351,-90>, a=<-8,23,6>\n", "p=<1160,92,2472>, v=<161,10,354>, a=<-11,-2,-25>\n", "p=<-806,3039,851>, v=<-117,434,124>, a=<10,-30,-8>\n", "p=<-1909,-1290,-1662>, v=<-272,-182,-240>, a=<21,8,17>\n", "p=<-2029,1009,-1406>, v=<-286,144,-202>, a=<19,-9,9>\n", "p=<-2633,773,-1212>, v=<-371,110,-171>, a=<28,-9,13>\n", "p=<-2428,848,-649>, v=<-345,115,-90>, a=<22,-11,3>\n", "p=<-1943,-1284,1950>, v=<-276,-183,277>, a=<16,16,-18>\n", "p=<2135,-4,1969>, v=<308,-2,278>, a=<-23,1,-20>\n", "p=<-2252,1999,-809>, v=<-321,281,-115>, a=<26,-20,8>\n", "p=<-2200,-1994,1268>, v=<-314,-283,183>, a=<19,18,-12>\n", "p=<-573,1089,-2660>, v=<-80,150,-383>, a=<2,-5,30>\n", "p=<-634,-858,-2314>, v=<-90,-126,-325>, a=<4,7,21>\n", "p=<602,-2854,-355>, v=<89,-401,-47>, a=<-3,30,4>\n", "p=<208,-3102,-114>, v=<32,-445,-15>, a=<-2,30,1>\n", "p=<-1962,-1576,1725>, v=<-287,-225,248>, a=<22,16,-17>\n", "p=<2093,-78,-2123>, v=<297,-10,-300>, a=<-20,-1,21>\n", "p=<-1858,-1403,2246>, v=<-264,-200,315>, a=<18,10,-20>\n", "p=<3140,363,636>, v=<443,50,90>, a=<-31,-3,-7>\n", "p=<-970,-2562,160>, v=<-140,-364,22>, a=<11,27,-4>\n", "p=<-1838,1530,-2171>, v=<-260,220,-310>, a=<13,-13,21>\n", "p=<-1531,917,-2288>, v=<-222,129,-326>, a=<18,-9,20>\n", "p=<311,2074,-2252>, v=<44,296,-316>, a=<-3,-14,17>\n", "p=<-362,974,-2529>, v=<-44,142,-361>, a=<3,-9,25>\n", "p=<2303,269,-756>, v=<329,41,-108>, a=<-21,-5,7>\n", "p=<-2647,-1151,2>, v=<-384,-164,0>, a=<34,11,2>\n", "p=<1445,1783,1976>, v=<207,258,282>, a=<-10,-25,-15>\n", "p=<-530,-3161,358>, v=<-79,-448,45>, a=<3,29,-4>\n", "p=<778,-2487,1111>, v=<111,-352,156>, a=<-4,27,-16>\n", "p=<-731,1278,2348>, v=<-106,182,334>, a=<7,-9,-26>\n", "p=<-2074,1825,1081>, v=<-297,263,160>, a=<19,-17,-12>\n", "p=<-1704,-2190,404>, v=<-244,-317,55>, a=<14,20,-2>\n", "p=<2216,-2208,727>, v=<319,-312,107>, a=<-24,22,-6>\n", "p=<332,341,2589>, v=<50,52,371>, a=<1,-6,-24>\n", "p=<-2770,-562,-1888>, v=<-395,-80,-269>, a=<29,8,23>\n", "p=<-2106,576,2047>, v=<-295,83,293>, a=<15,-11,-17>\n", "p=<611,-2791,761>, v=<87,-398,106>, a=<-7,26,-5>\n", "p=<1504,1800,-2072>, v=<215,256,-294>, a=<-15,-21,22>\n", "p=<875,1832,1854>, v=<124,266,261>, a=<-9,-19,-17>\n", "p=<-2038,171,-1609>, v=<-293,29,-229>, a=<17,-1,19>\n", "p=<2565,1896,527>, v=<367,270,73>, a=<-22,-15,-9>\n", "p=<1369,-2192,691>, v=<196,-307,100>, a=<-14,17,-8>\n", "p=<965,2492,-734>, v=<134,357,-106>, a=<-7,-22,7>\n", "p=<1574,1686,-2192>, v=<227,241,-314>, a=<-14,-13,19>\n", "p=<-1522,-2068,1835>, v=<-220,-296,260>, a=<11,16,-12>\n", "p=<-1257,50,2566>, v=<-183,7,364>, a=<11,3,-26>\n", "p=<-1152,-1761,-1271>, v=<-164,-245,-185>, a=<9,16,14>\n", "p=<-28,1789,2823>, v=<-11,249,403>, a=<-1,-17,-28>\n", "p=<2415,164,-1672>, v=<350,23,-237>, a=<-24,4,10>\n", "p=<-1564,2450,-465>, v=<-223,349,-63>, a=<16,-24,1>\n", "p=<-2364,1632,-1100>, v=<-335,231,-157>, a=<27,-17,14>\n", "p=<2545,-1701,-1620>, v=<363,-242,-227>, a=<-23,17,18>\n", "p=<-274,2024,-3258>, v=<-37,291,-465>, a=<2,-23,33>\n", "p=<234,2394,2051>, v=<29,342,294>, a=<-6,-23,-20>\n", "p=<375,687,-2380>, v=<53,98,-338>, a=<1,-1,20>\n", "p=<-2444,1961,-1416>, v=<-351,277,-199>, a=<23,-17,14>\n", "p=<-904,-230,3463>, v=<-124,-31,494>, a=<6,6,-38>\n", "p=<-1823,-74,2035>, v=<-257,-13,287>, a=<18,-1,-23>\n", "p=<1199,-2404,-1239>, v=<176,-348,-179>, a=<-13,27,16>\n", "p=<658,-2538,1304>, v=<91,-364,187>, a=<-8,25,-10>\n", "p=<2516,-1649,-1225>, v=<360,-237,-175>, a=<-23,16,13>\n", "p=<-1818,1623,-1110>, v=<-264,231,-158>, a=<18,-21,6>\n", "p=<1775,2837,317>, v=<250,409,48>, a=<-15,-28,-4>\n", "p=<-2263,496,-1728>, v=<-323,73,-246>, a=<25,-1,20>\n", "p=<2316,1197,-978>, v=<331,171,-141>, a=<-25,-9,12>\n", "p=<-1391,-2923,457>, v=<-195,-413,68>, a=<12,25,-2>\n", "p=<1334,629,-2793>, v=<192,85,-407>, a=<-13,-6,27>\n", "p=<-1362,-1499,1617>, v=<-190,-212,228>, a=<13,16,-16>\n", "p=<2597,-1634,-622>, v=<374,-236,-90>, a=<-29,9,9>\n", "p=<-2576,-114,1901>, v=<-370,-16,275>, a=<20,3,-18>\n", "p=<2411,-993,1717>, v=<345,-138,242>, a=<-25,11,-17>\n", "p=<1860,-2435,-943>, v=<257,-346,-138>, a=<-18,26,4>\n", "p=<-734,-2821,1280>, v=<-108,-400,187>, a=<6,23,-8>\n", "p=<-2222,-1244,2441>, v=<-314,-178,352>, a=<22,12,-23>\n", "p=<-1371,2548,-1801>, v=<-195,366,-252>, a=<16,-25,16>\n", "p=<-2007,2173,-1284>, v=<-292,312,-183>, a=<20,-23,12>\n", "p=<2523,-1170,840>, v=<358,-166,120>, a=<-22,8,-2>\n", "p=<1600,1855,-2041>, v=<229,265,-291>, a=<-16,-17,21>\n", "p=<312,82,2996>, v=<45,7,433>, a=<-5,2,-29>\n", "p=<-2102,1894,159>, v=<-296,266,20>, a=<23,-18,-3>\n", "p=<-2480,-1473,1376>, v=<-355,-205,196>, a=<28,13,-11>\n", "p=<-37,-1315,-2317>, v=<-4,-190,-332>, a=<0,14,21>\n", "p=<-871,-2721,1074>, v=<-122,-388,152>, a=<6,28,-11>\n", "p=<2068,-1389,2102>, v=<293,-198,298>, a=<-19,16,-26>\n", "p=<-2252,1520,-787>, v=<-321,212,-113>, a=<20,-16,7>\n", "p=<243,2207,1305>, v=<34,316,181>, a=<-5,-23,-6>\n", "p=<1936,1013,1838>, v=<281,144,261>, a=<-18,-9,-19>\n", "p=<-1485,1301,-2362>, v=<-210,188,-343>, a=<14,-17,24>\n", "p=<-455,1640,-2702>, v=<-65,236,-391>, a=<5,-17,27>\n", "p=<-2578,-931,-1005>, v=<-366,-133,-147>, a=<25,4,9>\n", "p=<-865,2537,585>, v=<-118,362,83>, a=<13,-25,-2>\n", "p=<-159,462,-2925>, v=<-21,65,-417>, a=<5,-4,30>\n", "p=<-1832,1434,-1780>, v=<-261,205,-249>, a=<16,-14,20>\n", "p=<2284,-1994,-649>, v=<328,-289,-92>, a=<-22,22,10>\n", "p=<1865,2211,972>, v=<263,310,138>, a=<-19,-19,-10>\n", "p=<2750,-481,1067>, v=<394,-66,153>, a=<-22,10,-13>\n", "p=<-3006,437,-473>, v=<-427,68,-67>, a=<30,-4,5>\n", "p=<325,2718,741>, v=<44,383,100>, a=<-3,-29,-10>\n", "p=<-1684,2213,-1061>, v=<-240,317,-150>, a=<19,-25,11>\n", "p=<1994,2624,1581>, v=<286,372,225>, a=<-20,-26,-20>\n", "p=<2139,1038,1518>, v=<305,147,218>, a=<-17,-6,-10>\n", "p=<-207,-2511,-807>, v=<-24,-353,-119>, a=<7,29,6>\n", "p=<657,1665,-1908>, v=<93,236,-270>, a=<-11,-10,18>\n", "p=<-2525,-892,33>, v=<-360,-129,4>, a=<19,3,2>\n", "p=<2205,1598,-1551>, v=<314,233,-218>, a=<-22,-15,12>\n", "p=<-1368,1714,1493>, v=<-195,244,205>, a=<13,-17,-14>\n", "p=<157,-3247,-30>, v=<25,-463,-3>, a=<0,31,-4>\n", "p=<-137,709,3045>, v=<-20,97,435>, a=<1,-9,-31>\n", "p=<-2835,1244,157>, v=<-408,177,25>, a=<29,-7,-5>\n", "p=<1118,-2403,723>, v=<158,-338,106>, a=<-10,21,-11>\n", "p=<1905,340,-2016>, v=<274,47,-288>, a=<-21,0,20>\n", "p=<2145,-2133,-551>, v=<305,-305,-78>, a=<-22,21,6>\n", "p=<3017,855,-70>, v=<429,124,-14>, a=<-22,-8,-3>\n", "p=<676,-3059,675>, v=<96,-435,94>, a=<1,24,-8>\n", "p=<2707,-1594,-327>, v=<385,-227,-40>, a=<-21,20,4>\n", "p=<-614,3013,200>, v=<-86,434,28>, a=<5,-30,-2>\n", "p=<1081,191,2191>, v=<157,27,313>, a=<-14,2,-24>\n", "p=<699,-2381,-1446>, v=<98,-340,-203>, a=<-9,24,7>\n", "p=<-1101,-3103,-317>, v=<-158,-442,-50>, a=<9,25,-1>\n", "p=<1700,1246,-1427>, v=<246,176,-202>, a=<-14,-9,8>\n", "p=<2963,-300,-418>, v=<418,-40,-59>, a=<-28,7,4>\n", "p=<2751,50,-1648>, v=<393,10,-234>, a=<-31,-2,16>\n", "p=<153,-1278,2341>, v=<21,-184,334>, a=<2,15,-22>\n", "p=<-985,1406,2708>, v=<-142,200,383>, a=<10,-19,-26>\n", "p=<227,-3147,-6>, v=<31,-449,2>, a=<-4,31,1>\n", "p=<1057,-3331,559>, v=<151,-479,80>, a=<-6,33,-4>\n", "p=<-1968,371,-1914>, v=<-285,54,-273>, a=<26,-6,14>\n", "p=<-471,-2576,1278>, v=<-70,-369,176>, a=<2,25,-12>\n", "p=<-496,-2119,-2830>, v=<-70,-299,-404>, a=<3,21,29>\n", "p=<-1363,2930,492>, v=<-195,417,70>, a=<15,-28,-1>\n", "p=<-1235,2391,-1179>, v=<-176,342,-168>, a=<15,-25,9>\n", "p=<-2674,335,1779>, v=<-386,50,252>, a=<30,-5,-13>\n", "p=<891,708,2397>, v=<123,103,349>, a=<-11,-5,-22>\n", "p=<-1598,2259,942>, v=<-228,322,132>, a=<19,-17,-3>\n", "p=<803,-2810,-1540>, v=<119,-404,-220>, a=<-8,25,14>\n", "p=<-224,510,-2749>, v=<-29,67,-390>, a=<-2,-7,32>\n", "p=<-1835,2215,-1440>, v=<-266,320,-203>, a=<17,-21,16>\n", "p=<-1184,507,-2096>, v=<-168,72,-293>, a=<13,-5,19>\n", "p=<288,409,-3326>, v=<36,53,-474>, a=<2,-2,36>\n", "p=<1894,2356,559>, v=<269,340,75>, a=<-21,-24,-4>\n", "p=<7,1036,2617>, v=<2,148,375>, a=<0,-8,-26>\n", "p=<2491,732,-1505>, v=<353,103,-213>, a=<-22,-7,17>\n", "p=<361,-2673,-1070>, v=<54,-379,-151>, a=<3,30,11>\n", "p=<-2627,1037,105>, v=<-375,151,15>, a=<26,-12,1>\n", "p=<1308,2510,864>, v=<188,362,123>, a=<-13,-25,-8>\n", "p=<-277,3713,910>, v=<-39,530,131>, a=<2,-38,-8>\n", "p=<-669,-418,2646>, v=<-95,-60,381>, a=<9,1,-23>\n", "p=<91,-1150,-2124>, v=<13,-164,-306>, a=<-3,14,19>\n", "p=<1340,-56,-2233>, v=<191,-6,-318>, a=<-11,3,19>\n", "p=<2468,467,2268>, v=<353,67,324>, a=<-26,-6,-27>\n", "p=<2076,1476,1721>, v=<299,210,247>, a=<-19,-18,-21>\n", "p=<1017,1860,-2186>, v=<145,265,-311>, a=<-10,-18,20>\n", "p=<479,-1075,3025>, v=<75,-158,430>, a=<-5,10,-30>\n", "p=<1312,504,-2305>, v=<187,76,-333>, a=<-17,1,26>\n", "p=<-1016,-2173,-1594>, v=<-145,-315,-225>, a=<11,22,16>\n", "p=<88,-1087,3153>, v=<12,-157,451>, a=<-2,10,-34>\n", "p=<-2775,172,-308>, v=<-398,24,-42>, a=<28,-5,2>\n", "p=<-1050,854,-3117>, v=<-149,128,-442>, a=<14,-12,30>\n", "p=<-2588,-928,648>, v=<-370,-127,95>, a=<25,13,-6>\n", "p=<2788,1614,-1908>, v=<398,231,-274>, a=<-28,-18,19>\n", "p=<-915,1287,-1911>, v=<-129,181,-272>, a=<9,-12,18>\n", "p=<118,2882,1001>, v=<16,414,143>, a=<-5,-28,-14>\n", "p=<2751,1232,612>, v=<393,180,86>, a=<-29,-7,-6>\n", "p=<1575,-30,-2882>, v=<223,-9,-418>, a=<-7,4,30>\n", "p=<1451,813,-2363>, v=<204,116,-332>, a=<-11,-7,20>\n", "p=<1189,149,-2249>, v=<169,21,-318>, a=<-11,-4,23>\n", "p=<-2388,1306,-1182>, v=<-340,186,-168>, a=<24,-7,12>\n", "p=<-955,-2759,111>, v=<-136,-390,21>, a=<9,27,-1>\n", "p=<-1408,2687,-760>, v=<-197,383,-108>, a=<18,-22,10>\n", "p=<-2379,629,-222>, v=<-340,89,-34>, a=<26,-9,2>\n", "p=<-1312,2261,2231>, v=<-193,324,324>, a=<13,-21,-26>\n", "p=<184,-3068,-566>, v=<28,-440,-83>, a=<1,37,5>\n", "p=<1603,-2812,-1038>, v=<230,-404,-146>, a=<-20,28,16>\n", "p=<-980,-697,-2686>, v=<-139,-92,-383>, a=<4,6,21>\n", "p=<-1750,667,-2178>, v=<-254,95,-313>, a=<25,-11,18>\n", "p=<-1149,-1507,2370>, v=<-167,-220,338>, a=<11,14,-27>\n", "p=<-441,-2319,-218>, v=<-71,-329,-34>, a=<0,21,-3>\n", "p=<-267,-2311,-182>, v=<-38,-333,-26>, a=<2,23,0>\n", "p=<-546,-226,-2561>, v=<-78,-33,-364>, a=<7,1,29>\n", "p=<267,-2557,-1438>, v=<33,-368,-208>, a=<0,24,17>\n", "p=<-2277,-824,2094>, v=<-322,-117,297>, a=<24,10,-19>\n", "p=<-741,-2572,807>, v=<-99,-368,117>, a=<7,21,-3>\n", "p=<542,3001,690>, v=<75,426,100>, a=<-5,-28,-1>\n", "p=<57,60,2942>, v=<6,8,420>, a=<0,-2,-28>\n", "p=<-1498,-556,2735>, v=<-210,-79,390>, a=<17,5,-32>\n", "p=<1137,-2293,-2016>, v=<167,-325,-292>, a=<-11,22,20>\n", "p=<2255,1342,-912>, v=<323,190,-132>, a=<-24,-18,13>\n", "p=<120,-2668,-1049>, v=<21,-385,-149>, a=<-1,30,7>\n", "p=<-1797,1658,-1847>, v=<-259,234,-263>, a=<17,-22,19>\n", "p=<60,1626,-2635>, v=<9,232,-377>, a=<-6,-18,31>\n", "p=<1915,2444,-748>, v=<271,349,-106>, a=<-19,-28,8>\n", "p=<-794,625,2323>, v=<-112,96,328>, a=<9,-5,-25>\n", "p=<-2847,30,-1420>, v=<-409,4,-199>, a=<28,-2,19>\n", "p=<2278,1741,1013>, v=<327,252,139>, a=<-20,-17,-6>\n", "p=<-1252,-2783,790>, v=<-182,-396,110>, a=<10,26,-10>\n", "p=<-683,-656,2967>, v=<-93,-92,424>, a=<10,8,-31>\n", "p=<1045,2844,-423>, v=<148,408,-63>, a=<-14,-36,1>\n", "p=<-1583,-2548,-609>, v=<-227,-364,-84>, a=<10,27,2>\n", "p=<464,2509,1714>, v=<63,358,248>, a=<-2,-27,-17>\n", "p=<-781,2794,-778>, v=<-107,400,-106>, a=<9,-27,7>\n", "p=<464,-3398,439>, v=<63,-486,65>, a=<-2,34,-2>\n", "p=<-2356,-669,-1735>, v=<-333,-97,-242>, a=<23,10,17>\n", "p=<-94,-547,3403>, v=<-10,-79,487>, a=<-3,5,-35>\n", "p=<356,1321,2678>, v=<50,189,382>, a=<-5,-14,-22>\n", "p=<-2901,402,-624>, v=<-412,57,-83>, a=<24,-4,4>\n", "p=<-533,-996,2729>, v=<-78,-139,391>, a=<1,8,-26>\n", "p=<-1126,265,-2804>, v=<-157,38,-405>, a=<10,-2,27>\n", "p=<821,2209,2295>, v=<117,314,321>, a=<-8,-22,-22>\n", "p=<1797,2125,-114>, v=<256,304,-19>, a=<-13,-17,-4>\n", "p=<-1603,-2603,258>, v=<-229,-372,36>, a=<17,26,-2>\n", "p=<2400,-131,1736>, v=<338,-17,248>, a=<-21,0,-17>\n", "p=<738,2677,-1548>, v=<103,381,-223>, a=<-7,-26,17>\n", "p=<-761,581,2364>, v=<-114,88,336>, a=<8,-5,-23>\n", "p=<-1590,519,-2348>, v=<-222,73,-333>, a=<21,-4,20>\n", "p=<-708,-1178,2583>, v=<-103,-167,366>, a=<6,13,-30>\n", "p=<14,-2595,45>, v=<2,-364,6>, a=<2,20,-3>\n", "p=<1631,-2540,-896>, v=<233,-357,-133>, a=<-17,25,8>\n", "p=<-921,-101,2800>, v=<-125,-20,396>, a=<4,-1,-28>\n", "p=<1010,3304,-47>, v=<144,469,-10>, a=<-6,-33,-3>\n", "p=<402,-2919,1203>, v=<60,-417,175>, a=<-5,25,-17>\n", "p=<498,683,2643>, v=<72,103,380>, a=<-4,-10,-25>\n", "p=<-3169,-182,387>, v=<-455,-26,55>, a=<31,2,-7>\n", "p=<-513,-1694,-1964>, v=<-73,-244,-276>, a=<8,20,17>\n", "p=<-1289,1837,-2023>, v=<-182,265,-293>, a=<11,-16,21>\n", "p=<-637,-2233,-1326>, v=<-93,-319,-189>, a=<6,23,13>\n", "p=<1965,1240,1453>, v=<279,178,206>, a=<-22,-12,-16>\n", "p=<-2103,773,-994>, v=<-302,112,-140>, a=<25,-6,9>\n", "p=<88,-702,2651>, v=<13,-100,377>, a=<0,11,-26>\n", "p=<2869,-1326,1716>, v=<409,-192,247>, a=<-31,14,-21>\n", "p=<-425,-3427,-757>, v=<-60,-488,-107>, a=<4,35,7>\n", "p=<34,-2755,170>, v=<4,-396,24>, a=<0,25,0>\n", "p=<821,2555,-1836>, v=<119,366,-262>, a=<-3,-26,18>\n", "p=<1466,-2376,-1120>, v=<216,-344,-157>, a=<-16,27,10>\n", "p=<-1356,-1502,2665>, v=<-192,-209,379>, a=<4,15,-22>\n", "p=<3183,876,470>, v=<455,129,61>, a=<-28,-4,-8>\n", "p=<1076,-2112,-227>, v=<152,-301,-31>, a=<-8,21,2>\n", "p=<1703,346,2486>, v=<246,50,354>, a=<-13,3,-23>\n", "p=<-7,550,-3126>, v=<0,78,-452>, a=<4,-10,31>\n", "p=<3247,-142,853>, v=<466,-17,121>, a=<-26,1,-8>\n", "p=<-3445,1526,-371>, v=<-494,212,-59>, a=<35,-14,7>\n", "p=<-643,-408,2923>, v=<-86,-58,419>, a=<7,2,-35>\n", "p=<1032,-1460,1789>, v=<147,-206,256>, a=<-6,13,-11>\n", "p=<-2245,-1848,-542>, v=<-323,-267,-74>, a=<22,22,6>\n", "p=<-2170,-645,2153>, v=<-310,-93,308>, a=<20,8,-14>\n", "p=<1127,-735,2393>, v=<161,-112,338>, a=<-14,7,-28>\n", "p=<887,2364,2059>, v=<128,334,293>, a=<-8,-27,-22>\n", "p=<-359,-3118,-208>, v=<-46,-443,-30>, a=<1,32,1>\n", "p=<-1856,-1969,-1694>, v=<-264,-283,-242>, a=<20,19,16>\n", "p=<-162,-2764,1700>, v=<-30,-392,243>, a=<2,31,-15>\n", "p=<2374,-690,-2425>, v=<342,-102,-346>, a=<-31,14,23>\n", "p=<26,1729,2582>, v=<4,249,367>, a=<6,-13,-25>\n", "p=<-2448,-1767,369>, v=<-348,-252,52>, a=<22,17,-1>\n", "p=<-336,3532,-666>, v=<-49,502,-92>, a=<4,-35,0>\n", "p=<-1957,1148,1090>, v=<-279,166,158>, a=<19,-11,-8>\n", "p=<3117,338,1088>, v=<445,47,159>, a=<-31,-4,-11>\n", "p=<-1236,-1629,1989>, v=<-177,-229,284>, a=<10,15,-18>\n", "p=<2754,1178,374>, v=<393,168,50>, a=<-32,-11,-6>\n", "p=<2394,252,1078>, v=<338,38,154>, a=<-26,-5,-7>\n", "p=<344,694,-2455>, v=<52,103,-356>, a=<-3,-10,17>\n", "p=<-3232,-521,557>, v=<-461,-72,72>, a=<33,4,-2>\n", "p=<-770,135,2872>, v=<-107,20,409>, a=<7,-2,-28>\n", "p=<695,-2050,-2164>, v=<99,-288,-312>, a=<-11,20,21>\n", "p=<1617,2067,2001>, v=<227,293,289>, a=<-16,-22,-15>\n", "p=<-302,-1717,2660>, v=<-41,-243,380>, a=<1,18,-27>\n", "p=<-236,-1665,2628>, v=<-31,-236,374>, a=<6,16,-24>\n", "p=<1884,1254,-949>, v=<269,179,-137>, a=<-15,-7,9>\n", "p=<-256,2011,3034>, v=<-37,286,433>, a=<2,-16,-27>\n", "p=<-2646,860,1413>, v=<-378,127,200>, a=<21,-8,-12>\n", "p=<1812,-2148,1649>, v=<258,-309,237>, a=<-15,27,-17>\n", "p=<5,-2811,634>, v=<3,-403,84>, a=<0,23,-1>\n", "p=<-637,-986,3106>, v=<-89,-136,446>, a=<9,5,-31>\n", "p=<1096,1410,-1436>, v=<157,201,-205>, a=<-6,-11,14>\n", "p=<1024,2785,394>, v=<146,396,56>, a=<-17,-29,-5>\n", "p=<2650,1322,1655>, v=<371,188,233>, a=<-27,-13,-17>\n", "p=<68,2262,-502>, v=<8,322,-70>, a=<-4,-22,7>\n", "p=<1045,727,-2635>, v=<143,105,-376>, a=<-13,-3,33>\n", "p=<-436,-2423,-1791>, v=<-60,-347,-256>, a=<7,25,18>\n", "p=<1423,-1701,2193>, v=<205,-241,313>, a=<-20,15,-21>\n", "p=<-297,-3193,-1159>, v=<-46,-456,-168>, a=<0,31,9>\n", "p=<1915,226,-2420>, v=<273,31,-350>, a=<-18,-4,24>\n", "p=<-1813,-887,-2599>, v=<-259,-127,-374>, a=<18,9,29>\n", "p=<-300,2457,-639>, v=<-38,350,-90>, a=<-3,-25,9>\n", "p=<-2591,-143,1386>, v=<-370,-20,199>, a=<25,-4,-13>\n", "p=<-2,-3096,389>, v=<3,-441,53>, a=<4,27,-3>\n", "p=<1960,592,-2014>, v=<280,88,-287>, a=<-17,-2,19>\n", "p=<1551,260,-2258>, v=<219,41,-326>, a=<-15,-2,25>\n", "p=<399,132,-2311>, v=<53,22,-330>, a=<2,-3,24>\n", "p=<477,-346,3227>, v=<68,-53,459>, a=<-1,3,-32>\n", "p=<-1639,-1071,1985>, v=<-238,-151,280>, a=<17,11,-19>\n", "p=<1759,1580,-1837>, v=<249,222,-262>, a=<-22,-15,15>\n", "p=<1198,-847,2295>, v=<171,-123,329>, a=<-13,2,-26>\n", "p=<2719,1279,303>, v=<383,182,40>, a=<-30,-10,0>\n", "p=<-1399,2041,-1393>, v=<-195,295,-199>, a=<13,-24,14>\n", "p=<-536,446,2660>, v=<-75,58,381>, a=<5,-9,-26>\n", "p=<-2469,-372,706>, v=<-356,-53,105>, a=<24,9,-4>\n", "p=<-1248,2222,907>, v=<-177,318,130>, a=<7,-22,-10>\n", "p=<-984,-1142,-2583>, v=<-140,-163,-369>, a=<9,15,22>\n", "p=<-2655,-1223,1083>, v=<-379,-168,153>, a=<23,12,-11>\n", "p=<1201,-1941,-1509>, v=<168,-284,-214>, a=<-15,19,7>\n", "p=<1897,-1095,-2167>, v=<271,-158,-304>, a=<-14,13,24>\n", "p=<1401,690,-2236>, v=<197,101,-317>, a=<-9,-11,21>\n", "p=<2140,-1925,-1702>, v=<307,-273,-243>, a=<-21,21,18>\n", "p=<-2527,-640,-830>, v=<-354,-89,-117>, a=<21,7,3>\n", "p=<-1535,-525,2648>, v=<-219,-75,379>, a=<17,5,-30>\n", "p=<-1325,-199,-2594>, v=<-192,-22,-367>, a=<17,1,26>\n", "p=<1382,232,2746>, v=<196,36,393>, a=<-14,-3,-27>\n", "p=<-1985,-1158,300>, v=<-284,-164,41>, a=<23,7,-4>\n", "p=<-380,-205,-2983>, v=<-56,-27,-427>, a=<2,1,31>\n", "p=<-2245,165,1606>, v=<-318,24,232>, a=<22,-2,-11>\n", "p=<-660,1383,-2562>, v=<-93,197,-370>, a=<7,-13,28>\n", "p=<-1953,-421,-2259>, v=<-275,-63,-319>, a=<21,4,22>\n", "p=<2118,-1286,-1974>, v=<302,-182,-282>, a=<-21,14,23>\n", "p=<138,-36,2926>, v=<16,-7,422>, a=<-2,4,-29>\n", "p=<1464,-1220,-2905>, v=<209,-169,-409>, a=<-14,12,28>\n", "p=<-1005,-2026,-2125>, v=<-143,-285,-301>, a=<11,26,15>\n", "p=<1970,863,-2135>, v=<280,121,-300>, a=<-16,-8,22>\n", "p=<2395,72,1354>, v=<339,12,195>, a=<-22,6,-16>\n", "p=<52,2063,1568>, v=<9,295,225>, a=<-5,-20,-19>\n", "p=<2967,1093,1408>, v=<424,155,203>, a=<-29,-7,-11>\n", "p=<197,-1704,-1665>, v=<27,-245,-243>, a=<1,16,15>\n", "p=<1845,-2345,-419>, v=<264,-335,-60>, a=<-17,24,6>\n", "p=<2368,1170,299>, v=<335,167,40>, a=<-28,-13,-2>\n", "p=<-433,-2693,-1255>, v=<-64,-392,-181>, a=<3,26,10>\n", "p=<-1864,2213,-577>, v=<-264,319,-82>, a=<13,-22,10>\n", "p=<-698,1219,2813>, v=<-98,178,401>, a=<7,-12,-25>\n", "p=<3207,253,-25>, v=<459,36,-2>, a=<-37,-1,-4>\n", "p=<-1494,-3321,-55>, v=<-207,-471,-7>, a=<11,32,1>\n", "p=<2641,-2494,-842>, v=<381,-356,-120>, a=<-26,23,7>\n", "p=<2218,-821,794>, v=<312,-113,114>, a=<-23,9,-7>\"\"\"" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import re\n", "\n", "def load_particles(input):\n", " particles = []\n", " for line in input.split('\\n'):\n", " particle = []\n", " for qty in line.split(', '):\n", " groups = re.search('<([-\\d]+),([-\\d]+),([-\\d]+)>', qty).groups()\n", " particle.append([int(val) for val in groups])\n", " particles.append(particle)\n", " return particles" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "particles = load_particles(input)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[[-3770, -455, 1749], [-4, -77, 53], [11, 7, -9]]" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "particles[0]" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[[73, -410, -1012], [-5, 27, 70], [0, 0, 0]]" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "min(particles, key=lambda particle: sum(abs(val) for val in particle[2]))" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "376" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "particles.index([[73, -410, -1012], [-5, 27, 70], [0, 0, 0]])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## part 2: collisions" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "def step(particle):\n", " p = particle[0]\n", " v = particle[1]\n", " a = particle[2]\n", " v = [v[0] + a[0], v[1] + a[1], v[2] + a[2]]\n", " p = [p[0] + v[0], p[1] + v[1], p[2] + v[2]]\n", " return [p, v, a]" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[[-3, 0, 0], [3, 0, 0], [0, 0, 0]]" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "step([[-6, 0, 0], [3, 0, 0], [0, 0, 0]])" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "from collections import Counter" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "def non_unique_positions(particles):\n", " c = Counter([tuple(particle[0]) for particle in particles])\n", " return [val for (val, cnt) in c.items() if cnt > 1]" ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ ". . . . . . . . . 983 . 969 948 943 929 921 906 898 885 858 855 817 . 809 . 802 796 762 742 717 699 689 665 641 613 610 596 584 574 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . " ] } ], "source": [ "particles = load_particles(input)\n", "for _ in range(300):\n", " for ind, particle in enumerate(particles):\n", " particles[ind] = step(particle)\n", " non_unique = non_unique_positions(particles)\n", " if len(non_unique) > 0:\n", " particles = [particle for particle in particles if not tuple(particle[0]) in non_unique]\n", " print(len(particles), end=' ')\n", " else:\n", " print('.', end=' ')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 21 " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "First, let's build a dictionary of rules properly arranged as numpy arrays." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import numpy as np" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "def to_array(motif, splitter='/'):\n", " motif = motif.replace('.', '0').replace('#', '1')\n", " return np.array([list(map(int, list(item))) for item in motif.split(splitter)], dtype=np.int)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "test_input = \"\"\"../.# => ##./#../...\n", ".#./..#/### => #..#/..../..../#..#\"\"\"" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[0, 0],\n", " [0, 1]])" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "to_array(\"../.#\")" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[0, 1, 0],\n", " [0, 0, 1],\n", " [1, 1, 1]])" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "to_array(\"\"\".#.\n", "..#\n", "###\"\"\", splitter='\\n')" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "def array_hash(array):\n", " return array.tobytes() + bytes(array.shape)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "def make_mapping(input):\n", " mapping = {}\n", " for line in input.split('\\n'):\n", " motif, target = line.split(' => ')\n", " motif, target = to_array(motif), to_array(target)\n", " for _ in range(4):\n", " # normal\n", " mapping[array_hash(motif)] = target\n", " # flipped \n", " flipped = np.flipud(motif)\n", " mapping[array_hash(flipped)] = target\n", " # next: rotate the motif\n", " motif = np.rot90(motif)\n", " return mapping" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's test the mapping." ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [], "source": [ "def show_variations(motif):\n", " \"\"\"Prints all variations of a given motif.\"\"\"\n", " var1 = to_array(motif)\n", " var2 = np.flip(var1, axis=0)\n", " var3 = np.flip(var1, axis=1)\n", " var4 = np.flip(var2, axis=1)\n", " var5 = np.rot90(var1)\n", " var6 = np.rot90(var5)\n", " var7 = np.rot90(var6)\n", " for var in [var1, var2, var3, var4, var5, var6, var7]:\n", " print(var)\n", " print()" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[[0 1 0]\n", " [0 0 1]\n", " [1 1 1]]\n", "\n", "[[1 1 1]\n", " [0 0 1]\n", " [0 1 0]]\n", "\n", "[[0 1 0]\n", " [1 0 0]\n", " [1 1 1]]\n", "\n", "[[1 1 1]\n", " [1 0 0]\n", " [0 1 0]]\n", "\n", "[[0 1 1]\n", " [1 0 1]\n", " [0 0 1]]\n", "\n", "[[1 1 1]\n", " [1 0 0]\n", " [0 1 0]]\n", "\n", "[[1 0 0]\n", " [1 0 1]\n", " [1 1 0]]\n", "\n" ] } ], "source": [ "show_variations(\".#./..#/###\")" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "# unit tests from problem statement\n", "mapping = make_mapping(\"\"\".#./..#/### => \"\"\")\n", "assert array_hash(to_array(\".#./..#/###\")) in mapping\n", "assert array_hash(to_array(\".#./#../###\")) in mapping\n", "assert array_hash(to_array(\"#../#.#/##.\")) in mapping\n", "assert array_hash(to_array(\"###/..#/.#.\")) in mapping" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [], "source": [ "mapping = make_mapping(test_input)" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "12" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(mapping)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now let's test the example." ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [], "source": [ "def build_new_array(new_grid):\n", " n_rows, n_cols = len(new_grid), len(new_grid[0])\n", " block_rows, block_cols = new_grid[0][0].shape\n", " grid = np.empty((n_rows * block_rows, n_cols * block_cols), dtype=np.int)\n", " for row in range(n_rows):\n", " for col in range(n_cols):\n", " grid[row*block_rows:(row+1)*block_rows, col*block_cols:(col+1)*block_cols] = new_grid[row][col]\n", " return grid" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "12" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "grid = to_array(\"\"\".#.\n", "..#\n", "###\"\"\", splitter='\\n')\n", "for _ in range(2):\n", " if grid.shape[0] % 2 == 0:\n", " n_grid = grid.shape[0] // 2\n", " new_grid = []\n", " for r in range(n_grid):\n", " new_line = []\n", " for c in range(n_grid):\n", " sq = grid[2*r:2*(r+1),\n", " 2*c:2*(c+1)]\n", " assert array_hash(sq) in mapping\n", " new_line.append(mapping[array_hash(sq)])\n", " new_grid.append(new_line)\n", " elif grid.shape[0] % 3 == 0:\n", " n_grid = grid.shape[0] // 3\n", " new_grid = []\n", " for r in range(n_grid):\n", " new_line = []\n", " for c in range(n_grid):\n", " sq = grid[3*r:3*(r+1),\n", " 3*c:3*(c+1)]\n", " assert array_hash(sq) in mapping\n", " new_line.append(mapping[array_hash(sq)])\n", " new_grid.append(new_line)\n", " grid = build_new_array(new_grid)\n", "\n", "np.sum(grid)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now on to the real thing." ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "input = \"\"\"../.. => ..#/#../.#.\n", "#./.. => #../#../...\n", "##/.. => ###/#.#/#..\n", ".#/#. => ###/##./.#.\n", "##/#. => .../.#./..#\n", "##/## => ##./#.#/###\n", ".../.../... => ##../.#../#.#./....\n", "#../.../... => ..../##.#/...#/##.#\n", ".#./.../... => ###./####/#.../#..#\n", "##./.../... => ###./.##./...#/..##\n", "#.#/.../... => .###/.##./#.../#.##\n", "###/.../... => ##.#/#..#/#.#./#.##\n", ".#./#../... => #.#./.###/#.../#.##\n", "##./#../... => #.../####/#.##/....\n", "..#/#../... => #.##/..#./...#/...#\n", "#.#/#../... => #.##/####/.#.#/#.#.\n", ".##/#../... => #.../##../##.#/.##.\n", "###/#../... => ..../#.#./.###/#...\n", ".../.#./... => .#.#/#..#/##../#.##\n", "#../.#./... => ###./.###/.#.#/..#.\n", ".#./.#./... => ..##/.##./..##/.#.#\n", "##./.#./... => ..#./##../###./...#\n", "#.#/.#./... => ..##/.##./.###/###.\n", "###/.#./... => ..#./.###/###./#.##\n", ".#./##./... => ###./..../.#../#...\n", "##./##./... => .#.#/##../##.#/...#\n", "..#/##./... => ##.#/.##./.###/..##\n", "#.#/##./... => .###/..#./#.##/####\n", ".##/##./... => ##.#/..#./..##/###.\n", "###/##./... => ..../.#.#/.#../#...\n", ".../#.#/... => ###./.#.#/.#../#.##\n", "#../#.#/... => ####/#..#/..../....\n", ".#./#.#/... => #.../..##/#.##/#.#.\n", "##./#.#/... => #.#./###./##../#.#.\n", "#.#/#.#/... => ...#/.##./.##./.#..\n", "###/#.#/... => ..../.##./####/#.#.\n", ".../###/... => .###/.#../.###/#.##\n", "#../###/... => ..##/..##/.##./##..\n", ".#./###/... => .#.#/..#./..##/##.#\n", "##./###/... => ...#/#.##/#.#./##.#\n", "#.#/###/... => #.##/.##./...#/###.\n", "###/###/... => ##../...#/..##/####\n", "..#/.../#.. => #.##/#.../.#../#.#.\n", "#.#/.../#.. => .##./.##./.#.#/.##.\n", ".##/.../#.. => .#.#/#.##/...#/##.#\n", "###/.../#.. => ##../..#./...#/##..\n", ".##/#../#.. => ##../..##/#..#/#..#\n", "###/#../#.. => ##../..#./#.#./....\n", "..#/.#./#.. => .##./##.#/##../####\n", "#.#/.#./#.. => ####/...#/.#.#/..#.\n", ".##/.#./#.. => .#.#/..#./##.#/.#..\n", "###/.#./#.. => #.../#.##/..../##.#\n", ".##/##./#.. => #.#./#.#./#.##/#.#.\n", "###/##./#.. => ...#/###./.##./.#.#\n", "#../..#/#.. => ####/####/..../.##.\n", ".#./..#/#.. => #.##/...#/..#./####\n", "##./..#/#.. => ..#./#.../..##/####\n", "#.#/..#/#.. => #.../#.##/#.##/..##\n", ".##/..#/#.. => ####/..../##../####\n", "###/..#/#.. => ..../##.#/.##./####\n", "#../#.#/#.. => ...#/..##/###./#..#\n", ".#./#.#/#.. => #..#/..#./.###/##.#\n", "##./#.#/#.. => ###./####/#.##/..#.\n", "..#/#.#/#.. => ##../##.#/..##/.##.\n", "#.#/#.#/#.. => .#.#/.##./#.../##.#\n", ".##/#.#/#.. => .#.#/#..#/.##./..#.\n", "###/#.#/#.. => ...#/.#../.##./##.#\n", "#../.##/#.. => ###./##../#.#./####\n", ".#./.##/#.. => .#../##../#.#./.#.#\n", "##./.##/#.. => ##.#/.#../.#.#/####\n", "#.#/.##/#.. => ####/.#.#/..../....\n", ".##/.##/#.. => ####/##../#..#/####\n", "###/.##/#.. => .###/##.#/.#../#.##\n", "#../###/#.. => #..#/###./####/.#.#\n", ".#./###/#.. => ..##/##../##.#/.#.#\n", "##./###/#.. => #..#/.#../####/...#\n", "..#/###/#.. => ##../##.#/...#/#..#\n", "#.#/###/#.. => ..#./.##./#..#/....\n", ".##/###/#.. => #..#/#.../..../.#..\n", "###/###/#.. => ..#./#.##/.##./#...\n", ".#./#.#/.#. => .#.#/.##./##.#/.##.\n", "##./#.#/.#. => #..#/.###/.#.#/.##.\n", "#.#/#.#/.#. => #.../##../#.../.###\n", "###/#.#/.#. => ###./.###/###./....\n", ".#./###/.#. => .#../####/...#/##..\n", "##./###/.#. => ####/###./..../....\n", "#.#/###/.#. => ...#/.###/..../####\n", "###/###/.#. => ..../#.../..#./.###\n", "#.#/..#/##. => #.#./#.../####/#.##\n", "###/..#/##. => .#.#/#..#/.###/#...\n", ".##/#.#/##. => ..##/..#./..../##..\n", "###/#.#/##. => #.#./##.#/####/#..#\n", "#.#/.##/##. => ..../.#../#.#./##.#\n", "###/.##/##. => ..../..../.#../##.#\n", ".##/###/##. => #.#./.###/#.#./#.##\n", "###/###/##. => ##.#/##.#/.###/..#.\n", "#.#/.../#.# => #..#/.#../#.../...#\n", "###/.../#.# => ##../.#../##.#/..#.\n", "###/#../#.# => ..##/#.#./####/.#..\n", "#.#/.#./#.# => ...#/...#/#..#/#.#.\n", "###/.#./#.# => ..../####/.##./.#.#\n", "###/##./#.# => #..#/.#.#/..##/####\n", "#.#/#.#/#.# => #.#./..#./...#/.#..\n", "###/#.#/#.# => ...#/##.#/.###/.#..\n", "#.#/###/#.# => .#.#/###./.#../.##.\n", "###/###/#.# => ...#/.###/.#.#/###.\n", "###/#.#/### => #.##/.#.#/...#/.#..\n", "###/###/### => ..##/.#../#.#./.#..\"\"\"" ] }, { "cell_type": "code", "execution_count": 27, "metadata": { "scrolled": true }, "outputs": [], "source": [ "mapping = make_mapping(input)" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "528" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(mapping)" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "117" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "grid = to_array(\"\"\".#.\n", "..#\n", "###\"\"\", splitter='\\n')\n", "for _ in range(5):\n", " if grid.shape[0] % 2 == 0:\n", " n_grid = grid.shape[0] // 2\n", " new_grid = []\n", " for r in range(n_grid):\n", " new_line = []\n", " for c in range(n_grid):\n", " sq = grid[2*r:2*(r+1),\n", " 2*c:2*(c+1)]\n", " assert array_hash(sq) in mapping\n", " new_line.append(mapping[array_hash(sq)])\n", " new_grid.append(new_line)\n", " elif grid.shape[0] % 3 == 0:\n", " n_grid = grid.shape[0] // 3\n", " new_grid = []\n", " for r in range(n_grid):\n", " new_line = []\n", " for c in range(n_grid):\n", " sq = grid[3*r:3*(r+1),\n", " 3*c:3*(c+1)]\n", " assert array_hash(sq) in mapping\n", " new_line.append(mapping[array_hash(sq)])\n", " new_grid.append(new_line)\n", " grid = build_new_array(new_grid)\n", "\n", "np.sum(grid)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Part 2 " ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2026963" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "grid = to_array(\"\"\".#.\n", "..#\n", "###\"\"\", splitter='\\n')\n", "for _ in range(18):\n", " if grid.shape[0] % 2 == 0:\n", " n_grid = grid.shape[0] // 2\n", " new_grid = []\n", " for r in range(n_grid):\n", " new_line = []\n", " for c in range(n_grid):\n", " sq = grid[2*r:2*(r+1),\n", " 2*c:2*(c+1)]\n", " assert array_hash(sq) in mapping\n", " new_line.append(mapping[array_hash(sq)])\n", " new_grid.append(new_line)\n", " elif grid.shape[0] % 3 == 0:\n", " n_grid = grid.shape[0] // 3\n", " new_grid = []\n", " for r in range(n_grid):\n", " new_line = []\n", " for c in range(n_grid):\n", " sq = grid[3*r:3*(r+1),\n", " 3*c:3*(c+1)]\n", " assert array_hash(sq) in mapping\n", " new_line.append(mapping[array_hash(sq)])\n", " new_grid.append(new_line)\n", " grid = build_new_array(new_grid)\n", "\n", "np.sum(grid)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 22 " ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "test_input = \"\"\"..#\n", "#..\n", "...\"\"\"" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "3 // 2" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "from collections import defaultdict\n", "\n", "def to_grid(input):\n", " grid = defaultdict(int)\n", " lines = input.split('\\n')\n", " for ind_row, line in enumerate(lines):\n", " for ind_col in range(len(line)):\n", " if line[ind_col] == '#':\n", " grid[(ind_row, ind_col)] = 1\n", " return grid" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "defaultdict(int, {(0, 2): 1, (1, 0): 1})" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "grid = to_grid(test_input)\n", "grid" ] }, { "cell_type": "code", "execution_count": 42, "metadata": {}, "outputs": [], "source": [ "def count_infections(input, pos, bursts):\n", " grid = to_grid(input)\n", " directions = [(-1, 0), (0, 1), (1, 0), (0, -1)]\n", " direction = 0\n", " infections = 0\n", " for _ in range(bursts):\n", " if grid[pos] == 1:\n", " direction = (direction + 1) % len(directions)\n", " grid[pos] = 0\n", " else:\n", " direction = (direction - 1) % len(directions)\n", " grid[pos] = 1\n", " infections += 1\n", " pos = (pos[0] + directions[direction][0], \n", " pos[1] + directions[direction][1])\n", " return infections" ] }, { "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5" ] }, "execution_count": 44, "metadata": {}, "output_type": "execute_result" } ], "source": [ "count_infections(test_input, pos=(1, 1), bursts=7)" ] }, { "cell_type": "code", "execution_count": 45, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "41" ] }, "execution_count": 45, "metadata": {}, "output_type": "execute_result" } ], "source": [ "count_infections(test_input, pos=(1, 1), bursts=70)" ] }, { "cell_type": "code", "execution_count": 46, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5587" ] }, "execution_count": 46, "metadata": {}, "output_type": "execute_result" } ], "source": [ "count_infections(test_input, pos=(1, 1), bursts=10000)" ] }, { "cell_type": "code", "execution_count": 47, "metadata": {}, "outputs": [], "source": [ "input = \"\"\"#.#.#.##.#.##.###.#.###.#\n", ".#..#.....#..#######.##.#\n", "......###..##..###..#...#\n", "##....#.#.#....#..#..#..#\n", "#..#....#.##.#.#..#..#.#.\n", "..##..##.##..##...#...###\n", "..#.#....#..####.##.##...\n", "###...#.#...#.######...#.\n", "..#####...###..#####.#.##\n", "...#..#......####.##..#.#\n", "#...##..#.#####...#.##...\n", "..#.#.###.##.##....##.###\n", "##.##...###....#######.#.\n", "#.#...#.#..#.##..##..##.#\n", ".#...###...#..#..####....\n", "####...#...##.####..#.#..\n", "......#.....##.#.##....##\n", "###.......####..##.#.##..\n", "....###.....##.##..###.#.\n", ".##..##.#.###.###..#.###.\n", "..#..##.######.##........\n", "#..#.#..#.###....##.##..#\n", ".##.#.#...######...##.##.\n", "##..#..#..##.#.#..#..####\n", "#######.#.######.#.....##\"\"\"" ] }, { "cell_type": "code", "execution_count": 48, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5411" ] }, "execution_count": 48, "metadata": {}, "output_type": "execute_result" } ], "source": [ "count_infections(input, pos=(12, 12), bursts=10000)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## part 2 " ] }, { "cell_type": "code", "execution_count": 50, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "dict_items([((0, 2), 0), ((1, 0), 0), ((1, 1), 1), ((0, 0), 0), ((0, -1), 1), ((1, -1), 1), ((0, 1), 1), ((-1, 1), 0), ((-1, 0), 1), ((-1, 2), 0), ((-2, 2), 0), ((-2, 1), 1), ((-2, 3), 0), ((-3, 3), 1), ((-3, 2), 1), ((-1, 3), 0), ((-1, 4), 0), ((-2, 4), 1), ((0, 4), 0), ((0, 5), 1), ((-1, 5), 1), ((0, 3), 0), ((1, 3), 0), ((1, 4), 1), ((1, 2), 0), ((2, 2), 1), ((2, 3), 1)])" ] }, "execution_count": 50, "metadata": {}, "output_type": "execute_result" } ], "source": [ "grid.items()" ] }, { "cell_type": "code", "execution_count": 51, "metadata": {}, "outputs": [], "source": [ "def count_infections2(input, pos, bursts):\n", " grid = to_grid(input)\n", " directions = [(-1, 0), (0, 1), (1, 0), (0, -1)]\n", " direction = 0\n", " infections = 0\n", " for _ in range(bursts):\n", " if grid[pos] == 0:\n", " direction = (direction - 1) % len(directions) # turn left\n", " grid[pos] = 'W'\n", " elif grid[pos] == 'W':\n", " grid[pos] = 1\n", " infections += 1\n", " elif grid[pos] == 1:\n", " direction = (direction + 1) % len(directions) # turn right\n", " grid[pos] = 'F'\n", " elif grid[pos] == 'F':\n", " direction = (direction + 2) % len(directions) # reverse\n", " grid[pos] = 0\n", " # then step \n", " pos = (pos[0] + directions[direction][0], \n", " pos[1] + directions[direction][1])\n", " return infections" ] }, { "cell_type": "code", "execution_count": 52, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "26" ] }, "execution_count": 52, "metadata": {}, "output_type": "execute_result" } ], "source": [ "count_infections2(test_input, pos=(1, 1), bursts=100)" ] }, { "cell_type": "code", "execution_count": 53, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2511944" ] }, "execution_count": 53, "metadata": {}, "output_type": "execute_result" } ], "source": [ "count_infections2(test_input, pos=(1, 1), bursts=10000000)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Ok, real input now." ] }, { "cell_type": "code", "execution_count": 54, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2511416" ] }, "execution_count": 54, "metadata": {}, "output_type": "execute_result" } ], "source": [ "count_infections2(input, pos=(12, 12), bursts=10000000)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 23 " ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "input = \"\"\"set b 67\n", "set c b\n", "jnz a 2\n", "jnz 1 5\n", "mul b 100\n", "sub b -100000\n", "set c b\n", "sub c -17000\n", "set f 1\n", "set d 2\n", "set e 2\n", "set g d\n", "mul g e\n", "sub g b\n", "jnz g 2\n", "set f 0\n", "sub e -1\n", "set g e\n", "sub g b\n", "jnz g -8\n", "sub d -1\n", "set g d\n", "sub g b\n", "jnz g -13\n", "jnz f 2\n", "sub h -1\n", "set g b\n", "sub g c\n", "jnz g 2\n", "jnz 1 3\n", "sub b -17\n", "jnz 1 -23\"\"\"" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "def isdigit(s):\n", " try:\n", " int(s)\n", " is_dig = True\n", " except ValueError:\n", " is_dig = False\n", " return is_dig" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "def get_value(instr, registers):\n", " if isdigit(instr):\n", " return int(instr)\n", " else: \n", " return registers[instr]" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "import re" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "def count_muls(input, registers=None, debug=False):\n", " lines = input.split('\\n')\n", " if registers is None:\n", " registers = dict(zip('abcdefgh', [0, 0, 0, 0, 0, 0, 0, 0]))\n", " mulcount = 0\n", " index = 0\n", " while index > -1 and index < len(lines):\n", " jump = False\n", " line = lines[index]\n", " m = re.match(\"(set|sub|mul|jnz) (\\w)\\s?([-\\w\\d]+)?\", line)\n", " assert m is not None\n", " instruction, arg1, arg2 = m.groups()\n", " if debug:\n", " print(f\"line: {index}, '{line}'\")\n", " if arg1 == 'h':\n", " print(f\"line {index} : {line}, h={registers['h']}\")\n", " if instruction == 'set':\n", " registers[arg1] = get_value(arg2, registers)\n", " elif instruction == 'sub':\n", " registers[arg1] -= get_value(arg2, registers)\n", " elif instruction == 'mul': \n", " registers[arg1] = registers[arg1] * get_value(arg2, registers)\n", " mulcount += 1\n", " elif instruction == 'jnz':\n", " if get_value(arg1, registers) != 0:\n", " jump = True\n", " index += get_value(arg2, registers)\n", " if not jump:\n", " index += 1\n", " \n", " return mulcount, registers " ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(4225, {'a': 0, 'b': 67, 'c': 67, 'd': 67, 'e': 67, 'f': 1, 'g': 0, 'h': 0})" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "count_muls(input)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## part2: fixing the processor " ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "def step(input, index, registers, debug=True):\n", " lines = input.split('\\n')\n", " jump = False\n", " line = lines[index]\n", " m = re.match(\"(set|sub|mul|jnz) (\\w)\\s?([-\\w\\d]+)?\", line)\n", " assert m is not None\n", " instruction, arg1, arg2 = m.groups()\n", " if debug:\n", " print(f\"line: {index}, '{line}'\")\n", " if arg1 == 'h':\n", " print(f\"line {index} : {line}, h={registers['h']}\")\n", " if instruction == 'set':\n", " registers[arg1] = get_value(arg2, registers)\n", " elif instruction == 'sub':\n", " registers[arg1] -= get_value(arg2, registers)\n", " elif instruction == 'mul': \n", " registers[arg1] = registers[arg1] * get_value(arg2, registers)\n", " elif instruction == 'jnz':\n", " if get_value(arg1, registers) != 0:\n", " jump = True\n", " index += get_value(arg2, registers)\n", " if not jump:\n", " index += 1\n", " \n", " return index, registers " ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [], "source": [ "from ipywidgets import interact_manual" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "164f88651d4648ff9a3f080f89a7bf4c", "version_major": 2, "version_minor": 0 }, "text/html": [ "

Failed to display Jupyter Widget of type interactive.

\n", "

\n", " If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n", " that the widgets JavaScript is still loading. If this message persists, it\n", " likely means that the widgets JavaScript library is either not installed or\n", " not enabled. See the Jupyter\n", " Widgets Documentation for setup instructions.\n", "

\n", "

\n", " If you're reading this message in another frontend (for example, a static\n", " rendering on GitHub or NBViewer),\n", " it may mean that your frontend doesn't currently support widgets.\n", "

\n" ], "text/plain": [ "interactive(children=(Button(description='Run Interact', style=ButtonStyle()), Output()), _dom_classes=('widget-interact',))" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "registers = dict(zip('abcdefgh', [0, 0, 0, 0, 0, 0, 0, 0]))\n", "index = 0\n", "\n", "@interact_manual\n", "def step_system():\n", " global registers, index\n", " index, registers = step(input, index, registers)\n", " print(registers)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's try to translate this to a Python program to see the logic appear. First, our unit test (to check it yields 4225)." ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "4225\n" ] } ], "source": [ "count = 0\n", "a = 0\n", "b = c = d = e = f = g = h = 0\n", "b = 67 #set b 67\n", "c = b #set c b\n", "if a != 0:\n", " b = b * 100; count += 1\n", " b -= -100000\n", " c = b\n", " c -= -17000\n", "while True:\n", " f = 1\n", " d = 2\n", " while True:\n", " e = 2\n", " while True:\n", " g = d\n", " g *= e; count += 1 \n", " g -= b\n", " if g == 0:\n", " f = 0\n", " e -= -1\n", " g = e\n", " g -= b\n", " if g == 0:\n", " break\n", " d -= -1\n", " g = d\n", " g -= b\n", " if g == 0:\n", " break\n", " if f == 0:\n", " h -= -1\n", " g = b\n", " g -= c\n", " if g == 0:\n", " break\n", " b -= -17\n", "print(count)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now let's modify the program and get down to the logic." ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n", "905\n" ] } ], "source": [ "d = f = g = h = 0\n", "b = 106700\n", "c = 123700\n", "while True:\n", " f = 1\n", " d = 2\n", " while True:\n", " if b % d == 0:\n", " f = 0\n", " d += 1\n", " if d == b:\n", " break\n", " if f == 0:\n", " h += 1\n", " if b == c:\n", " break\n", " b += 17\n", " print('+', end='')\n", "print()\n", "print(h)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 24 " ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "input = \"\"\"24/14\n", "30/24\n", "29/44\n", "47/37\n", "6/14\n", "20/37\n", "14/45\n", "5/5\n", "26/44\n", "2/31\n", "19/40\n", "47/11\n", "0/45\n", "36/31\n", "3/32\n", "30/35\n", "32/41\n", "39/30\n", "46/50\n", "33/33\n", "0/39\n", "44/30\n", "49/4\n", "41/50\n", "50/36\n", "5/31\n", "49/41\n", "20/24\n", "38/23\n", "4/30\n", "40/44\n", "44/5\n", "0/43\n", "38/20\n", "20/16\n", "34/38\n", "5/37\n", "40/24\n", "22/17\n", "17/3\n", "9/11\n", "41/35\n", "42/7\n", "22/48\n", "47/45\n", "6/28\n", "23/40\n", "15/15\n", "29/12\n", "45/11\n", "21/31\n", "27/8\n", "18/44\n", "2/17\n", "46/17\n", "29/29\n", "45/50\"\"\"" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "test_input = \"\"\"0/2\n", "2/2\n", "2/3\n", "3/4\n", "3/5\n", "0/1\n", "10/1\n", "9/10\"\"\"" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "def parse_input(input):\n", " cables = []\n", " for line in input.split('\\n'):\n", " cables.append(list(map(int, line.split('/'))))\n", " return cables" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[[0, 2], [2, 2], [2, 3], [3, 4], [3, 5], [0, 1], [10, 1], [9, 10]]" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "parse_input(test_input)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "def bridge_strength(bridge):\n", " strength = 0\n", " for item in bridge:\n", " strength += item[0] + item[1]\n", " return strength" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "57" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "bridge_strength(parse_input(test_input))" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "bridge_strength([])" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[[0, 2], [2, 2], [2, 3], [3, 4], [3, 5], [0, 1], [10, 1], [9, 10]]" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "bricks = parse_input(test_input)\n", "bridge = []\n", "\n", "bricks" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's build all the blocks." ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "def build_all_bridges(input):\n", " bricks = parse_input(input)\n", " unfinished = [([], bricks)]\n", " finished = []\n", " while len(unfinished) > 0:\n", " bridge, bricks = unfinished.pop()\n", " # add a chain\n", " if len(bridge) == 0:\n", " # find a brick that starts with 0\n", " candidates = [ind for ind, brick in enumerate(bricks) if (brick[0] == 0 or brick[1] ==0)]\n", " for candidate in candidates:\n", " new_bricks = bricks[:]\n", " candidate = new_bricks.pop(candidate)\n", " candidate = sorted(candidate)\n", " new_bridge = bridge[:]\n", " new_bridge.append(candidate)\n", " unfinished.append([new_bridge, new_bricks])\n", " else:\n", " # append a compatible brick to the end of the chain\n", " previous = bridge[-1][1]\n", " candidates = [ind for ind, brick in enumerate(bricks) if (brick[0] == previous or brick[1] == previous)]\n", " if len(candidates) > 0:\n", " for candidate in candidates:\n", " new_bricks = bricks[:]\n", " candidate = new_bricks.pop(candidate)\n", " if candidate[0] != previous:\n", " candidate = list(reversed(candidate))\n", " new_bridge = bridge[:]\n", " new_bridge.append(candidate)\n", " unfinished.append([new_bridge, new_bricks])\n", " else:\n", " finished.append([bridge, bricks])\n", " return finished" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "31" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "finished = build_all_bridges(test_input)\n", "\n", "max(map(bridge_strength, [item[0] for item in finished]))" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2006" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "finished = build_all_bridges(input)\n", "\n", "max(map(bridge_strength, [item[0] for item in finished]))" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/plain": [ "34" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "max([len(bridge) for bridge, bricks in finished])" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1994" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "max([bridge_strength(bridge) for bridge, bricks in finished if len(bridge) == 34])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Day 25 " ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [], "source": [ "def checksum(tape):\n", " return sum(tape.values())" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from collections import defaultdict" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [], "source": [ "tape = defaultdict(int)\n", "cursor = 0\n", "state = 'A'\n", "for _ in range(6):\n", " if state == 'A':\n", " if tape[cursor] == 0:\n", " tape[cursor] = 1\n", " cursor += 1\n", " state = 'B'\n", " elif tape[cursor] == 1:\n", " tape[cursor] = 0\n", " cursor -= 1\n", " state = 'B'\n", " elif state == 'B':\n", " if tape[cursor] == 0:\n", " tape[cursor] = 1\n", " cursor -= 1\n", " state = 'A'\n", " elif tape[cursor] == 1:\n", " tape[cursor] = 1\n", " cursor += 1\n", " state = 'A'\n" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "defaultdict(int, {-2: 1, -1: 1, 0: 0, 1: 1})" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tape" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "checksum(tape)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now on to the real instructions:" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "tape = defaultdict(int)\n", "cursor = 0\n", "state = 'A'\n", "for _ in range(12481997):\n", " if state == 'A':\n", " if tape[cursor] == 0:\n", " tape[cursor] = 1\n", " cursor += 1\n", " state = 'B'\n", " else:\n", " tape[cursor] = 0\n", " cursor -= 1\n", " state = 'C'\n", " elif state == 'B':\n", " if tape[cursor] == 0:\n", " tape[cursor] = 1\n", " cursor -= 1\n", " state = 'A'\n", " else:\n", " tape[cursor] = 1\n", " cursor += 1\n", " state = 'D'\n", " elif state == 'C':\n", " if tape[cursor] == 0:\n", " tape[cursor] = 0\n", " cursor -= 1\n", " state = 'B'\n", " else:\n", " tape[cursor] = 0\n", " cursor -= 1\n", " state = 'E'\n", " elif state == 'D':\n", " if tape[cursor] == 0:\n", " tape[cursor] = 1\n", " cursor += 1\n", " state = 'A'\n", " else:\n", " tape[cursor] = 0\n", " cursor += 1\n", " state = 'B'\n", " elif state == 'E':\n", " if tape[cursor] == 0:\n", " tape[cursor] = 1\n", " cursor -= 1\n", " state = 'F'\n", " else:\n", " tape[cursor] = 1\n", " cursor -= 1\n", " state = 'C'\n", " elif state == 'F':\n", " if tape[cursor] == 0:\n", " tape[cursor] = 1\n", " cursor += 1\n", " state = 'D'\n", " else:\n", " tape[cursor] = 1\n", " cursor += 1\n", " state = 'A' " ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3362" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "checksum(tape)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.1" }, "toc": { "colors": { "hover_highlight": "#DAA520", "navigate_num": "#000000", "navigate_text": "#333333", "running_highlight": "#FF0000", "selected_highlight": "#FFD700", "sidebar_border": "#EEEEEE", "wrapper_background": "#FFFFFF" }, "moveMenuLeft": true, "nav_menu": { "height": "254px", "width": "254px" }, "navigate_menu": true, "number_sections": true, "sideBar": true, "skip_h1_title": false, "threshold": 4, "toc_cell": false, "toc_position": {}, "toc_section_display": "block", "toc_window_display": true, "widenNotebook": false } }, "nbformat": 4, "nbformat_minor": 2 }