m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--24/a.lua72
-rw-r--r--24/b.lua121
-rw-r--r--24/input.txt535
3 files changed, 728 insertions, 0 deletions
diff --git a/24/a.lua b/24/a.lua
new file mode 100644
index 0000000..dbf6868
--- /dev/null
+++ b/24/a.lua
@@ -0,0 +1,72 @@
+tiles = {}
+
+directions = {'se', 'sw', 'ne', 'nw', 'e', 'w'}
+
+function navigate(v, h, direction)
+ if direction == 'e' then
+ return v, h+1
+ elseif direction == 'w' then
+ return v, h-1
+ end
+
+ local even = v % 2 == 0
+ local new_v = v
+ local new_h = h
+
+ if direction:sub(1, 1) == 'n' then
+ new_v = new_v - 1
+ else
+ new_v = new_v + 1
+ end
+
+
+ if even and direction:sub(2, 2) == 'e' then
+ new_h = new_h + 1
+ elseif not even and direction:sub(2, 2) == 'w' then
+ new_h = new_h - 1
+ end
+
+ return new_v, new_h
+end
+
+function parse_tile(line)
+ local vertical = ''
+ local tile = {}
+ for i = 1, #line do
+ local current = line:sub(i, i)
+ if current == 'n' or current == 's' then
+ vertical = current
+ else
+ table.insert(tile, vertical .. current)
+ vertical = ''
+ end
+ end
+
+ return tile
+end
+
+for line in io.lines('input.txt') do
+ local tile = parse_tile(line)
+ local v = 0
+ local h = 0
+
+ for _, direction in pairs(tile) do
+ v, h = navigate(v, h, direction)
+ end
+
+ if not tiles[v] then tiles[v] = {} end
+ if not tiles[v][h] then tiles[v][h] = 0 end
+
+ tiles[v][h] = tiles[v][h] + 1
+end
+
+count = 0
+for _, row in pairs(tiles) do
+ for _, flips in pairs(row) do
+ if flips % 2 == 1 then
+ count = count + 1
+ end
+ end
+end
+
+print(count)
diff --git a/24/b.lua b/24/b.lua
new file mode 100644
index 0000000..16b15b8
--- /dev/null
+++ b/24/b.lua
@@ -0,0 +1,121 @@
+tiles = {}
+
+directions = {'se', 'sw', 'ne', 'nw', 'e', 'w'}
+
+function navigate(v, h, direction)
+ if direction == 'e' then
+ return v, h+1
+ elseif direction == 'w' then
+ return v, h-1
+ end
+
+ local even = v % 2 == 0
+ local new_v = v
+ local new_h = h
+
+ if direction:sub(1, 1) == 'n' then
+ new_v = new_v - 1
+ else
+ new_v = new_v + 1
+ end
+
+
+ if even and direction:sub(2, 2) == 'e' then
+ new_h = new_h + 1
+ elseif not even and direction:sub(2, 2) == 'w' then
+ new_h = new_h - 1
+ end
+
+ return new_v, new_h
+end
+
+function parse_tile(line)
+ local vertical = ''
+ local tile = {}
+ for i = 1, #line do
+ local current = line:sub(i, i)
+ if current == 'n' or current == 's' then
+ vertical = current
+ else
+ table.insert(tile, vertical .. current)
+ vertical = ''
+ end
+ end
+
+ return tile
+end
+
+max_v = 0
+max_h = 0
+
+for line in io.lines('input.txt') do
+ local tile = parse_tile(line)
+ local v = 0
+ local h = 0
+
+ for _, direction in pairs(tile) do
+ v, h = navigate(v, h, direction)
+ end
+
+ if math.abs(v) > max_v then max_v = math.abs(v) end
+ if math.abs(h) > max_h then max_h = math.abs(h) end
+
+ if not tiles[v] then tiles[v] = {} end
+ if not tiles[v][h] then tiles[v][h] = 0 end
+
+ tiles[v][h] = (tiles[v][h] + 1) % 2
+end
+
+function black(tiles, v, h)
+ if not tiles[v] then return false end
+ return tiles[v][h] == 1
+end
+
+for i = 1, 100 do
+ max_v = max_v + 1
+ max_h = max_h + 1
+
+ local count = 0
+ local new_tiles = {}
+ for v = -max_v, max_v do
+ for h = -max_h, max_h do
+ if not new_tiles[v] then new_tiles[v] = {} end
+ local count_black = 0
+ for _, direction in pairs(directions) do
+ local v1, h1 = navigate(v, h, direction)
+ if black(tiles, v1, h1) then
+ count_black = count_black + 1
+ end
+ end
+
+ if black(tiles, v, h) then
+ if count_black == 0 or count_black > 2 then
+ new_tiles[v][h] = 0
+ else
+ count = count + 1
+ new_tiles[v][h] = 1
+ end
+ else
+ if count_black == 2 then
+ count = count + 1
+ new_tiles[v][h] = 1
+ else
+ new_tiles[v][h] = 0
+ end
+ end
+ end
+ end
+
+ tiles = new_tiles
+end
+
+count = 0
+for _, row in pairs(tiles) do
+ for _, flips in pairs(row) do
+ if flips % 2 == 1 then
+ count = count + 1
+ end
+ end
+end
+
+print(count)
diff --git a/24/input.txt b/24/input.txt
new file mode 100644
index 0000000..a65f7ae
--- /dev/null
+++ b/24/input.txt
@@ -0,0 +1,535 @@
+swsenenwneswnewseswwseswnwsweeswnw
+esweeeeneeeneeeweeeenenenee
+ewewsewswnewnwnewwwwsew
+nwnwnwnwnenwwnwsenwnwnwnwnwnwnw
+nwswseswneswseswswneswswseneseswswsenwswse
+swswswneswswswswwneseswwswsw
+newnwwnwnenenenenwsweenenwnenwnenese
+senwsewseneneseneenenwwneneeswnewsw
+eeeeneweeeseeeeeenewneswe
+wnwswwewwwsewnwnwwnwnwwwnwnwnww
+nenwnwnwnesenwwnwnwwneswnwnenesweneenwnw
+nwwnwwwwenwwswnwwwwwewsesew
+swnwswwswswewswseswnwne
+wswnewswnwwwwenewsewwwwneswe
+nwnwnenenewneneneneneenenesenwneswneswse
+nwewsenwnwneseswwwwwwswwswwwwe
+nesenwseneswseswnwneseseseseseswnwse
+wnesweseswenwnenwnweseeseseeswnwse
+swswnenenenenewneneeeneneeneneenenene
+seseseseeweseeesee
+wwwwwwwwwnewnwwwswww
+sesenwesenwseeseseseewswneseseesesw
+wnewwwsewnwwnwnwewnwswnwwwwnwe
+nwnwnenwnwneneenewswnwnenwswnwnesenwsw
+eeswwneeneneeneeneeeeesw
+seneenesewneeneswwnenenweeenenewwe
+seswseswsenwswswseswswswswenwswsesesw
+nwnwnenwnenwnenwnwnwnenwswnenwwwnwese
+wnwwwwwnwwwnwwnwnwseneenwnwnww
+ewnwnwnwnwnwnenwnwnwnenenwsenenwnwnene
+neneweeeeneeneesweseswswneseswse
+seswseeneswswswseseewsewnwswswwnwne
+swwneneneweseswnenwneeneneeeeeeee
+swwwwwwwwwwwwswswwswswnesew
+eewenwseeeeeweeeeneeese
+neneneneneeneswneeenee
+sewnwnwwswnwseenwwnenenwwnw
+swsweswswswswsewseneseswswsesweswnwsw
+nenewewwwwwwwwwnewwswsesewww
+enwsweneseseeesese
+swneseseseneeseesenwwseneswseseseseew
+nwswswneeeewneseenwnwnesewwswnwesw
+nenenwneenwneneneneneneneneneswenewne
+nwneneseeenwnwnwneneneswneswwnenwnwnenw
+neseenenwneeneneneeeeneene
+sesesewseseseswneseesesesesenewseswsese
+senwnewseneneeeneeeeeenesenwnene
+eeweneneeenweeeseesweeeee
+esesenwswnwseewseswseeeseswenenwse
+neeneeeseswseeesweneeseeesweee
+swweswnwneswswwswswneswswswswswsw
+wwswwwnwnwnenewnwenwswnwsesenwnwe
+neseneenwneeeeeneneeeewneeene
+swsenwsesesweswsewswswswsenwneseswsesw
+wewwwwwnwwwwwnwwwnw
+swseweeenwswneseseesenese
+senwsesesesesesesewseesewe
+sewnwnwnweswnwnwsenwnwnwnwsenwnwnwnwnw
+swswswswswswswswswseswswswswswswwswnesw
+wswnwnwsewwnwewwewwnesewwne
+enenenwnewnenwnenenwwneswneseswnenwsenwnw
+seseseswswseswsewnwsewswswseeseeswse
+nwseswnweswnwneseweswsesweseseswne
+seseswwnwswneneseneneseeseesenwswnwww
+wswswwwwswwneswseswnwswswsew
+senwnwwnwnwesewswnewswwsenwwnwnwwnw
+swsewneswswswswwswswwswswswsw
+eneseeeswneswneeseesenwewsenwewnwnw
+neneneeeneweneneeswe
+neeeseeenwnweewswnewneseneenenee
+senewesesenweseseeesewsesesesesesee
+eseeeseseseenwseeneseseeewse
+nwnwseseenwenwnenwwswnwnwnwwnwnwnwnwnw
+senewweseeenwsesesenesewsesesesee
+enenenwswnenewswenwnwneenwwnwswnenene
+eswseseneswsenwswseseseswsesesewsenwsesee
+wnwneswneseneneneneeneneswenenenenewne
+seswneewsenesesewnwwswnesewswesenwne
+eswwesenwwenwnwnweseseeeeeese
+neeneswneeswnenesenwnwneswnenwneneswsene
+swswneseseswswswswwewnwsenwesweneswnwe
+nwenwwwnwnwnenwnenwnwnwnwnwsweneswe
+seseneneeseseeeeswsenwwwesesenwe
+sweswseswwnwsesesewseseseseswseneswnene
+seswseseseseseswwseswsenesesesesesesese
+sesesenwswswseswswsw
+senwseeeeseseeseseseenwewswesee
+wwsenwewwnewwswwwwwswwwwwne
+nwnwnwneswnwnwnwsenwwwnwwnwnwnwenwse
+swwwswswswwwsewnenwswwswwswseww
+enweenesesesenewnwnwwswswswseseese
+swnenenenenenenenwnenesenewnenwnenenwnene
+enenesweeeeseneeneeeneeneeew
+wnweseeswnwwenwnenwnwnwwenwnwsenwwnw
+neswswswseswswswwswnesw
+neswseeneseswsewseseswseseswswwswswse
+seeneswsesenweeeseeseswsewenesee
+wewewwnenesewsenwwnenwnwseswsww
+nwnwsesewnwseeeswnwnwseewseenw
+nwwwwwnwwnwnwwwwnwsenwwwwsew
+eenwneseeeneeneenenwseeeeeee
+nwenwnwnenwswnwneesenwwwnwnwnwsenwnw
+swswswswseswswswswwseswswswswswswswswne
+swwwwwwwwwwnwwewwwnwwww
+esweeeeeeneeenwnwenesw
+eeenweeeseese
+wwwnewwsewewwwwwwwwww
+seseseeseseesesenwesewseeseseseswnesese
+senwnwwneswwswwnenwwwewnwnwwnww
+swnwsesewneenwenwseenwneeseeseewsw
+eneeneneneneneneswsewswsenenenwnenenenw
+wneesweseswswwsewswnweswswewswswse
+neseneneeewneneenewnenenenenenenenene
+wswnesewwsenewswswswswneswswswsweesw
+swswsesenwseswsewseswneseseseswsesw
+seswwswwwseswswswswswweswneswswnewsww
+neneesenewewnenwneneneswnwweswswnese
+swswswwwswswswswswwneswswwwswseww
+neenenenenenenenenenwsewneneneneswnenene
+eneeeeseenenwwesenesweeseeesw
+swswswswswswwswnwswswwswseswswswsw
+eneseseseswsesesewsesesesesenwseseswenese
+nenesweenenenewneneeeneswnweenene
+eneswsenwseenwenwene
+swsewnenwenwwwwseseseswnwwne
+seeseseseseseseswsewsesesenwseseseewse
+swenewswnenwswsweswneswswswse
+wnwwnwwwswwwwnwsenenwnwwwnwwww
+eswswwswswnwswswwwswswsewsweeswww
+nwwnwenwnwnwwnwsewnwwwnwnenwnwnwnwnw
+seswwseeswswseenwneseswnewwswseswsw
+enewwwswesewwnenwseswseweenwnwnew
+swseswseesenwseseseseseseseswseswwsee
+neneneneneneneneneneneenwnewneswe
+wnwswswnewnwnwwwsenewweeswnwnenww
+swenweenweeneswneeeeneneee
+nesweswswseeswswsenwswsewwseneneswse
+nwneswewnwnenwnwnenesenenenwnwnwneswnene
+wenwswnwnwnwnwnenwnwnwenenwnwnwnwnwnwnwne
+seseneesewnwnwneenwseeswswsesewnese
+swnewswnwswnwnwnwwenwnwseewnwnenenww
+seesesewenwneeeenwnesenenwsweseswnwsw
+swnenenwnwnwnenenwnwnwnwswnenenenenwnwse
+ewewnwwswesewsweswnweswswnwnwwnesw
+neseneewwswwwwnwwwewwwwwsww
+enwnwnwwswnesewwnwnwsewswnw
+sewwwwwsweswnwswswnwwwwewsesw
+neneneseweneenenwesewnenenenenenese
+eeeenweeeeswseewnweewneswnew
+wnwnenwnweneneswnenwenenenwnesenwne
+eseseseseswsenwseseswsesesesesesesesese
+eseeseeseeesesenwwseene
+nenwnwnwnewnwnesenwnwsenwnwneneseesw
+ewwnwnewnwwnwnwnwnwnwswswswwwnwenw
+senwwneeneeeneneneenewneswenwnene
+nwnenwnenwewenwnenewseeeenwswswwswe
+wwewwwwnwwnwwwnw
+eeeeeeseseeeeeeeeeew
+wnwneeeseeneeneeneeneweseeenesw
+nwwnwsweswwwseww
+swswwswneswseswswswseswswseswsesweswwsw
+newneneeneseenenenenenenenenenenewwne
+nesewwwwswwnwwwnwwwneewwwsee
+enwseseseseeseseseeeseesese
+seeseseseseseeseseswneseswseseesesesenwse
+nwseeseeesesewswseswwsenwseswneseesw
+wneseenwnenwenwneeneneneneneeseesee
+nwneesenwsweeneneneeseeneesenwww
+nenenwswnwswnwnwnwnwnwnenwnenenwnenwnwnwnw
+nwnwnwenwnwnwnwnwnwnwnwnewnenwnwswnwnw
+wwwwnwwnwwnwewnwnwnwwnwwwswnw
+neewneenewseneneeneneneneneneneene
+neneneneneneneneneneswnenwnenenwnesenwnene
+eeeeeeeseeeeeeeneeweee
+ewwsweswsweseswswswswnwnwewnwnesw
+weswswseseenweneesenenwnwnwneswswse
+nwswswseswwswswswswwwswsww
+seswseswwseseswswswneseswseswswswneseswswsw
+eneeneewnenwneeseeneneeneneneseeee
+eenwnweswenwenenwswswneeeewese
+nenenenesweneswneswnenwne
+enweseeseeneesweswnwsee
+swnesesenenwwswnwsesenweneenenweswwew
+nenwnwnwnwnwnwnwnwnwwnwnesenwswnwenwnw
+nwwnenwnwnwswnwswsenwnwenwnwswnwenwnwe
+swweeenwneswnwnwwswsewwswswseneew
+esewnwseenwseseenweseseseesesesenwse
+enweseeeeseseeneeseeeseweee
+eeseeeeseseseeeewneeeseeeswe
+swswwwnewswwswwswwswwswsw
+eewseeenwsweenweneesewnweew
+wswswsenweswnwsenwnwswswwneseweneww
+nenewswnenesenenenenenwnwnenewneenenene
+nwnwnwnwnwenenwnwnwwnwnwnw
+sweweesweseeeswnweenwseneeenwee
+ewesesenweseenwseseseeseneseeeswe
+eneenenewnenenenenesenenene
+eeeesesweeewseseeeneesewenesew
+wswwwswswswwswswnwsweswswwswnewseswsw
+swswswseswswswswswswswswswseseseswswenw
+neenenwenenweseweneenesenwswneswnwswne
+seswwwwwwwwwwwwwwwwnesenewne
+swswswswswsweswswseswswswswswswseenwnwswsw
+eneeeseeseseeseeseewseseseseee
+swneswswwnewewswswsewwswwswnewse
+wnwnwwwswwnwwewwwwwseewnewsw
+senweeneeseeewenwsew
+nwnwnwnwseswnwnwnwnwenwnwenwnwnwnwwwwsw
+eeseneeeswewenwneeseeeeeee
+wnwenwwnwnwnwnwe
+wswwswswwwwwwsewswwneswswswsww
+nwnwnwnwnenwnwnenenesw
+nenewwnwnwswnwesenwneseneenenwneewne
+nwneneswnwnenenwnwwsenwnenwnenenwnenenw
+swwwwswswnenwsweswenwswseneswwswnese
+eeeeewneweeeeswsewesweenwene
+seswsewnwwnenwwsesenesewnwweeswswnwse
+senweeseseswnewseseswsenesese
+nwsenwnwnwnwnwnwenwnwnwnwwnwwwnwww
+wseseseseseswswswswneswse
+nwneneswnenenenenwnenwne
+esenwseeswseseseseseseswsesenesenwswse
+seswswswswnenwswenewenwneswseswwswswswse
+sweswwwnwswwswwnweswww
+swwswsewswwswwswwswswwnewneww
+swseneswwnwweswswseswseeswwneswswswew
+eseseseesesesenweeseseseweeseswese
+swswnwnwnweswswswswswswswee
+swseneswsesenesweewwseneswseswswnwnw
+sewseeseseseeeseseesesesenese
+seswnesesesesesesewseseseswsesesesesese
+seseseseswseswseseseseswsesewseswsenese
+enwnenwenwnenwnwswsenwnwswne
+enenewnenwneneneneneneneewnenenenene
+nwwsweneswwswwsewswwswwswwenwswsw
+swsewseseneswswswseseswseeswseswsesese
+neneseewneseneneneeneneenwnenewe
+wwnwwwewswewwwwwwwswwswww
+eeswneneneneneneneeneneneswswnenenwnw
+nwnwnenenwnwsenwnwnenenwnenw
+eeseseseesenwseseeesesesewseseseseesw
+wewwwswwwswwwwwwswnwsewwnw
+nwwnwnwwwnwnwewnwnwwnwswswnwwnwe
+nenwnenwnwnenwnwnwswnwnwwnwnesenwnweswnenw
+wwneweenenwswnesesewnewswswwwse
+seswswsesesesewswseseseseseseneseswsese
+swswseswseseswseswseneeswswseswsesewse
+eneneenweeewnwesenenwseswseewwe
+swenenweeeneeeneewseeswenwee
+enesenewwwswseseswsese
+eswneseweneneeneneeenweneneeee
+eseseeseseeweswswenwneeeeneewne
+wnwwneenwwwwsenwwwwnwwwwww
+nwnweseenweewneswesweeeeeneew
+swswswwnewswwswseneswwwswwwswsww
+nenwswnwnwnwenwnwnwnenenwnwnenwnwnwnene
+nwnwwwwnwnwwnwnewnwnwnwnwsenwwww
+wswnwwseswwswwswwnwwewswsewswew
+wneeweneneneseneswnewnenesesenenwnee
+sesesesenwseswseswsesesesenwsewseneesese
+swseswsenwsweseswsewswsweswse
+nesesesweewwsweswseseswnwnwnwswsee
+nenwnenwnwnenenwneswseseenw
+sesenwswsenenwseswnew
+sewseseseseeseseseseseesesesesenwseseswse
+sewwenwnwnwwnenwnewswnwwwwnwwwnww
+nwnenesewnwnwnwnwnwnenwsenwnwnwnwnwnwnwnw
+nenwseneswnweseseswneweswnesenweewne
+sesenwseseseewseseewseneseesesesesw
+wwnwwnwnwwseswwnwenwnwwwnwnwewww
+seseswsenwseswswseswwneseswsese
+sweeswnenenenwneneenweeeneeeeene
+seseseseswneswseswseswsenwseseseswsese
+enenenenenenwnwnwnwnenesenenwnwneswnwnene
+swwsweswwswwwswswswsw
+wwswwnwsewswwnenwwwwwnwenwnww
+eenwnwseseseseeeeeeeeeweeswswe
+nwsenwnwnwnwnwnwnwnwnenwnwnenwwne
+swwswswsweswswswswwesweseswswswswsww
+seseesenwseweseeeseseewseseswsese
+nwseeeesweeeeeseeweeenweeee
+seeswneseseseseseswsesesesesesesesenw
+eswenewsenwwneeeneeneeneenenee
+wswenwnwenwwnenwwswesewseneweewsw
+sweswenwswnwswswnwnwwnweenenwnwe
+nwenweeswswwww
+nwneneneswnwnenenenwnwneneswnwnwnesenenene
+swseeesweeewsesenwweseenweenee
+nenwneswneswneneenesenesewnwnesenewnenene
+sewsesesesesesesenwseseeseneseewwsese
+seswswswswwswwneswwswswswswwswwwnw
+eeesenweeewseweeeswweneswnenw
+eeeeeneeeweseeweeeeeeee
+seswnesesewwseseeenesenewseswwnesw
+eeeeeeseeewseeeeeneseeee
+nwwwnwenwwswwnwenwwsenesenwwnw
+wwwwwwwwwsenwwnwwnwwnwwwsew
+seswswswseswseseswswswseswnwesenwseswsesw
+eneeneeneneeeeweneneneseweneee
+swwwwewswnwswewnwswwswwswwwswsw
+eswneseeneneewneswseeweeeneenwnenw
+swswnwwwseswnwnesewseswwnwswsenwswe
+swswswwsewnwwwewswwneswsewwwnw
+nwnwwnwnwwnwnwsenwnwnwnwnwnwseenwnwnwnw
+seseseewsesesesesesenenewsesesesesesesese
+nesenenenenenwnwwnwnenwnenenewneneneene
+wesesesenweseseseswseseswsenwswsesewse
+eseeswseeeswenweeseseeeneeee
+neswwnwwwwnwwwewwnwswwenwww
+nwswnwnenwnwnwnwnwnwnweswne
+nwwwsenwnwnwwnwsenenwswnenwwnwnewwse
+seenwseeenwweseeeweesweeeese
+swswsweswswswneswswseswswwwswswswswneswne
+ewwwswwwwswwwwnwwwwwswww
+seswsenwseseseswsesesese
+neneeswewnenwswneneseswenwseewenene
+swnwnwenenenwnwnwnwseenwnwsenenwnwwnw
+nwneswneneneneneneseneneswnenenwnenw
+nwnwnwnwnwnwsewnwnwseenwnwnwnenwnwswnww
+seswseseswseseswneswneswswseswswseswswsese
+wnwnwnwnwnwnwnwnenwnwnwnwnwnwsesenwnwnwnw
+seseseeesesewsenenwseweeseesesee
+nwnenwwweseswnwwwnewwswseneseww
+swnwseseseesesesesesewseneseseseseswsesw
+seseseseesewneseseseneseeeseseeswsese
+nwnwwnwnenwewwnwneseswwwwnwww
+esesesesewseseseseseeseesenwsesesese
+eswswnwswswneswswswseweseseswswswswne
+swneenenenenenwnenenenenenwnenwnesenene
+nwwswnwswswnwnenweeenenesenwwsenesw
+eeeeeeeeeenweeeeenwswswee
+nwnenenenwswnenenwnenenenw
+nwwwnwnwenwnwnwsenwwwnwwnwwnwnwnwnw
+ewneweseeseseseseese
+nwnenwnwnwnewsesenwnw
+nenenwnewnwnwnenwsenwswneenese
+wnwwwwwnwwwwnewsewwwnwwswwnenw
+enweseeeeseseeeee
+wesweseneswsewnewwneewenenenwnwse
+eseeswseeseeseseseseeseenweeee
+wnwnweweswsesenweseseseseseswewsese
+eeeneeseeenwseeeneenwseweeee
+esenwseswseswswseswseseseswseseseswswse
+wwseswnewwwswewwwswnewwwew
+eeeneeeeeeenweeseenweeswee
+sesenwneewswweneswnewsenenwenwswnw
+nwnwneseenenewewnenewswneesenenene
+swweswswwswswwnwwwswswwwswnwwesww
+swnenenenwneneenwnwnwnenesweswnwnenenwnw
+nenwnwwewwnwnwnwsewswneenwswswnwnw
+nwwwsewwnwnewnesewwwwnwnwnwnww
+wswwnwsenwswnweswweswswwwwenenw
+neswswswneseswwswwwsewswwswnwnwneesw
+newewwswwswwewwwwwwwwseswne
+neenenweesweneneeneneneneneneneenese
+eseseseeswseweenweseseeesesesesee
+swseswseswswswseswseswswswnwsw
+nenenenenenesewneewsenenenenenenenenene
+eeswneseenweseeeeeeseewsewseee
+nwewswswwswswwswswwswswswswswswnwse
+nwnwnwnwnwnenwnwnwnenwswnwnwnw
+eeeseeeeeeweenweseseseeese
+swswwwswnewsewswwwnwswswsenwswsesw
+seseswsesewsenesenesenw
+seseswswseneswswswneswseswswnwsesesesesese
+nwnwwnwnwnwenwnwnwnwnwnwnwnwnwnwnwnw
+neeneseeneneneneeneenewneneneswnenew
+nwsenwnwnwnwwnwsenwnwnwnwnwenwnwnw
+swswswnwswswswswneswneswswswswewseswnwsw
+seswneswswswswswswswseswswswswswswenwsw
+wwwwnewnewnewswwswwswwwseswww
+swenweswseswseneseswswsesewsese
+ewswseswwsewsweswwswwswsenenenesene
+swwnwnwnwseneseenenenwneswwwwwseswse
+nesweneneeseneneneneneenenenenenwnwnenee
+enwnwwwnwnwnwnwnwnwnwnenwsenwnwwwnwnw
+wwwwwswwwwwnwwwewwnew
+nenenesenenwnwswenwnwnenenwneneneneeswne
+eeneeneneesweeneneneneeeeewene
+eeseseenwnwsesesenwesenwesesesewese
+neeeeswswneeeeeeenweeene
+seseesewnesewseseeseseswseneseswnwsene
+sesesewseeeneeseeseseseseeseeese
+wswwnwwnewsewnwnwnwesewwnwnesene
+eseeneenenewnenenwseesenwnwnesewnene
+eseeneeswnwneesesewwneswewwneesw
+neneswseneenwnenenenewneneneneneneseneene
+sesesweseswsesesewseswsesewsesweswse
+sewsesesesesewseseseneseeseneesesese
+swwwenwwnwswnwnwneswwwnenwsewnwww
+swwswswseseswswnwseswswswswsweseswsesw
+senwenwnewweneneswswnwswwsenwenwenwnw
+nenwnenenenenenenenenwneneneneneneenwwsw
+wwnwwsewsewswnewsenwneesw
+nenwnwseswnwnwenwesewnwneeswswnwnwswnw
+nenwswnenenenenweneseneewseeneewswene
+esenwwsenenenewnwnwswnwnwnwwwwnwnwnww
+sesenweeeseseeeseseeseeeseswese
+neneneneneenenenewsenenenenenenenenene
+eeeseeeesweneneneeeeeenenwe
+eswwwwnwneewwswwnwwneswwseswswwsw
+wseseeeesesesesenweeneseseseseeee
+esesesenweeeeeweeeswenwne
+wwwwswneenwsww
+seseswseneswswswseswseswswsewswswswseese
+weseswseeeneseseewnweseesesesee
+swswswswswswswswneswswsw
+swwswswswswswswswwswswenwwswww
+nweneneneeeneneeneeseneneneneene
+swwswwwneneswswwswwswwseswnewswsw
+eeeewenwweeeesweeeee
+wnwseeewswswwwswsewwswnewnenew
+ewseneeswswneswenweswnwwwwneswwe
+eswseswnenwswseswwseseesesesenesesesw
+senweeseseesesesesesw
+nwsesesewsewnweweseseeseswsesesw
+sewwwseseswswneenewenenwsenwseww
+nwnenwnwneswswsenweswneneneenenenenene
+eswnweeeeneeseneeeswenweneenw
+wsenwnwwnwnwnwnwnwnwnwnwwnw
+nwnwenesewenwnwnwwwnwwnwnwwnwew
+nwsenwnenwnesenwnwnwnww
+wnewneswnwwsesenwwweweseneneww
+swseseseneeseswsewse
+nenwsenwnwsenenwwnwwnwnenwnesenwnwnwnw
+neswswswswnweewnenwswswswswswswseswswne
+nwseseseseseeeseseseeeeseeeswsese
+wnwnwnwwwenwsewnwnwwnwnwwnwnwnenw
+wwwwwnwwewnwww
+nwswswswswswswswswswswswswswneswseswneswsw
+nenesweneneeneneneneneeneneenenee
+swswswswswswwseswwswwswsweswswswnwwsw
+nwwewswwnwwwwnewwnw
+eeewenweeeseneeeseeeeeeeswe
+swswenweswseseswneswswswsewsesesenenww
+eeseeeeeeneswseseseeeweeeee
+eeeseseeeeeeeeseenwenenweswesw
+neswseswswseseseswsesw
+sesenwwseneesewseneseseewneswswneswne
+senenwswswwwsewwsenenwwenwewnew
+neeseeweeeneeenenweeseeeee
+nwswwswswswseswwswswswnewswswwswsesw
+swneeneneeneswnwsesesesewnwesewsesesw
+swswenwneneewneswwswswesesewsesw
+nwnwsenenwnenwsenwnwnenwneneeswwnenewnwnw
+swsenenewswswsewwnewwwnwsewswwsw
+swenenenwseseneweenene
+wswwswneswsewswswswswswswsw
+wsenwsenwwwsewwnwswwnenwwnwnwnwew
+nesweweeswwseseseseeeeneenwew
+wseseneswnwswseseswseswswsenwwswswswesw
+wwnwnwnewswenweswenwnwenwnwswnww
+seswneswswseswwseswswseneswswnweswswswsesw
+swwwnewswwswswwwwwsww
+enwswswneeneneeneneneeneee
+swswwswswswswswswswneswswswswswsw
+sweseneswwseeeneeenwnenweswnenwne
+eseeeeweneeseesewseswnewe
+enwesweseenwseseeeesweeeenese
+eswsweesenwenweeeeseeeeeenwee
+eeeesenweseeeeeesweeseeee
+wwseenenwnwwnwnwwwwnwswsenwwnwenw
+sesenwseseseeseseswseswseswseswnwsenwsese
+eeeeneeneswnenwee
+seswneseswseswnwswswesesewseswswswswsenwse
+nwnwwnwwenwnwnwnw
+eenenenwneneeswneeneneseneneenenene
+seeseseseswseseesesene
+seseseswseseswnwswswwseswsweseswsesesenw
+nenenenenenesenenwnenenenenenesenenenewnenw
+nwenwnenenwnwenwswnwnwnwnwnwnwneneswsw
+nwneswswnenenwnwnenwnenwnenwnwswnenwnwnw
+eneneneeeeneeeweneeneenene
+enenenenwnenenesenenenenewneenenenene
+seseseseseswsesesesesesesesesesewnenesese
+nwnwenwwnwenwwwenwnwnwnwwwnwwsw
+eeseeesweeeseeeseeeeewnwenee
+sweneneeneeeeneeewneneeneneenw
+nenewnwneseseneneenwwswneneenenwwse
+nwswwwwneswsewwswwneweweswnwsew
+swswnwswswsweswsesw
+nwwnwnwnenwnwnwswnwnwwnwnwnwnwwnwwew
+swwwwwswswwwwneswwswsewwwwsw
+seswsenenenewewnenenwnenewenenenenesee
+wwnwwewnwnwenwwnwnwwnwswwwsww
+wswswswswswswneswswseswswswswswswwswsw
+sweseeeeeeeeenwneneeeenweee
+eneneneeneneneswnenenenewenenenenwnesw
+swseeesewsenwswsesesw
+eeneneenenwneeneweswsweneneeene
+swseseseseseseseseseeeenwswseesesesenese
+eneweeneeneneseenenenewseeeneenew
+eeswswseenenwnewe
+ewenwwsesesesenwnwwesenenwnesesew
+wwwwnwwwwnwenwwwnwwwwsenww
+swnwsesewnenwsesesesene
+sewnenenenwneenewsenwnenewneeesesw
+swswswswswswswswseswnwswsww
+seswswsenwwswseswnesweseseswswseseesenwse
+eswswwswswnwseswswswswswsweswswswswsw
+nwnweswwnesenwnwnwnweswnwnwnw
+eswnewwswesewwwnwewwesenwnwwsww
+eswnwneneneeeeswnesewnesweeeee
+ewswwnwnwnwwwnwnw
+eeneneeeneneneeenweneesweswnese
+seswseseseswseneseseswweseseswswswseswsw
+nwnwnwnwnenwwwenwenwnwnwesenwwnwnw
+sewwnwwenwswnwnww
+wseneseswseseswswenwseseswswswswswwse
+seseeneseweneneswnwseenwswnenenenwnene
+nenewswnwseseneeneneneseneneneewnenw
+eneeeneeneeeeneeneweese
+wwewwswwwwwwswswwww
+seswseseseseseswseseneseswnesesesesese
+neneswseswnwwseswswswwswswsweswnwwswe
+newwswswswswwswswneeswnewswsewese
+eseeeseeseeeeeseewe
+enenewnenesesenewnwswsenesenenwneneneesw
+neeseeeeesesweseseseeseseenweese
+nweswswswswswseeneswwsewswswswswswe
+wwwwwwsenwwwnwwenewwwnwwsww
+swsesewnwswswswneweswswseeswswneswsew
+swseswswswswswswswnesweeswswswsenwswswnw
+eeeneseeneweneeeweeeneeneenee
+nwnwnwnwnwenwnwnwnwswnwenwnwnwnewnwswswnw
+nwwnenwwenwnwwwsenwnwnwswnwwneww
+senewswswnenenenwneeneneneneneeenenenene
+eeseseeseesesenweseeseeseewse
+neswnesenenwswnenwswnenwswnwneswswnewseee
+senwnwnenenwnwnwnenenwnwnenwnwnenene
+wwnwwwwwwwwsenewnwww
+nwnwnwnwwnwnenwnenwnwneneenwswenwnwse
+wwwwnwsewswswwswenwswwswswwwww
+nwwwwnwwswenwwwnwenwnwnwnwswnww
+nenwesenwewneneseeseenwenewnenee