From 629a64d98593674d4cfac0a8918ee6139356f8e3 Mon Sep 17 00:00:00 2001 From: romellem Date: Thu, 6 Dec 2018 14:56:46 -0600 Subject: [PATCH] Init Day 20 directory --- 2018/20/README.md | 152 ++++++++++++++++++++++++++++++++++++++++++++++ 2018/20/input.txt | 1 + 2 files changed, 153 insertions(+) create mode 100644 2018/20/README.md create mode 100644 2018/20/input.txt diff --git a/2018/20/README.md b/2018/20/README.md new file mode 100644 index 00000000..81f271e6 --- /dev/null +++ b/2018/20/README.md @@ -0,0 +1,152 @@ +# Answers + +| Part 1 | Part 2 | +|------------|-----------| +| ` ` | ` ` | + +## --- Day 20: A Regular Map --- + +While you were learning about instruction pointers, the Elves made considerable progress. When you look up, you discover that the North Pole base construction project has completely surrounded you. + +The area you are in is made up entirely of _rooms_ and _doors_. The rooms are arranged in a grid, and rooms only connect to adjacent rooms when a door is present between them. + +For example, drawing rooms as `.`, walls as `#`, doors as `|` or `-`, your current position as `X`, and where north is up, the area you're in might look like this: + + ##### + #.|.# + #-### + #.|X# + ##### + + +You get the attention of a passing construction Elf and ask for a map. "I don't have time to draw out a map of this place - it's _huge_. Instead, I can give you directions to _every room in the facility_!" He writes down some directions on a piece of parchment and runs off. In the example above, the instructions might have been `^WNE$`, a [regular expression](https://en.wikipedia.org/wiki/Regular_expression) or "_regex_" (your puzzle input). + +The regex matches routes (like `WNE` for "west, north, east") that will take you from your current room through various doors in the facility. In aggregate, the routes will take you through _every door in the facility at least once_; mapping out all of these routes will let you build a proper map and find your way around. + +`^` and `$` are at the beginning and end of your regex; these just mean that the regex doesn't match anything outside the routes it describes. (Specifically, `^` matches the start of the route, and `$` matches the end of it.) These characters will not appear elsewhere in the regex. + +The rest of the regex matches various sequences of the characters `N` (north), `S` (south), `E` (east), and `W` (west). In the example above, `^WNE$` matches only one route, `WNE`, which means you can move _west, then north, then east_ from your current position. Sequences of letters like this always match that exact route in the same order. + +Sometimes, the route can _branch_. A branch is given by a _list of options_ separated by pipes (`|`) and wrapped in parentheses. So, `^N(E|W)N$` contains a branch: after going north, you must choose to go _either east or west_ before finishing your route by going north again. By tracing out the possible routes after branching, you can determine where the doors are and, therefore, where the rooms are in the facility. + +For example, consider this regex: `^ENWWW(NEEE|SSE(EE|N))$` + +This regex begins with `ENWWW`, which means that from your current position, all routes must begin by moving east, north, and then west three times, in that order. After this, there is a branch. Before you consider the branch, this is what you know about the map so far, with doors you aren't sure about marked with a `?`: + + #?#?#?#?# + ?.|.|.|.? + #?#?#?#-# + ?X|.? + #?#?# + + +After this point, there is `(NEEE|SSE(EE|N))`. This gives you exactly two options: `NEEE` and `SSE(EE|N)`. By following `NEEE`, the map now looks like this: + + #?#?#?#?# + ?.|.|.|.? + #-#?#?#?# + ?.|.|.|.? + #?#?#?#-# + ?X|.? + #?#?# + + +Now, only `SSE(EE|N)` remains. Because it is in the same parenthesized group as `NEEE`, it starts from the same room `NEEE` started in. It states that starting from that point, there exist doors which will allow you to move south twice, then east; this ends up at another branch. After that, you can either move east twice or north once. This information fills in the rest of the doors: + + #?#?#?#?# + ?.|.|.|.? + #-#?#?#?# + ?.|.|.|.? + #-#?#?#-# + ?.?.?X|.? + #-#-#?#?# + ?.|.|.|.? + #?#?#?#?# + + +Once you've followed all possible routes, you know the remaining unknown parts are all walls, producing a finished map of the facility: + + ######### + #.|.|.|.# + #-####### + #.|.|.|.# + #-#####-# + #.#.#X|.# + #-#-##### + #.|.|.|.# + ######### + + +Sometimes, a list of options can have an _empty option_, like `(NEWS|WNSE|)`. This means that routes at this point could effectively skip the options in parentheses and move on immediately. For example, consider this regex and the corresponding map: + + ^ENNWSWW(NEWS|)SSSEEN(WNSE|)EE(SWEN|)NNN$ + + ########### + #.|.#.|.#.# + #-###-#-#-# + #.|.|.#.#.# + #-#####-#-# + #.#.#X|.#.# + #-#-#####-# + #.#.|.|.|.# + #-###-###-# + #.|.|.#.|.# + ########### + + +This regex has one main route which, at three locations, can optionally include additional detours and be valid: `(NEWS|)`, `(WNSE|)`, and `(SWEN|)`. Regardless of which option is taken, the route continues from the position it is left at after taking those steps. So, for example, this regex matches all of the following routes (and more that aren't listed here): + +* ENNWSWWSSSEENEENNN +* ENNWSWWNEWSSSSEENEENNN +* ENNWSWWNEWSSSSEENEESWENNNN +* ENNWSWWSSSEENWNSEEENNN + +By following the various routes the regex matches, a full map of all of the doors and rooms in the facility can be assembled. + +To get a sense for the size of this facility, you'd like to determine which room is _furthest_ from you: specifically, you would like to find the room for which the _shortest path to that room would require passing through the most doors_. + +* In the first example (`^WNE$`), this would be the north-east corner _`3`_ doors away. +* In the second example (`^ENWWW(NEEE|SSE(EE|N))$`), this would be the south-east corner _`10`_ doors away. +* In the third example (`^ENNWSWW(NEWS|)SSSEEN(WNSE|)EE(SWEN|)NNN$`), this would be the north-east corner _`18`_ doors away. + +Here are a few more examples: + + Regex: ^ESSWWN(E|NNENN(EESS(WNSE|)SSS|WWWSSSSE(SW|NNNE)))$ + Furthest room requires passing 23 doors + + ############# + #.|.|.|.|.|.# + #-#####-###-# + #.#.|.#.#.#.# + #-#-###-#-#-# + #.#.#.|.#.|.# + #-#-#-#####-# + #.#.#.#X|.#.# + #-#-#-###-#-# + #.|.#.|.#.#.# + ###-#-###-#-# + #.|.#.|.|.#.# + ############# + + + Regex: ^WSSEESWWWNW(S|NENNEEEENN(ESSSSW(NWSW|SSEN)|WSWWN(E|WWS(E|SS))))$ + Furthest room requires passing 31 doors + + ############### + #.|.|.|.#.|.|.# + #-###-###-#-#-# + #.|.#.|.|.#.#.# + #-#########-#-# + #.#.|.|.|.|.#.# + #-#-#########-# + #.#.#.|X#.|.#.# + ###-#-###-#-#-# + #.|.#.#.|.#.|.# + #-###-#####-### + #.|.#.|.|.#.#.# + #-#-#####-#-#-# + #.#.|.|.|.#.|.# + ############### + + +_What is the largest number of doors you would be required to pass through to reach a room?_ That is, find the room for which the shortest path from your starting location to that room would require passing through the most doors; what is the fewest doors you can pass through to reach it? \ No newline at end of file diff --git a/2018/20/input.txt b/2018/20/input.txt new file mode 100644 index 00000000..53d71d91 --- /dev/null +++ b/2018/20/input.txt @@ -0,0 +1 @@ +^ESWSWSESEENENESENEESEESEENNESSESSSSSEEEESENENESESWSESSESSENNEENWNWNENNWSW(SSSEWNNN|)NWNNNENNNNESEEEESSSENNNNWNNWSWS(E|WNNWNEE(S|ENWNWWWS(SWNNNNWSSSSSWNNWWSWWNNWWNNEENEEENWNNWNWWWNEEENWWNENWNNENNWSWWWNWSSSWNNWNENNESEESENNESEENWNNESENNWWNENEEENNWSWNNNENEESS(W(N|W)|EENWNEENWNNENWNENENNENEEESESWSEEEENWNW(NEENWWW(WNNESEENNENENWWWNEEEEESENESESSSWSESWWWNNNW(N(EEESWSS(NNENWWEESWSS|)|N)|SW(N|WSESE(N|SEESWWSSESSSEENWNENEESSEESWWSESWWSWSESEEESEESSESWWSSEEN(W|ESSSWSSSWNNNWWSSE(SWWWWWSEESENESSSWNWWSSE(EEENNENEEESWSW(N|SSW(NN|WWSEESEEESWSEENNNWW(W|NEN(EN(NESEE(SWSESSWSSE(SSSWNWSWNWSWWNN(NWN(E|WSWNN(E|WWSESSESESWSEE(NNNWESSS|)EESEESESSSWSSENEE(NWNNNNE(NWW(S|WW)|SSS)|SSSSWNN(N|WSWNWWNENNWNEENWNWWS(WNWWWWSWNNNNNE(NWWWNNENE(SS(W|E)|NEN(ESNW|)WWWNWSWWNENNESEE(NWN(EE|NNWSWWWNWWNNEENWWWWWSSWSESSSSWNWNENWWSWNNNNENNWSWNWNENENEENNWSWNWSWNW(SSWW(SEE(ENEWSW|)SSWW(NEWS|)SWSEESSSWSWSS(WNN(NENWNEES(NWWSESNWNEES|)|W)|ENENEENNW(S|NNN(ESES(W|SSSSEESWSEE(EEENNEEESSWW(NEWS|)SWSSWSSWNNWWWSEESWSSS(WNNW(SS|N(E|NNWNWSWW(SESS(SSSWWW(S|N(EENWWEESWW|)WW)|ENE(NWES|)S)|NNW(S|NEENENESSE(N|S(SENEES(ENESNWSW|)W|WW(WSNE|)N))))))|EENWNEEENEN(NNESSSSSESSSSSWSSW(NNNNWNW(SSESSNNWNN|)(W|NNEE(N|S(W|SE(SS|N))))|SSSEEEESEEESSSENNNESEESSSEESEENNW(S|NNEN(ESE(N|EESWSWSSEEN(W|NESSSSWSEE(SWWWSESWWWNWNENWWNN(WSSSWNNWNWSWNWNN(ESE(NNNWS|EES)|WSSSESSENEESWSESEEE(N(N|WW)|ESEEESWSEENNENNESSSWSSWSSWNWWSSE(N|ESWSESEEE(SWWWSSEESE(NNWWEESS|)SSWWSESE(SSWSESSSSSSWSWNNWNENNN(ESSSSNNNNW|)WSSWSSSWNNWWSSE(SESENE(SSSESWSSEEN(W|E(NNNN(WS(WNSE|)SS|N)|SSSWWN(E|WWWWWS(WWNENWNEENNNN(WN(E|NNNWSWSWSWNNENWWWNWWNWSWSWNNWSWSSSSWSEESEENWNWNEEN(WWNSEE|)ESS(SSESSESWSSS(WWNENNWSWNWSWNWWSWNNWSWWSSWNWNNE(S|EENWNNWWWWSEES(ENSW|)WSSWSSS(WNNWWSS(ENSW|)WNWWNEENWWNNWNWNWWNWNWNNNNWWWSSWSWNNENWNEEENNNEESWSSEESESENNNESENESENNESESSW(SEENESSESWWNWSSESWSWWW(SEESWSEESENNN(WSNE|)NE(NNESEENESENEESSS(WNNSSE|)SENNNNNWNEESE(SWSSSSES(EEN(WNWESE|)ESEENW|W)|NNWWWWWNNWSSSS(ENESNWSW|)WW(S|NENNNNWWWW(SEEESWSE(WNENWWEESWSE|)|NNNWS(S|WNWWNNNWSSWSWNNWWSWWWS(EEESSE(S(WW|S)|N(EES(W|EN(E(E|S)|N))|NN))|WNWNNEENENNESENEEESWWSEE(ENEES(W|SSENEEENNWNWW(SSE(N|E)|NEENWNEENWNNNNEENEEEENNN(ENEN(ESEENEEEESSENENNE(SE(SSESSENE(NWNWESES|)SSSWSSWNWSSWSESEESESSWSSSENNEESSSESWSSWWWWSSWNNNWNWWSSWWSEEEE(NWNSES|)SS(SENEENEN(W|ESSENEN(ENN(WSN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(WSSWNNWSWNNNNNWWWSSSSSSSSES(EENEENWWW(S|WNE(EE|NNW(S|NENNWS)))|WWWNENWWWNENESENNWWWSWWNENNWWS(SWNNWWNNESENNEENEENWWWWWS(SWWWNWNENNWNENESENNEEEESESWWWN(WSSWWSSE(SWEN|)NEENESEEN(W|ESENEESENENESENNWNNEEEESEESWWSWSSENESS(WWSSW(NNWWN(WSSWWN(W(SSSE(NEEEENW(ESWWWWEEEENW|)|SSSWNNWSW(SEWN|)NNW(WWSEEWWNEE|)NEE(NN|S))|N)|E)|EENNNN(ESNW|)W)|SSSSEN)|ESENNESENNWWN(W(W|SS)|NEE(SWEN|)ENENNWWWWWNNEES(W|EENWNNNEEESS(W(WNEWSE|)S(S|E)|EENENWNW(WWWWWNNNNNNWSWSESWWSSWWNENNWSWSWSESSEESWWWNWN(E|WSWWSWWWWSSSWNNNWWSWWSWNWWWSEESWWWSWWNENWNENWNNWNNNNNWNNWWWSEESSESWWNNWSWWSSENESEEESSWNWSSESSEE(NWNEWSES|)SSWWN(WNWSWWNNWSWNWNENEN(WNNE(S|NNWSWWNNNWWWWWWNENWWNNWWN(WSWNWWSESSESWSSEESWSSWSSENEESWSSWSWSSWNNNN(NWSWSESWSESSESSESESWSSWSEESENNWNEENEESENNWNENNENNWNWWSWSWW(SS(WNSE|)ES(S(EENNW(S|N(W|ENE(N|E|SS)))|S)|W)|NENENEN(W|ENNNENWWS(SS|WN(WSNE|)NEEN(NNWSW(SEWN|)W(W|NNN(EESWSNENWW|)W)|EEESW(SEEEE(NNWWSE|SSSENE(NWES|)SSWSWSESWSWWW(SEEEENE(N|SEE(NWES|)ESSEESENN(WWNEEWWSEE|)ESSESWSWWN(E|WWSESEEESWSWNWSSWSSESENEEENWN(WWS(W|E)|NESENENWNW(S|NENNN(WNEWSE|)EESSSW(NN|SEEE(S(E|WSW(SESWW(N|SSSWN(NN|WSWW(NEWS|)SSWSSESESESWSWWSSWSSEEESWSSSSSWSWNWSWWWSSWNWSWSSEESSWWN(E|WSWWNNNNWNNWSWSSE(ESSSWNNWWNWSSSSWNNWSSWNWSWSSSWNWSSWWSSWSWNWWSW(NNNNESSENNEE(SWSEWNEN|)NWNWNEENNWSWNNNWW(NEENNWW(SEWN|)NNNESSEENEEESESEENWNWNWWWNENNWSWSSW(S|NNNENENWNWWW(NENENNWNNW(SSS(S|E)|NEESEEESESSWWW(SES(WW|SEESWSEENNNN(WWSEWNEE|)EENNESEESSENNEESENNEEENEEESWSESSWWWNE(E|N(WWWSESWWSWSWSSSSWNNNWWWWSW(WSES(WWNNSSEE|)ES(ES(W|SSSWSWWSESWSES(WWNW(SSS(E(NEESW|SWSE)|W)|NNNE(N(EE|WWN(E(NWES|)E|WSSSSENN(SSWNNNSSSENN|)))|SS))|ENNEN(W|NENNNENWNE(NNNWWS(SENSWN|)W|ESSENESE(SWSWWW(NEEWWS|)SE(EE|SSWNWSSW(ENNESEWNWSSW|))|ENESEENNW(S|NNNWSSWNNNW(NENEEEEESSSESENENENWWW(SEWN|)NENNNW(SS|NEENNWSWNWWWWWWS(E|WWNWSWNNWWWWSS(ENEESWSEEEE(WWWWNEWSEEEE|)|WNW(SSSENSWNNN|)WNENNNESES(WSNE|)EEENNWSWNWNEENNESENN(ESSSW(W|SESS(WNSE|)ENNENEENNESENEENNNNWWNNNESENEENN(ESEE(NWES|)S(SSSESSWWWSWNNEE(E|NWNN(WWS(WW|ESWSSSSESWWWSSSENESSWS(EENESENNNWW(SEWN|)N(WW|EEE(NWWNENES(NWSWSEWNENES|)|SE(N|ES(ENSW|)SWNWSSEESSSS(SSWSSW(NWNENWW(SS|NEEE(S|NWNENWWSS(NNEESWENWWSS|)))|SESWSW(SEESES(WWWS(E|WNN(EE|WN(ENSW|)WSWW(NN(ESNW|)W(S|NNN(ESS|WWSE))|SSES(SWW(WNEEWWSE|)SSS(ENNSSW|)S|ENE(NWWEES|)S))))|ENNWN(NESNWS|)W)|N))|EN(ESNW|)N))))|WNWNWN(ENWESW|)WSW(WSS(WW|S|EEN(ESEWNW|)W)|N)))|E(NWES|)S))|EE)|WSWNWWWS(SSSSSEESWS(E|WNWNNWSSWW(NEN(N|W)|SSS(S|ENNE(SS|E))))|EE)))|WNWWNNNENNWSWSWNNENN(ESNW|)WNENWNWSWNNWWNWWWW(SEEESEESSSSWSESSWWSEEENE(NWNEN(E|NW(NEWS|)S)|SEESSSE(E|SWS(WSWNWSSSWWWS(WWNENWW(NNNESSEENESS(ENNNNESENE(S|NWWWWWSESWW(S|NNN(NWSSSWNNNNNNNEENE(SSS(WSWNNE|E)|NWN(EESSNNWW|)NWWSESWSE(WNENWNSESWSE|))|EEEEEE)))|W)|SS)|SENE(S|E))|E)))|NNNNESSES(W|ENNNNESSESS(WNSE|)EENNNW(WNNEENWNWNNNWSWSWWSSW(NNNNNESE(SWEN|)NE(EEN(WWWWW|ESSEESWWSESEEESE(SWSWNNWSS(SSS(ENEEN(NENSWS|)WW|SSW(SEWN|)WW)|WW)|NNNNWNNWWS(WNSE|)ESSESWW(EENWNNSSESWW|)))|S)|SSEE(SS|N(W|NNEE(S(SWNSEN|)E|N))))|SS)))))))|WSSSS(W|E(EE|S|NNN)))))))))|W)|NNNEN(W|ENESSWS(W|EENE(S|EN(E|N)))))|N)))|NN(ESEWNW|)W))|SSE(NESNWS|)SSW(SEWN|)N))|SESSW(SESWSEE(WWNENWESWSEE|)|N))|SSSSESSW(SSSSSSESSEENESEENEESWSWWSSWNWN(WWW(SESE(N|ESWSWNW(N|SSESSESSEESWSSSSSWNNWSSSW(SEESESESWWS(WNN(NWSSSNNNES|)E|EEENNNENNNWSW(S(WNWESE|)(S|E)|NNNENWNEESSS(EEESWSESWSW(NNN|SSS(WNNSSE|)EENEENNW(NEENESSENESEESESS(ENNEESEENNESESWS(WWWWNSEEEE|)EENNNWNWWWS(S|WNNWSSWNNWNWSS(ESNW|)WNNWW(SEWN|)NNEES(ENNNESEENESSSENNNNWNEENWWWNWSWNNNNWNEEEEEESWSSENEESWS(SSSWSEEENESEENWNNNNWSW(WSS(EENWESWW|)S|NNENN(ESES(W|ESEEEEN(NWWW(SEEWWN|)W|ESSWWWWSESWSW(NNNW(SS|N)|SSSSWWNN(ESNW|)WWWWSSW(NN|SW(SEEEESEESWSSENEEENENWNWN(ENENESESSW(NWSNES|)SEENEESSSWSS(WNWNN(WSSS(WN(WSWW(NEWS|)WW|N)|E)|E(ENSW|)S)|EEN(NENWNENWNENENNENESEENESSESEEEESEENWNWN(NNNWWWSEESWWW(SEEESWW(EENWWWEEESWW|)|NNWWN(WWNNWWSWWWNW(NENESSENNESENES(NWSWNWESENES|)|SSSESENN(W|ESENE(SS(WSW(WWWSEEESWWS(E|SWWNENWWNWWW(NENENESS(W|E(S|N(NNWWEESS|)E))|S))|N)|EE(NWES|)(EE|S))|N)))|EEN(ESEEENWW(EESWWWEEENWW|)|W)))|EEENEE(NWNEWSES|)SSSWSSW(SESESENENNEE(SSW(SWSWS(EENENEE(SWS(EEE|W)|NNW(N|S))|WWN(E|NWWN(WWSESS(ENESNWSW|)WNWSWNWWNEENE(S|NN(NWWSWNWWN(E|WWSESWWSESWSSS(WWNENNNNNENNEEE(WWWSSWENNEEE|)|EENN(WSNE|)ENN(WSNE|)E(NWES|)ES(ENENSWSW|)WSSS(WNSE|)EE))|EEESWW))|E)))|N)|NWWNW(SWSESW|N))|NNN(ENSW|)W))|W))|WWS(ESESWENWNW|)WNWW(W|NEENWW))|WWWNN(ES|WS))))))|WSWWNENWNWSWWWWWWWNWNWWWWWSSWWSWW(WSW(WSWSEEEN(W|ESESWSEESESWW(SSES(W|EENWN(ENNESSEENEEE(SWS(E|W(WSSSWNW(NNESNWSS|)SW(SEWN|)N|N))|EN(WWNWSWW(S|NENNEEES(WW|E(SWEN|)NNWWWNWSWSWS(SWNNNWW(SES(S|W)|WN(EENESE(ENWNNESESEE(ESW|NWNW)|S)|W))|E)))|ESE(NESNWS|)S))|W))|NWSWNNNWWSE(WNEESSNNWWSE|)))|N)|NNE(S|EEN(NNNNNWSSWNNWNWNNENENNWNNWSSS(E|SWWW(NENNNE(SSS|N(EEEENWW(NNESEEESSSSENNNNNWN(WWSEWNEE|)ENWNEN(W|EESSW(N|SEEEENNWN(WSSEWNNE|)EESSEENNW(S|N(EESENEEEENNENWN(WW|ENESESSSW(SW(N|SSSSSSWNNNNNWWSSSWWW(NEEN(N|WW)|SWWW(NEEWWS|)WSWWN(E|WSSSW(NNN|SSSWWWNW(SSESWSEESWS(EENESESSESESWWWS(EEEESENEENNE(SSSEE(NWNSES|)SWWWW(NEWS|)W|NWWWNNNE(ENEEEEEES(SENENE(S|NNNWWWWSES(E(NESNWS|)S|WWNNWNENNWNEE(ESSEENENENNNWW(SESWSWS(NENENWESWSWS|)|NNEEES(WW|EESSWNWSSESESS(S|WWW(NE(N|E)|WSWWWWNN(SSEEEEWWWWNN|))|ENNN(ENWNNEES(W|SENE(NNENWWWS(ESNW|)WWWNEENNNNWSSSWWWW(S(EESNWW|)W(N|W)|NNEEE(SWWEEN|)NWNEENNENENNWWS(SW(WSWS(EENSWW|)W(SSENSWNN|)NW(S|WW)|NNNNEES(W|ENEESSSW(NN|SEESEENESE(NNNNNESSENNNEESS(W(SSWWSE|N)|ENNNEENESENNWWWSWNWSWWNENNENESS(W|ENEN(NW(S|N(E|WSWWWWNWSSSENE(SSWWWSSSS(EEN(NNWSSNNESS|)EEE|SWWNENNNNWNENNWWNWNENENEESWSWSEE(NEENN(EESSW(SEENENW(ESWSWWEENENW|)|N)|W(S|NENWWNWNN(ESNW|)WSWWSW(NNEEN(NN|E)|SSWSES(ENNNES(S|EN(NW|ESE))|SWNWNWNEN(WWSS(W|SESESESSESSESWWSWSEEEN(W|ES(ENNWNNN(W(NWNSES|)S|E)|S(SSEESE(SWW(WNEWSE|)S|N)|WWWWW(NNNNN(WWSESWW(EENWNEWSESWW|)|NE(SESWSNENWN|)N)|W)))))|E)))))|SSS))|E)))|ESS(W|EESSSS(W|ENNESSSS(WNWSNESE|)ENNNEN(ESEEESWWWS(W(SEWN|)N|E)|WNNWSWN(SENESSNNWSWN|)))))))|SSWS(WSESWWWSWWNW(S|NEE(S|NNN(ESE(SSWNSENN|)EN(E|W)|WN(WSWSEESW(ENWWNEWSEESW|)|E))))|E)))))|E))|SSSWW(NEWS|)SW(N|S)))|W))))|NN(WSWW(NEWS|)WWWSSENEESS(SSSWNWSS(EEENSWWW|)WWS(E|WNNWWSWN(WWWSEES(ESEE(SE(N|SW(WNSE|)SESSEENW(ESWWNNSSEENW|))|N(N|W))|W)|NEENNNW(SWSEWNEN|)NEESE(SEES(ENNSSW|)WSSWNWN(N|E)|NN)))|E)|NNN))))|W)|SS))|WNW(NNNESSE(NN|E)|S))|WWN(E|W|N))|N(WS|ENN))))))|NN))|WWNNWSS(NNESSEWNNWSS|)))))|W)|WW(N|WSSE(N|S))))|SSW(SSES(W|EEE(S(S|WWWS|EN)|NWWN(NE(NWES|)S|W)))|N)))|W)))))|WWWNNWW(SE|NEE))|W))|WNWSWWWNN(W(SSWWEENN|)N|EE(SWEN|)E))|SW(WSNE|)N))|W)))|NNNNNESENNWNW(N(E|NN)|S))))|NN)|E)|N))|N))))|N))|NNNW(SS|NENESS(ENE(S|ENN(WSWENE|)ENESE(SS(WWNEWSEE|)ENEESWSEEEEES(ENNNNWWNN(ESENE(NWWEES|)SENEEEE(SWWSES(WWN(WWSEWNEE|)N|E(N|SEESEEN(E|W)))|NESENN(ESSNNW|)NW(NNES|SWNWW))|WWWSSENESSEESWWWN(SEEENWESWWWN|))|SWNWWWSEE(WWNEEEWWWSEE|))|NN))|S))))))))|NNNEE(SSWNSENN|)N(E|WNWWS(W(NNENEEES(WW|S)|S(ESNW|)W)|E))))|W)))))|E(S|E))|EEEESEEN(EEESWSW(WW(WWNSEE|)SSENESENESENESENEEEEES(WWWWSS(SENNSSWN|)WNWSW(N|S)|ENESENNNEN(WWSSWWWNN(ESENSWNW|)WSWNWWSS(WNNWSSW(ENNESSNNWSSW|)|E(EE|N))|EESSEEEEESESEEESSESWWNNWWWNWSSEES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