Browse Source

add day 24

Juan José Gutiérrez de Quevedo Pérez 4 months ago
parent
commit
230545f703
4 changed files with 565 additions and 0 deletions
  1. 39 0
      24/1.py
  2. 56 0
      24/2.py
  3. 20 0
      24/einput
  4. 450 0
      24/input

+ 39 - 0
24/1.py

@@ -0,0 +1,39 @@
+with open("input") as f:
+    content = [x.strip() for x in f]
+
+white = 0
+black = 1
+floor = [white] * 50
+for i in range(len(floor)):
+    floor[i] = [white] * 50
+
+prev = None
+for m in content:
+    x = 25
+    y = 25
+    for c in m:
+        if c == "s":
+            y += 1
+        elif c == "n":
+            y -= 1
+        elif c == "e":
+            if prev not in ["s"]:
+                x += 1
+        elif c == "w":
+            if prev not in ["n"]:
+                x -= 1
+        if c in ["e", "w"]:
+            if prev in ["n", "s"]:
+                print(f"{prev}{c}", x,y)
+            else:
+                print(c, x,y)
+        prev = c
+
+    print(f"switching {x},{y} from {floor[y][x]}")
+    floor[y][x] = white if floor[y][x] == black else black
+
+result = 0
+for x in floor:
+    result += x.count(black)
+
+print(result)

+ 56 - 0
24/2.py

@@ -0,0 +1,56 @@
+with open("einput") as f:
+    content = [x.strip() for x in f]
+
+white = 0
+black = 1
+floor = [white] * 140
+for i in range(len(floor)):
+    floor[i] = [white] * 140
+
+prev = None
+for m in content:
+    x = int(len(floor) / 2)
+    y = int(len(floor[0]) / 2)
+    for c in m:
+        if c == "s":
+            y += 1
+        elif c == "n":
+            y -= 1
+        elif c == "e":
+            if prev not in ["s"]:
+                x += 1
+        elif c == "w":
+            if prev not in ["n"]:
+                x -= 1
+        prev = c
+
+    floor[y][x] = white if floor[y][x] == black else black
+
+def count_adjacent(grid, x, y):
+    return [
+        grid[y][x-1],  # west
+        grid[y][x+1],  # east
+        grid[y-1][x],  # north-west
+        grid[y-1][x+1], # north-east
+        grid[y+1][x], # south-east
+        grid[y+1][x-1] # south-west
+        ].count(black)
+
+for day in range(100):
+    new_floor = [white] * len(floor)
+    for i in range(len(new_floor)):
+        new_floor[i] = floor[i].copy()
+    for y in range(1, len(floor) - 1):
+        for x in range(1, len(floor[y]) - 1):
+            adj = count_adjacent(floor, x, y)
+            if floor[y][x] == black and (adj == 0 or adj > 2):
+                new_floor[y][x] = white
+            elif floor[y][x] == white and adj == 2:
+                new_floor[y][x] = black
+    floor = new_floor.copy()
+
+result = 0
+for x in floor:
+    result += x.count(black)
+
+print(result)

+ 20 - 0
24/einput

@@ -0,0 +1,20 @@
+sesenwnenenewseeswwswswwnenewsewsw
+neeenesenwnwwswnenewnwwsewnenwseswesw
+seswneswswsenwwnwse
+nwnwneseeswswnenewneswwnewseswneseene
+swweswneswnenwsewnwneneseenw
+eesenwseswswnenwswnwnwsewwnwsene
+sewnenenenesenwsewnenwwwse
+wenwwweseeeweswwwnwwe
+wsweesenenewnwwnwsenewsenwwsesesenwne
+neeswseenwwswnwswswnw
+nenwswwsewswnenenewsenwsenwnesesenew
+enewnwewneswsewnwswenweswnenwsenwsw
+sweneswneswneneenwnewenewwneswswnese
+swwesenesewenwneswnwwneseswwne
+enesenwswwswneneswsenwnewswseenwsese
+wnwnesenesenenwwnenwsewesewsesesew
+nenewswnwewswnenesenwnesewesw
+eneswnwswnwsenenwnwnwwseeswneewsenese
+neswnwewnwnwseenwseesewsenwsweewe
+wseweeenwnesenwwwswnew

+ 450 - 0
24/input

@@ -0,0 +1,450 @@
+swsenwsewneeseseswnwswsesesewswnewsese
+seewwewsenenwwswnwwenewwwwwwnw
+swswswseseswswswseswswswswseswswne
+ewesewseseweswnwneesewesenweneee
+seewneneswenenenenwneswnwnweeswswenene
+neneneneewwsenenenenenwnenenenwnwnesenw
+eseeeeseeeeeesewee
+eeneeneeneneeweneeeeene
+swseswsewseswseswswenwswseseseswswswwnene
+nwnwseswswsweswnwseswsesesw
+eswnenweeseseswenwswneenweseseee
+eswseseeswseeneeswseneseneseeeesee
+nwswseneseseseeswnwseseseseseswswsesese
+eesweeneeeenwnwnewesweeseeee
+wwswwwwwsewwwwwwwnesw
+swswswswnweswswswswsweswswswwswswsesw
+eeneenwseewswsweewseewenwewe
+seseseneseseswsewseseseseseseswsesesenw
+nwenwswnwnwnwnenwnwnenenwne
+enesenwnewneenewneneeseneneenwswne
+nwnwswsenwnwnwsenenwnwswnwnwnenwnwnwnwnwne
+nwnwswswwwnenwenwnwwsenwwnwnwnwesenw
+ewwswnenenesenenwnenwnesesenwseneewwne
+nwwnenenwnwnwnwnwnwnwsenwnewsewnwsww
+swswwwsenwnwswwsweswsweswneswesesw
+nenenenenenewenenenenwneneseneswnenwne
+esweeseeeenwnwseeseeeeseeee
+ewsesenesewswswsewneswswneswswseewsw
+nenweeeswneeeneenwenwseenwneswswne
+swnwnwnwnwnwneneseneneneswnwnese
+senweenwnwseswswswnwnwewnwnwnwneswswne
+nwnwswnwwewwewnwnwnwnwsenwnwnwwnwnw
+nwsenwsenesenewsewwwnwsenenewseww
+eeesenewweneeneweeseswswsesesese
+wneeeenewnenweeseeneneneseseneee
+nwswwswswswswswswswswwwsweseswnwsww
+senwenwnwnwnwnwnwnesewnwnwnwnwwsene
+swwnewwwenesewwswswsewwwwwswnww
+swwwewnewwnwnewnwwswwnwnwwww
+neeneneneneneseswnwneneenenenenenwne
+seseswsewseswnwsesenesesesesweseeseswsw
+nwsenwenwwnwnwnwnwnwnwnwswwswwwenwnenw
+enwnwsenwwwnwwwswewnwwnwnwwnwswese
+wwnwnwnwwwsewsewnwsewnwnww
+wswswwswseswwswwswswwwswwwne
+ewwswwswswwwsesweswwwwwnewwew
+neeseseswswenwwnwsenenenwwneneswwsw
+nenwsenwnwnwsesenenwswneneenweseseesew
+senenenenenenwnenwswneneneneenenwnesene
+wswwnwswswswseswesewswswswnwsw
+wwwewwnwwswswwwnewswswswnewnwse
+seseswseswsenwneseseenwseswsesesesesese
+swseswnwwnwneswseswswnwswseswswseenesw
+nenwswwnwsesewseswseseswseseneeswseswne
+swswseswseseswwnwswseswnwsesenesweswe
+swsenenwneswnwwsewewwnesew
+swsewswsewsewswswswswswswwswnenwwwnw
+swsenwwneswnwnwneswseeswswsenwswenee
+wnenenenenenesenenw
+swseenwseseswsenwneenwwswswsesenweswse
+seseseseseseseswsesesenesesese
+nwswnwnenwsenwsenwnwnwnwnwnwnenwnwnwnwenw
+seneneneseswnwnwneswnwneneseswnwnwnwnwwnw
+nwnweenwnwswnwnwnewenwwswwneseesenw
+nenwnesenweneneneneswwnenenwnwseneneene
+nenwnwnwnwnwnwnwsenwnwnwnwnwnwswsenwnwnw
+nenesenenewnenenenenewnenesenenenenenw
+nenesweenenwnenewnwnesenewneneneeene
+wwswswwsewwwswnwnewenwswwswswwswse
+nenwswnenwneenenewswnewnenenenwnwsesew
+nwwsenwsenwnenwsenwsewewneswnwnewnwne
+nwnenwnwneweswnwnenwewnenenenwneswene
+wwwnwnewwwsewnwewwwnwnwwnwnw
+wswnenenwnwswneneswnweenwnwwnwnwnwnw
+nwweeswneneeneeenwneseeeeswswswe
+seeswseseswnewsewwnwseewneesesesesese
+wnwnwnwnewnwwsweeswwnwwnwswnwnwew
+wswnweenwwswsewnwnenwnwwswwwww
+eneswnewswesesenwneneenenenwwenwne
+swwswwwwnewsewwwwswewswwww
+swsesenwnwsenewseseseseseseseseseewsese
+wnweweenenewnesweseeseeee
+nenwwnwnwnwnwnwsenwswewswne
+nwsesewnwseseswneenewswneesese
+eneeeeweneeeeeesweeewewse
+wseeeseeseeesee
+nwnwnwsenwnwnwnwnenwnwwnwnwswwewww
+nwsenwnenwsenwewswnenwnwnwnwnwnwnwnene
+nwneneseswswswwswwneswseewswswswswsw
+swneneswswswswswswswswswewswwswswswsww
+wneseeseeeeeweeseneeseseesew
+swswswseseseswsesesesesenesw
+neswewseseneswswswswseswswswswwseswswse
+nenenwsweswneeeswnenenenenewnenenee
+swswswswswesewswnwnenwesenewswswswnesw
+eswswnenewewwswwswneeswswseswwsw
+swnwwnwswsesesenewwneeseswseenenwne
+weweswwsenwswenwnwnwenwwnwnwwnww
+eseseseseseeseewsesesenwseseneeswsese
+senwseseesewneesesesesenwsenwseswsesesese
+eneeeneeeeeswsweeeeeeeewse
+seesesenwsesweewswseseneneneswnesewe
+wswnwwseswwnweswwnwnweneeswnwswnenenw
+nesewswwwnesewnewwwsene
+swseswsweseseswneswswsewseswswsww
+eseseeeseswswnwweeneeeesesesene
+seswneeeneewneswesesenwnwwnenewnwsw
+newsenwewnwneeswseswsesesesesewsenwse
+wwwwwwwnewswwwwwnwnwswwew
+swnenwnwnwnwswswnwenenwnenwenenenwnenw
+wwwwewswwweewwsewwwnewnwnw
+nwewwnwnwswwswnwewwwwnwnwwwneswe
+newneswneneneswnwneneesesewneneesww
+nwnwnwneseswnenwnwnwswneeneswnenwnwnwneesw
+nwwswsenwneweenwwenenwwwsenw
+nenwneswswweneswseseeseneneeeneneew
+eseseeseeeeseenenweeseswenweenw
+neswneseesweeswesenwswenweeseeeenw
+wenwseeseneneeeneneneeeweswsene
+neenenenwneneneneneneseneneswnenenene
+nwnwswnewewseswsw
+neswneeswwswseswswsenwswseswsenewesesw
+seseswseeeeeewenweeeeseesee
+wwnwswnwnwenwwswnwnwenwnwnwwnwwnw
+wswneseenwnwesenwwnwnesenwnwneenenwwnw
+newwswswsweswsenwneneswswwswwswswsw
+eswnwsweswswnwswswnwwwswswswesewswswne
+sewswswswswswneswnwesesewneswswswswsese
+newswneswwnwwswwwswwwswwewsewsw
+nwswswneseneswswswwswswwswwswneeswsw
+nwnwsenenenwwswnweesenwwwnenesesenw
+nwneswnwswnwwnenenwnenwnwnenenwenwnenw
+wsenwwnwsenwnwenenwwsewsesesewneww
+eeneeesewseeee
+nwnwnwseswnwnewwwneeseseswswswneeee
+neswswswswswswswswswsesw
+nwwswwneswsewwswwneewsweswswwww
+nwnwsewnwsenwnwwnwnwnwsesenwwwnewnenw
+wsenwseseneenwnenwwenwnwwsenwswneswsw
+wwwswswswswswneswneswswswseswwseswwnesw
+swsesesweseenwwsesesweswswwsenwswswsw
+seeneeesweesese
+swnwseswsenwnwenenwseneswsesesesesesesese
+nwwwnwsewwnenwwenwnw
+wseseesenwseswsesee
+nwnewwnwwwnwwwwswwwnenwesesww
+swswnwswsewwsewnwwseneswswnwswsewsw
+nwnwnwneneswneseswenwnenenenwnwneswnewese
+senenwwnenwwsenwnwnwwnwnwnwnwnwnwnw
+newnwnwnwneswnwwnenesenwnwnwneenenwne
+enwnwnenwnenenewnenwnenese
+nwneewwesesewwwnewsewwwww
+sesenwseseseseseesweswenwseseeseese
+seseseswnweswseseseseseneswswseswseswnwse
+swwsenwseeenesewwwenwsweesesee
+wsewneneeenenenwneneneweeswnenesesee
+enwweewseeneswenwewwenwswesee
+seswneseneswwswseeswswswswneseswswsw
+nenwnenenwsenwnwnwnenwnenenwnwseswnenwnw
+newswwwwwewewswewseewswswswnww
+seeseseeseweenwse
+eswseseenweneswnwseesw
+nwnwnwneenenwsenenenenenwwnwnwneneswnenw
+eeenwneeesweeeneeeeneneswene
+seswswsenesenewseswneswwswswswseswswnw
+eeeswneeneenesenweesenenewneneee
+neseeeswwneweneenwewsweweee
+nwnwneneswnwneenwwnwnwnwnenwne
+seswwsewwwnenenwsenesewwswnewwswnw
+nenenenenewnenesenenw
+nwsenwnenwsenwnenenwnwnwnwnwnwnwnwnenw
+seeesenwswwswwweseene
+nenwnwnenenenwnwneneswneneneneneenenwsw
+swwseswnwnewsesewwswwswwswswnwswnw
+nenwswneneswneneeeseeeneneenenwenee
+nwnenenwseswewswsenenenwnenwnwenwnenww
+swswseseswwnenenweseseswnewswswwsw
+wswswswswwneswswswsweswswswswswsesww
+nwnwwnenenwswnwnwswnwwnenwesewsewnw
+seneswwenwnwswnesewswwwneenwswsee
+nenweneenenenenewnenenesewseneneenenene
+neeswneneeneeneeswneenwenesweene
+eswnenweenwswesweseeeeewewneee
+nwswseswnenwnwnewwnwnwwnwnenwnwnwnwnwnw
+newnenenenenenenenwnenesenenenee
+wseswswswswseswswnwsenesesw
+nwsenenewwnenenenesenenenenenenwnw
+swseswswneswswnwswswseswseswsewswse
+esenenenwnwnwnwnenenewnenwnwnenenewsene
+wnwsenwenwnewnwwnwnwwwnwsewnewwnw
+nwnwnwsenwnwwnwnwnwenwnwewswnwnwnwswnenw
+wwwnwnewwwsewwnewwwsewwww
+nwneneneneswnewnenenenenenenenesene
+nwwwswswnwwseewenewewwwwsesw
+nenweeenewweneeneneeswnwesenee
+sweneswnwsewweneneeenweseneweeene
+neseeswswnwneeeeenwwneenwneesesw
+swswswswseswswswneswswweswswwwweswsw
+newenesewneneeneseeneswnweneenene
+sewneeneneswwwnwneswseseseeseseswse
+swseswneswswseseeswwnwnwswenwswnw
+nwnesesweenweseeenweeweeseene
+swswwneswseswswswseswswswseneswwseswse
+seseneseseeswesweenesesewsenwesesesee
+neeeseneswnenenenweenenenenenew
+swnwnenwnwsenwsenwnwnwsenenenwnwsenesenwse
+swwneseswswnwseswswseseseseesesesesene
+swneswnenenwnenenenenenwneneneewnenwene
+wwswwwnwnwwwwneewwwwnwwwsw
+sesesenesesewseneseewseseseseswseseswse
+swsweswswwneswswswswseswswsw
+nwweswswseneswsenwenwwwnwswswwnewe
+seswswswswnwseswswswswswswswenwswseswsw
+seswswseseseseesesenewsenwsesewnesesw
+neeneneeneneneenesenenenenenenw
+nwnwnwnwsenwnenwnwnwnwnwnwnwnwnwnw
+wseseesenesesesesesesesw
+nwsewnwswwsewnwenwnwsenesenwnwnwnwnese
+nwwneswenenenenenenwnenenenwnwnenesene
+wwwwwseewwwwsewswwswwwswnenw
+swewswswswswwnenwnwswweewswswwsw
+senewenwneswseswnwswnewnewnwee
+nwnwwwwwwenesenwwwnenwenwwwswswne
+nenwnenenesesewnwsene
+neswwswewsweswwwswnwnwwnwwewsw
+wswswswswswwnewswwwwwswww
+seseseseswesenwseewnwswseseseseswsewse
+swswwsewseeenwsweswneswnwwenenww
+wwnwwsenwwnwwwwneewnwswnwnenwwnw
+eseswseneseswswwsewseseeseeswswsesew
+swwswswnwseswnwneneeseswsenwneswswsesw
+sesesweswneswswnwwwswswswswswseswswsw
+seseeeeseewseseeeseseseenenenwswsese
+seneswseseswsenwswnwswswswswswswseswwswsw
+wnwwwwnwwwwnwnwnenwnesewnwsewsew
+wwwwwswnwnwswweenwwwnwwwww
+swesewwswwwnenewwswsewewwwww
+nesenewneneswnenewewneneneene
+seswwswseswseseswswneseseseswsesesenese
+neswswswswswswseswswneswswswsenwsweswswsww
+sesewnewneseseseswswswnwseswsweneswnwne
+nwwnwwwwnwwewnwwwswnwneenw
+wnwwwwwewwswwwswewwwwew
+swswneswswswwswseswseswseswswswseswnwse
+wswsesenwsenwseswseswswseswswswswswesese
+swnenesenenewseswnwswenwnwwnenenenwne
+senenwswneeswneeswwseswwnwwswswswsw
+esesenwseeseseseneweseseeseewnewsew
+wnwwenwwwnwnwnwnwswnwenwnweewnwe
+swewwewwwnwseswswneneswnwnewwnwnw
+sweeeneeneswnenwenene
+nwneseseeenwnwnwweseswewnewneseeswe
+eseeeseeeeeseseeeweweneneese
+swwwswwneswswswswswswswswwenewwwnwse
+nenwnwsenwnwwnesenwnwwnwnesenwnenwswnenw
+neenwnwwenenwnwnewswsenwneene
+swseseseeswswswsesesewswsw
+wewwnwnwewnwwwwwwwnwwwew
+weenwsweseewseseseneseewneeeee
+sesesenwseseseseswsenwneesesesesenwsese
+seeneseseweeeewseneswseeseeee
+newewswswwwswwswswwwswswwseswsw
+nweswnenewenenwswsweeeswneewnwesee
+swwswswewwswwwwnwwswswsw
+nwwnwnwnwnweeswwnwnwnweneseswwww
+wwnwnwswnwsewnwwswnwnesewnwnwnwnwwne
+nwnwnewnenwsewenwwneswnwnenenwneesene
+sewnwwswwnesewwsewnewnewsenenwse
+swnenwnwnwnenwnweneswnwnwnwnesenwnwnenw
+nweeseenwsesewswneenw
+sweeeswseeseseeesenwseseseenwese
+eneeweeeeeeweseeneseeeeeew
+wwswwwwwwwswswwwswweswwe
+wnwsewseseseewswnenwweneeenwsesew
+swwseswswswswnwwwweswswwwnewwsww
+swewwwswwneswswswswswnewwswwswwswse
+swswsweswnwswwwswewwswswswswswswsw
+nwsweseseseseseseeseseeseseneswsesenw
+seswswswswnesenwswswseseseswnwnwewseswsw
+wwwwwnwnwewneswwwsenwwwnewwsw
+nwneseneswwseswswseseseswseneseswswnesesesw
+eeneenwswneenewseeneneenenewswe
+seeenweseeneneneeenenwswwnwswee
+eneeesesweeenewnwneneenenenwene
+swseseseseswewnewsesenwswneseswwseenesw
+wsewwneswswnwwwwwww
+swswswswnwswswsewswwneswweeswswswwswsw
+sesesesesesenenwsesenesewseseseseeseswse
+neneenweeneeeneneenweneneswsweee
+nwswnwnwnwnwnwenwnenwnwswnwwnw
+weeneweswwsenese
+neesenwneseeeeseseeswswnwwesese
+seseseseseeeweeesesewesesese
+sesenwnwsesesenwswsesesesesesese
+neneswnenenewnenenwneneneseneneneneneene
+wneenenwnenwnenenwneneeswnenw
+ewseswwnwsenewenwwnwnesenwsene
+seseseseseswswseseseeseswsesesenwswnenewse
+eneswswewneeeenweeeeeeenenw
+eseeseseeweneseesewseewseesenww
+wswswneswswswswnweenwswsenwwenwwwse
+nwwewewnenwnwenwswnweesenwwswww
+nenenwnwsenenwnwnwnewnwnwnwswnwnwnesenw
+wswseneeswwwnenenenwwsesenenwneesene
+esenwsesesenweeseeseee
+wnwnenenwnwnwnwnwsenwnwnenwnenwnenesene
+eswswnenwneeeeeeeeeeeene
+neneneneswneneneneneneneneseneeenwwne
+enenwnwswswnwewwnwswewnwewswesenw
+newsewwwwwwwwwwnwnwsewenwwnw
+enwwnwwwswswsesenesesesesenwswseene
+wnenwnwnewnewwwnwnwsewwwnwswnwnwsenw
+wnwseseswswseseseswseneswswswsenwswswsw
+eeweeeeeneeeseeesweeenee
+wswwwwewnwwwwswweswsw
+nesenwswsesweswsesesenwsesesew
+neneneeseneseweswnenenwswswnweeee
+eeeeneeeeenweeweeneeswese
+seswswseseseseswswswswnew
+wwnwwwswnwsenewneswswswewewww
+neneeeeeneeswswsweneeeneenwnew
+wnewwswwswenwnenwneewwsew
+neewenwewseeesenwesweeneswswnwse
+swnwnewnwnwnwnwsenwenwnwwwnwnwnwenwnwnw
+enenwwneseenewneeeswnewnwwneswee
+swneewneswneeswnenwseneneneenesew
+neenesenesewneneewwneneneneneewse
+eneewnwenenenwswsewsweeseneswswee
+wwnwwwewnwwwwnenwnwsewnwnwsewnw
+wwwnwseswnwwenwnwnwnwnwnwnwwnwwnw
+nwneseswseswswewwseseneneseseneseswnwsw
+swnwswnwwneenwweswnwnwwnwnwnwwenwnww
+neswsenewweswwswswsweswsw
+swneseeseenesenwswseeeseseesewee
+wseswwwwwnewnwwnwwwnwwwne
+eeneneeeneeeweeeene
+nwneeeeneswenwswsweenwseseneswew
+eswweeeeneeeeeneee
+nwseeseswneseesesesesesesesenwesenesesew
+senenwswsenesenwswswewsenee
+nwnwnwnwwnwwwenewnwnwnwsenwewwsese
+sesesewswneseswnenesesesese
+swswswwswswsweswswsweswswwwsweswnw
+seswweseneeeeseswsewwnwsweswsewnw
+wwwnenwwwsewwsewwnwwewwwww
+eenweeseewwseeseseeswnenewesesee
+eneswsenenenenewneenewneneneneneenene
+seswseseswwnesesenwseseesenwnesesenenew
+neswswswswseswwswswswswnwenwswswneswe
+sewseseswseswseseneenewswswwseseswnwse
+ewwwwnwwswswsewswsewsenwwneswnee
+wneweeneswwseenwswsenwsweenwneneee
+seseseneseneswswnwsewswnw
+wnesweeesweeeswenwenenenweese
+seeeweeneesenewneneeneeneneseenenw
+neswswnwnenwnwwswsenwnwseseenesenenwnesw
+neseswnwwseseneeswwneswswswwsweeswnw
+nwsenenwnesenwnwnwnwnwwneswnwnw
+wwewwwwwew
+wswwwwwwneswewnwswwwwswwnwesw
+seseseseseesesesenwsesesesw
+nwnenenwnwnenenwnwsenenwnwnwswnenenw
+seseseneneneeswnwnwsenwnwnwswswneswew
+wnwnenwnenwseeneswnwnwswnwwsenenw
+seswswswswseswswwswswswe
+nwneeseswsenwesesewsenwswwneseseesw
+seeeeeeenweeeeeesweenwsew
+swnwwseewnwwnwsenwnwnwnwnwwwnwwwwnw
+nwseneeswnwnenwswnwnene
+eneseneeswewwsewnwswnwswneesenese
+wwwwwswwneswwsesw
+seesesesewswnweswsewseseneswneswwsw
+wswwneswswnewswwseenwwswswwswswnwsw
+swswwswnwwswswseeeswwneswswsw
+nwnewewwsesewwwwwwwwswnwww
+nenwewswwwwwwsenwwnwse
+sesewsewseeesesene
+eenenwsweenweeeenwseseenwseseesw
+nwwnwwswswnwewsenwnwnwneeneswwwnwnw
+swnewwswswwnewswwswswseswswsenewww
+nwsenwsenwswsenweneenwsesenweewnwswswe
+seseenwseesewneeeseseseewseese
+eewenwnwswsewsene
+wnwnwsenwnwenenwnwswwwnwnwnwsewnwnwnwnw
+nwnwnwnwnwnwsenwnenwnenwnwnwnwnwwnwse
+nwswseswswswswseswsesweneseneswwsenwsw
+wsewnewnewseewwwwswswswwnwswsw
+wneseswnwwnwseseswneseswwnwwenewswsw
+swnewswwwewwswnwenwsewwwswswnww
+seseseseseseseseswsesesenw
+seseneswseswseswswwsesenesesesenwswsww
+ewnwnwsenenwnwwsewwseswnwwsenenwnw
+neenenenwnwnenwwnenenweneswnwnwnw
+wnwnwnwnwnewwwsewwsenwnwwnwnwnww
+nwneeswweeeeseenweeenweswswswse
+wwwswnwwwwnesewwewnewwwsew
+wwnwnwnwswwwwwwne
+nwnwnwnwnwnwnwnwewnw
+swwwswswswswswsweswnwswsweneweswswswsw
+nwnenwseneswsenwneenwnenenwnenwnwswnenwnw
+esewnwsesenwseeseeseseeseese
+senenwneeneneeneeenwnenenenweswneneswe
+sesweenweeeenesewwseesesesenese
+seseswswsesesesesenwseneswseseesesesese
+sweeseeeneeneenenwnwenesweenw
+nwnwnwwnenwnwnwnwnwesenwswsesenenwww
+wwwwwswnwwnewsew
+nenwnenenenenewsenwwene
+nesesenwnewseswswsewseseenenwsweswwswnw
+wnwsenwwwsenesewswnenwwwseneenwsww
+neswnwnwsenwnwwsesweewnesenwseseenew
+nwnewsewwwwnwnwww
+nwsenwwnwnwnwnwnwnwnenwsenwnwnwnwnwwnw
+eneeneeneeneneneswswnwneenenwnenwneswne
+wswnenenweswnwnenenwesweenenwnw
+wswnwswneswwseseswswwswwwswswnwsesene
+sewseneeseenwnweeesw
+seswnewenesewnewswwswneswswseswwne
+nenwnwnwwswnenenwnwnenenwnwnesenwnwenwnwsw
+wwswswwneswnewwwsewewwswwwswe
+newsweneseneenewnenewenewesenewe
+nenwneneswneneneswswneenenenenenenenenene
+seswnesesesesenwsesesewsesesesenwnwseswse
+sewseesesesesesenesesesenwswnwneseew
+eeeeeeeseswnwenenwsewsweeee
+wnwswsewewwwnwwswwwnwwwenwnew
+nwsweeeeeeeeeesenweseeeeesw
+nwnwwnwenwwnwnwnwnwnenwnwnwenwnwnwswnw
+nwswswswwewswswneseswswswswwswswnesww
+eswseseeweeeseeeneneseesesesee
+neneneeneswneenweneneeenenenenewsene
+wseeweneneweseeneeneneeeseenenene
+neesenwwsenenenewwweeneneweesw
+nesesenwneeneeesenwwswneswnwnwneww
+eesweweneeneeeeneesweeseenwe
+nenwnwnwswneneenenenwnenwnwnwswnesenenenew
+neswnesenwswseswesenwswseswewswsesww
+eseenweeseeeeeeesesesenwswee
+wseseeseseeesesee
+swsewnewwwnesesewwwwnwsewnenewnw
+nenenenenesenenenenewnwnesenenenwnw
+nwswswnewewnenwsewseswwsenenwesenwew
+enwnwnwwnwswwwnww
+eeeseeeesesenewseweeeeesene
+nwnwnewwwnwenwwswwnwwnwseesewse
+weenenenenenenenewnenesweneenesenw
+swenwsesenenwsewswnewsw
+senenwneseswwswnesenwnewnenenenenenenenw
+wwswwwswwnewwsewsw
+enewswwnewwwwwwnewnwseswswwwsw