Commit d51325ae authored by Neil Smith's avatar Neil Smith
Browse files

Done day 24

parent 5072f953
# This YAML file describes your package. Stack will automatically generate a
# Cabal file when you run `stack build`. See the hpack website for help with
# this file: <https://github.com/sol/hpack>.
name: advent24
synopsis: Advent of Code
version: '0.0.1'
default-extensions:
- AllowAmbiguousTypes
- ApplicativeDo
- BangPatterns
- BlockArguments
- DataKinds
- DeriveFoldable
- DeriveFunctor
- DeriveGeneric
- DeriveTraversable
- EmptyCase
- FlexibleContexts
- FlexibleInstances
- FunctionalDependencies
- GADTs
- GeneralizedNewtypeDeriving
- ImplicitParams
- KindSignatures
- LambdaCase
- MonadComprehensions
- MonoLocalBinds
- MultiParamTypeClasses
- MultiWayIf
- NamedFieldPuns
- NegativeLiterals
- NumDecimals
# - OverloadedLists
- OverloadedStrings
- PartialTypeSignatures
- PatternGuards
- PatternSynonyms
- PolyKinds
- RankNTypes
- RecordWildCards
- ScopedTypeVariables
- TemplateHaskell
- TransformListComp
- TupleSections
- TypeApplications
- TypeFamilies
- TypeInType
- TypeOperators
- ViewPatterns
executables:
advent24:
main: advent24.hs
source-dirs: src
dependencies:
- base >= 2 && < 6
- containers
- linear
- text
- attoparsec
-- import Debug.Trace
import Data.Text (Text)
-- import qualified Data.Text as T
import qualified Data.Text.IO as TIO
import Data.Attoparsec.Text hiding (take)
-- import Data.Attoparsec.Combinator
-- import Control.Applicative
-- import Control.Applicative.Combinators
import qualified Data.Set as S
import Linear (V2(..), (^+^))
-- import Data.Semigroup
-- import Data.Monoid
data Direction = NE | E | SE | SW | W | NW
deriving (Show, Eq, Enum, Bounded)
type Tile = V2 Int -- x, y
type Grid = S.Set Tile
instance Semigroup Int where
(<>) = (+)
instance Monoid Int where
mempty = 0
main :: IO ()
main =
do text <- TIO.readFile "data/advent24.txt"
let walks = successfulParse text
let grid0 = foldr flipTile S.empty walks
print $ part1 grid0
print $ part2 grid0
part1 grid0 = S.size grid0
part2 grid0 = S.size $ (iterate update grid0) !! 100
delta :: Direction -> Tile
delta NE = V2 1 0
delta E = V2 0 1
delta SE = V2 -1 1
delta SW = V2 -1 0
delta W = V2 0 -1
delta NW = V2 1 -1
flipTile :: Tile -> Grid -> Grid
flipTile tile tiles
| tile `S.member` tiles = S.delete tile tiles
| otherwise = S.insert tile tiles
neighbourSpaces :: Tile -> Grid
neighbourSpaces here = S.fromList $ map nbrSpace [minBound .. maxBound] -- [NE .. NW]
where nbrSpace d = here ^+^ (delta d)
countOccupiedNeighbours :: Tile -> Grid -> Int
countOccupiedNeighbours cell grid =
S.size $ S.intersection grid $ neighbourSpaces cell
tileBecomesWhite :: Grid -> Tile -> Bool
tileBecomesWhite grid cell = black && ((nNbrs == 0) || (nNbrs > 2))
where black = cell `S.member` grid
nNbrs = countOccupiedNeighbours cell grid
tileBecomesBlack :: Grid -> Tile -> Bool
tileBecomesBlack grid cell = white && (nNbrs == 2)
where white = cell `S.notMember` grid
nNbrs = countOccupiedNeighbours cell grid
update :: Grid -> Grid
update grid = (grid `S.union` newBlacks) `S.difference` newWhites
where neighbours = (S.foldr mergeNeighbours S.empty grid) `S.difference` grid
mergeNeighbours cell acc = S.union acc $ neighbourSpaces cell
newWhites = S.filter (tileBecomesWhite grid) grid
newBlacks = S.filter (tileBecomesBlack grid) neighbours
-- Parse the input file
tilesP = tileP `sepBy` endOfLine
tileP = foldMap delta <$> many1 stepP
stepP = choice [neP, nwP, seP, swP, eP, wP]
neP = "ne" *> pure NE
nwP = "nw" *> pure NW
seP = "se" *> pure SE
swP = "sw" *> pure SW
eP = "e" *> pure E
wP = "w" *> pure W
-- successfulParse :: Text -> [Tile]
successfulParse input =
case parseOnly tilesP input of
Left _err -> [] -- TIO.putStr $ T.pack $ parseErrorPretty err
Right tiles -> tiles
wwwnwwswweswwwswwwwswwswwww
swnwwsesenesenenwwnewwwwnwwnwwnw
nenewnesenwnenenenenenene
neeeeewneneneneeeeneeeeeee
swwneswswseseneweseswnwnwseneswswsesenew
eneneneswneeneeeneneeneenenenenene
sesesweseseseenwseseseswsenwseswswswse
eeeeeweneeee
neesewweneewswneeneneseeeeeeee
swsenwswswswswseswseswswswsweswswswswsw
neswewswwsewwwnwsw
seswsenenwswswswseseneseswswswseseswseswse
sewweswneneeneneeeseseeseeneesww
seswsesesesenwnwseseneseseseeseewseee
nwnwnwwewnwwwwnwwwwww
wnwwswwwwwswsewwwweswne
swsesenenwnenwswseseneswseswe
nwwenwwnwwwwwwswwsenwnewnwnwwne
swwwwneswswwseswwswwneswwwswwew
nwneswnenwnenenwenwnwnenenwsenenwnenenw
neneneneneneeneneneneneeneneneenenwnesw
nesewnenwwenwnwwseseeseseneneswwsw
nwnwnwenwwnwnwneswnenenwnenenwnenenwnwne
wnewswwwwswswwswwseswwswswswswsw
nwweswnwswwwswswwnwwsewswswswenesw
neswneneneneneewnene
nwnwswnenwwnwnwnwnwnwnwwswswnewnenwwnw
nenenenewewneneenenewsenewneenesee
nwwnenwnenenenenwnenenwenwnenenenenene
nwsenenenwnwnenenwnesenwnwnwnwnwne
nwneseswwwwswsewwseswswswswswswnewsw
wwwwnwswwwenewnwwwwswwnwww
sesesesesesenwesesesesesesewsweseneseese
eeneneweeeneeseeee
wweswnwwnwnewnwwwswseenwwnwwnwnw
neenenwneneseewnenwnwnwnenenwnesweswsw
seswnwsesewwswwseswneswsweneeseswwe
nenewnwnwnenenenewnwswenwwnesenesenwne
nwenwneswswneeswsesewseww
neneeneneewswneenwneneeneswnenenenee
swseswseseswswseseseseswnwswseswswsw
swneneneswwwneswwsewseswswswswwww
nwneseswnwnwneswnewnwnwnenwnweseenwe
wwwseeenwwnwnwnewnwnwwwnwnwnww
sesesesesesesesewseseseseseseseesese
swswwswseneeswnwwesewswswweneswsw
wseewesenweneenewseneenenwswsee
enewseeseesesesenesesewsewsesesesesee
sewwwswswswwwwswwswswwwswneswsw
nwnwnenwnwwwnwnenwnwnwnwnwswnwwsenwnw
nwnwnwnenwnwnwnwneenenenew
neeneenenenwswwseeneeesenw
eseeeeseseweewseeseeeseeeee
nwsewswseseseseneseswseswseseswe
wwswswwswswnwwenwwwswswwseneew
wwwwewwwwwweewswwwwwww
swswswswswwswnweswwswswsweseswneswswsw
nwewwsenweseeeswneneseneeweewnw
nenewwnwsenwwwwswwsewewwenw
nwwnenwnenwnwnwnenwnenwnwswnwnwnenwnenese
seseneswseswswseswseswseswswseswseseswse
eeeeeeweeeeeeeeeeswenwe
eneswneneswnenenweneneneee
nwswseeneneneeeeeeeeeeenenwenee
swsenewwwwnwwwnewneeswwwnwwswnww
eeeeeeeeeeeeeeweeeee
eseeseseseeeseweneseeseeeeseese
wwwwwwswwnwwwwnwswwnwwneewe
eneseseeseseseneswneenwsewsenewswwswe
senweeeeeeneseneeeseeswnwenwwe
sewsweeneseswneswseswswwseswwswesenw
wwwwwwwwswnwwwwwswwweww
sewnwwwwwsewwwwnwnwenwenwnwswne
eeeeeenweeseeeeee
swsenwsweseswseswswswseswswsesesesesesese
sewswwnwseswswswnweeenwsesesenenesesw
nwnwseseewnenenewewwenwwnwsesenwne
sesesenweseseseneswseseewseeseseneew
swwswsewswsweswswswswseseswneswswswswnw
swseesenwseseweseeseseeseseseeenwe
wwnenwneenwnenenesenenenenwneweseswnwne
nwnwnwnwnwnwnwnwnwsewnwnwnwnwnwsenwnenw
seswsenwsesweswseseseseseswseswswsesene
seswwseseseseseseseseswswsenesesesesese
nwswswswswswneswswswswswsweswseswswswswsw
wwwswwwwwwnesewnwnwsewwwwnwe
seneneneeenewneeeeeenenweneswne
seneenwseseseswsenwwneswswsese
wswwswwwwwswnwsweenwswswwwswesw
eeseseseeeseeesenweeesewswese
nesewswswswnwswswswswwswsweswswswsww
eneswswneeeeenweeeewnwenenwseesw
seneswnwswenwnenenwwnew
seenweweesewewseseeeeeneeew
swnwnwnwnwnwnwenwwnwswenwnwnwnwnwnwnwnw
enwswswswwseseseswsenwseseeseeseswwsw
eeseseseswseseseswsenwwnwseseese
neeeeneswnenenenenenenenenenwnenenee
wnewwwwswewwwwwnwwswseswww
neneneneneneneswneneneneneneneswnenewnee
seeeseeseseseeseseeseswsenwseesesese
swwsewswswwwwswswswsenewseswswnenw
swneseseseswswseswswswseswwseseswswswse
wswweswwnewwnwwww
swswswsesewswswneswswswwsweneswswswsw
wnwwnwwwweswnenw
swseswsweswseswswswswswseswnwswseswswsese
neenesewseneeesewewneneneenenw
seneswseswswnwnwsweswswwswswswseswsenese
nwenwswswwnwwnwnwnwnwsewsenwwwnwnwenw
nenwnenenwnwnwnwnwewnwnwwnwwnwenee
wneseeswwwswsewwwswnww
nwnwnenwnwnenwnwnwneswnwwnwnwnwenwsenw
neeeeneneneneeesweeeenenwswneneee
senweseweseseseeseseseneseseeeswsese
wseseeeneseseneeeeesewseeeweese
seseseseeseseseseeeesewsesesenwsese
wseeseenwseseneeseseeeseseeseeeese
nwwesesesesenwnewwnwnesene
swwneneeeeseeeeeswseenweeeee
nenwseneneneeneeeee
nwwsewwnewwwwwwwww
neneseseenewewwnewnwnwesesenewsesee
neswswswneswnenwwewswneswwswneseswsw
seswswswseseseswseswnewseseswseswsw
wneswseseseenwnewseeswswswnwswsesenw
eneeweneneneeeneesenenenenenenenewse
neswswwwwwwwwwswsew
wneseswnewswwswew
swnwwneswnwewswwswewnwswwwsenwse
wnwnwwwwwnwnwsenwnwnwnwnwnwnwwsew
senwswnwnwnenwswsewneseesenwnwwneenwsw
nesesenenenenwnwneneswneneseenenenwnewnwnw
nenesenwneneneneneneneswneenenenenenenene
eweneesesesesewseeeseeeeeesesee
eeneeweneeneneneneeswnenwneeeswne
wswseswswnwswwswsweeseneswswseseswnw
swenwwnwwsenwnwnewnwwenewwwesw
senwseswswnewswswseswesweswswneswswse
neseneneneeswneneenenenenenenenewnewne
nesewsewwwewwwwwnwwnwnw
swneswwwnwswnewneswwwwwsewwswsesw
nenwwsewnwnwneswsesw
nwnwnwnweseswnenwenwnwnwnwnwswnwnenwnwnw
eswneneeneneneswnenenenenenewseneene
nenwswwwswwwswsweswwwsweswswsww
newneeeeneneneneneene
wnwswewneeewseeseenwswwesenenew
swswswseswswswswswswswswswswwswsweswsw
eeeeenweesweeeeeenweeesw
swswswswswswswswswswneswswswswswsw
eeeeswwwneseeneeeeenweeswee
wwwwwwwwwwwnenwwwwswwww
swwswwnwswwwsewsww
swnweesenwnwsenwswseswwweswswnw
nesenenwnenwnwnenwnwnenenwnenwseenwwnewne
nwsewwnwwnwwwwwwwwwnwnwnwww
eneenewenewneneeeneneeswswneneee
nenwnwnwnwwwnwsenwnwnwnwnwnwnwnwnwnwnwsw
nwnwnwnwnenwnwwnwnwnwnwwnwnwswnwnwnwsenenw
weseeeewneneseseeeeeseswesese
swseseseseeesesesesesesesesenw
nenwnesenwnewnenwnwnenenwnwnwnwnwnwnwnenw
nwnwnwnwswnenwnwnwnenenwnwnwnenwnwne
nwnenweswnenenwneenenewnenenenwnwnwnene
seseeeeseeseseswesenwseseenw
wnwnwnwnwneweswnwwwnwnenwnwwnwnwsew
seneeswwwswneseseswwswseswswswswswswnw
senwwnenwnwnwnenwnwnwnenwnwnwnwnwnwnenw
swnwnwsenwnenwnwnenwnewnwseswnwnenwswne
swswswswneswseswswswsw
seseseswseseseseesesesenwesesesenwnwsese
swswseswseswswswsesesesenesesenwsesesw
wwswwwswwwwswwsewwnewnewwsww
neswswwswseeswwswnenesesesesewswswsw
wwwwwwwswwswseswnewsewswnewwww
swwswswswwswwswwswswswswneswwwswsw
wenwseeeseeseeeseeeseseseneese
neneswnewswwwenwwwnwswsenwwwse
wneweeseeseeeeweenwwewseene
wswnwnweeswesweseenenwswwnenwwnwsenw
sesenesesewseenwsesweeseewesesese
eswseswsenwesenesesesesesewwswsese
nenwwswewwwweseenwsenwwwwnwesw
nwswweswswswswswswneswswwwwnweswse
nwseswseeneseeweesesewneeseeseesene
neeeswewewneseneswneneeneeneenenw
eneneneeeeeweeeneneneeeneee
seswseseswseswswseswseeswsesesewswsese
nwnwnwewwwnwwwwnwwwe
nenenenenwneneneneneswnenenenenenenenenee
wneswneswswswswwswwewswswwwswsesewnw
nenenwnenenesenwnwnenenwnenwwnwnenenenwnw
eneeseswewnwseeswseewweeneswew
ewenweeeeeesesesenweeseeee
nwsenwnwnenwwnwnwnwenwnwnwewnwnwnewne
wsweswswwswwswswwswswswswwswswnwwenw
wwsewwswnwwneeswwwwnwwwswwww
swsewswswswswswswswswswswswswswseseswne
swnwnwnwnwewswswweeenwwnewnwnwnew
seswswswswswneswswseswswswseswseswswswse
nwwwnenwwwnwsewwenwwwswwwwnwww
senwnwnwswneenweneseswnwneeswnwnweswne
wseeeeeeeeenweeeneeeeee
enweeweeenwenwseeneswseneneeeee
nenweeeneseneeeseeeeenesenewwne
nwnenenenwnenwswneswnenenwneneseene
nwnwsenwswnwnwnwnwnwnenwnwwnwnenwnwnwnwnw
ewnwsenwenwswneeseneneswnenewnenenese
wnwswwwwnwsewwnwnewwwwswwneesese
newwnwseswsenenwnwnwnenenw
nwsesesenwsenwseseseeswseswswseswsesese
sesesenwswseseswseseseeseswse
nwneneenwwnenwswnenwswsenwnenwswneneenw
enwswneneneseeeneeneneeewneswneee
wnenenwneneneneneneseswnese
neweeeneeeeeeeeeeeeeee
wswswseswswnwswswswwswswwneswseswswnene
swswseswwswseswsesweswseswseneseswnwswse
wnenweseeesewseseswseseseweswneene
enwswseseswswnwenesesewse
neseneneneneeneenenenenenewswnenenenenene
nwswsweeswseseswseswswnwwswseseswswsene
eeneseeseneeseseesenwseseeswsewsese
sesesenwesenwsweseseweneewseneneese
sesewnwnwwnwnwwwnenwwwewsweww
nwswwwewswwwnwwnwnwwnesewwwnww
enwswnwnwsesewwweneswewwwnwneew
wswswswneseswswwnwswswswswswnenwseswswse
nwnwnwnenwnwnenwnwnwnwnwswnwnwenwnwnwnwnw
nenenwnwnenenenenenesewnenenenenene
nenwnwsewswwnwseenwnesenenwnenenwse
wwwwwwwwwwwwwwswwwwwe
seswswswswswnwsweswenwswswsewswswsw
swswnwwswswwwswwneewwwswsw
ewsewwnwnewwwwnwnwsewwwnwwnwse
eseeseeseeeeeseeeneeeeseswe
sweswswswswswswswwswswnwswseswswseswe
wnenwswwnwnwnwnww
sweeeseneseseneseseewseesesew
seneeswneneenenwwswwseenwneneewene
swswswswswsesweswswswswseseeseswswwswnw
seeseeeesenwsweeseeeseese
nwnwnwnwnwnwenwnwenwnwwnwnwnewenww
wswswwswswweswswswwswnewsewswsw
nwnwnwwnwnwnwnwwwwnwwnwnweenwnwnwwsw
eneeeeneenenweneneneesweewesw
nwsenwswnwnwnwnwnenenwnwnenenewnwnwnwnee
swweswswswswneneswswswsesesewswsesesese
swswsenwswswswswswnwneswsweswsewsesesew
eneeeeeeneeneeneneeeeeswee
swwseseswseswswnenwnwseswenenesenwswswsee
seseseseseneswneseseswswsesewsesesesenesese
swwswwswswwwswewwwwswswneswswsw
esewwswwwwwwswwsewswswwnwnwswswne
nwnwwnenwewnwnwnwnwswnwnwwswnwnewnw
newswwswwswswswwseswwswnewwnwswswse
wwwsenwnwwnwnwsenewwwwnwnwsenwnwwne
seswwnwwwnwswsweenwwwwwee
swswwswswswswswswswswswesenewswswswsw
wwswswswswswswswswswswswswswesw
wnwnwwwsewwwwnwwnwwnwwsenenwsew
sewnwnenewwnesenwneeenwnwnenwnw
nenwsenewnenwnenenenwnenenenenenenenenwne
swswswswswswswswswswseneswswseswswswswsw
neewnenenwnenenewnwnenesenenenwnenene
swneeeneneeeeweneesenw
eseewneeneeeseeswnewneeeeeeee
senewsewneewswseswneswswseseswseswsw
nenwnwenenenesweweswneneneneseeenene
sesesesewsesewseseweseneswnesesesesese
nenwnwnenenwnwnwswsenwnwneneswnenwsene
swswswwneswswswneswswswswswswswwswwswsw
wwwswsewwwnewnwwwwwwwnwew
nwwnwwnwwnwnwwwwnwwwswwnewwew
eenwneenweeswseneneneswesweneenenwe
nwwnwenwewnwwnwnwswnwwnwnenwsewwesw
seswswwswswnwswswswswswswsenenwseenenesw
eeneswenweeneeneeeneneeneeee
wwswswswwswswswwswswswswwwswswneswne
nenwnwnenenwnwnenenwnenenwsenwnenenwnwnw
nenenenenenenenenenewneneneneseneenenene
eswnwswswsweswswswswswswswswswnwswswsw
ewwwnwwnwswwnwwwwwnwnwnwwwnwenw
swswseswswswswswseseseswseneswswsewswsw
nwnenenwnwnenwnesenwnenwnenenenwnwnw
sewnwwwwsewwwswwswwswswnwneswwsw
swswswswswseswsenwsw
wseswewneseswseseswneeseeesesewne
seeewsweswswwswsewnenwneewewwnw
seswenesesweseeesesenwweewnesenw
swswswnwenwswsesewneswswneswseseeswswnw
nwnwnwnwnwnwnwnwnwnwnwnwsenwnw
nwewneneswneneneneenwswnwwesesenesenene
eeneneweneneeneneeswnewenenene
swwswswnwwsesweswwsweswnewwswwnw
enenewneweneneneneeenenenenenenene
eseesweseenweeeenweeseeeeeesw
nwneeeneseseseseseseswsewsewsesewse
nenewnweeeeswseswsesenw
wnenenenenwnwneneswnwseeswsesenwnwnenenee
eeeweeneeneseeesweeeneeenee
swwnewswnewwnewseswsweswwswswwwsw
senwnwseswwneswseseseswnwseseseseseseseswse
nwnwneswnwenwnwnwnwnwnwnwnwnwnwnenenenw
wnewnewnwswnwnwwwnwnwwnwwnwnwwsew
eeeeeeseeenwneeeewesesweese
swswseswswswseswswsweseswswneswswwnwsw
senwnwsenwnwswenenenwwenwenwnewnwnwnw
eweseswewseseneneseswneewseenwee
sesesesenweseseseseseseseesesesesewsesw
nwsenwnwnwnenwnwenwnww
newwweeswwnewnwseswseenewwnwswnew
wwsewwwwwwwwwwwwwwwnww
wwenwswsweeenweeeeeseeswnwe
nwswsewwnwwsenwswnwwnwsenewwnwenw
seewseeeseeeeneeeeeeeeese
enwswwnwwwnewwwsewnwewsenewswww
senwnwswsenwnwnwnwnenenwnwswnenwnwnwnwsw
swswwwswwnewwwwwwwewswseww
seswseswseesewseseswseseneseseseswsese
eneesenenwwnwseseeeenwneeenwswese
nenwnesenenwnenenwnwnewnwnwnwnwnenenene
swseseseswnwseswswseswswseswswswseswswsw
newnwswwwnwwwwswnwnwewwwnwww
neswsweeeeeenenenwswnenw
senwwnwnwnwnwwnwwnwnwnwnwnwnwnwenwnwne
nwnwnwnwnwnwnwnwnwnwnwnwnwnwwnwnwnwenw
seswwsewswwesweseseswneswswnwswnesw
nenwnwswswneneswneneneneeneswneneenenene
neeswnenenwneneneneneneneene
nwnwnwnwnwnwnwnwnwwwwnwnwenwwnwnwsenw
wwwwseswwwwenwnwswswwwswswswwsw
wwwwwwwwwwwwewwwewww
swswswswseswswswswswwswswswneswneswswswswse
nwnwenwswnwsenenwnwnwnwwnwnwnwnwnwswnw
nwseeneneneneneneeeeseeenewnenenenew
swneswneseseewesweneseenenewewnenene
enesenwnwseeeenwwweeseeswnwese
swswswswswneswswswswswswswswswswswswswsw
eeeeeswnweeeneneneeneeeeenene
eeseeseseswwnweeeeseseeseewsee
nwnwnwnwwnwnwnwnwnwnwnwnenwnwsenwnenwnwnw
enwwseseeeseseeeneseeeseenewsenwse
swneseseswsesesesesesesesesesesesesesese
eswewsenenwseeenwseenenenweswswnwew
eseswesesesesesweseseswwsenwnesesesene
nwnwswnwnwneswnwswnwsenwnwnwnwnwneeswnwe
swseswwneswneswswseswwswswswwneswese
wwswswwsenewwsewsenewnenewnesew
wseswnwswseeenwneeeeneeswsesenwesee
swesesenesweseewseeneseneseeseese
swnenesesenwseeswwswnwwnenwneneseswse
senwseswnewseeseweseseeeewewse
seeswseswwswneswswseneswseswseswswsww
wswwswswwwwswwswwswswwesw
seseeseneseseseeeneseseesewseswseese
seneswnwewswsesenwsenwneswswnewwswse
sweseeseseseseseseesesesenwseswnwsesesese
swnwswnewswswseswnewwnwswnewswswee
seenewwsenwwwwwwwnewsenewwsww
neswneswnenenenwswwenenwnenenenwenenwne
neneeeneneneswnwneneneweneeneswnenenene
seseseeseseenwsesee
nenenenenwnenwnwnwnenenewsenenenenenene
wwwweneneswnwesweweswnwsenwswnew
swnenwnwwenewnwnwnweneneenewneswnee
senesesewenwsesesesesesesesesesesesee
wswwnewewswswnwsweweseswwswswne
esweenweneneswnenene
seseseseswseseswesesesesesesesesesewse
nwnwnwnwseenwnwnwnwnwnwwwnwnwnwnwnwse
neneeeenweneeneneeeeesenenenee
esesenenewwseseseeeseeseneseeeesw
ewwnewwnwwsenwwnwnwswnwnwnwnwnwnw
nwnwnwnwnwnwnwnwnwnwswnwnwnwwenwnwnw
swnwnenwswewnwwnwnw
neneenesenewnenenewnenenenenenenenenene
swswsewsesweseseswseneswnw
seneneneneneswneneneeeeenwnenenenene
nwnewsenwnwenwnenwnwnwenwnwnenwnwnww
seneswnwsesesweswsenwnwweseneseswswse
nwwsenwwwenwwsenwsewswnweenwsenww
sewsesweeseneswnewseseseseswesenenesw
seswseswseseswswseseswswseseswseswsene
wwwwwwwwwwnwwewewwwwww
seswnwseseseeseese
swnweeeeeeeewseneeenweesww
seswsesenwsesenwsewswswswseeseswseeswsese
nwnwnwwnwnwwenwwwwwnwwnwwwnww
nenenewseneneneneneneswnenenenwnewsenenenw
nwwnwwnwnwnenwnwnwnwnwnwnwsewwnwnwnww
eneeeeseswesewnenwnwseswsewnwwnenwse
wenwsenwnwnenwnwwsewnwnwnwnwwsenwnww
nwseenwwsenewwenwsewewneenwnwnwsw
seneeswnwnesenwnwnwwesweswswnwnesenwnw
wwswswswswswwswwswwswswswneswsw
nwneneswenwswneneneswwsenwnesenenwnwnwnwne
wwsesenenenwnewnenenenenwneneseeene
nwsewwnwwesenwnwwnewnwwnwnwwwnw
seneneewneeneeneeneneneeenenenenenew
neswswsweswswswswnewneswwswwnwswwsw
seseseeseeswnweesewsesesenewnwse
senwwwwnwwwwnwwnwnwwwwwnww
swswswwswswswswswswswneswswswswswswswsw
neswswwenwnesenwneswnenwnenesewnenwnenene
enenenenenenenesweenenenenwnwenese
nwwwwwnwsewwwwwwwwwwwnww
nenenesenenwneneneenenenenee
nwenwnewswsewseewwwnwwe
nwnwnwnwnwnwewnwnwnwnwswnwsenwwnenwnwnw
swswswwswswswswswwswswnwswswswswesweswsw
seseeseseseseseseswsesesenwsesenw
wwwwnwsenwwwwwsenewnwnwwwww
eeeeeneeeeeenesweeeeneene
nwnenwnwnwwnewsewnesenwnwwwswwwww
wswnwwewseswswwnenewwseswswnewse
swseswswswswswswswswswswseswswswnwswnese
nenwswwnenwseeswnwnweswwnwnwnwne
nenwnwnenwnwwneneswnesenwnenwnwnenenwnw
eeeeeeeeeeneweee
swseseseseswswseeseswswswsenwswsesesw
eneeeeeweeeeneeneeeeesee
wseenwswswwswwwswweswseswnwnwwne
seseswswsesenwseseseseseswweswswswsese
nwwnwswwwnwwnwwewnewwsenwswnwnw
swwswswswsweesenwswswswwneswwswwswnwe
ewnwwwwseneswesewwenwwswswesw
seseesesenwseswseseesewsesesesesesese
swswswswneswneswswwswseswseseseseswswsw
wswswswnwseswswswswwswswsweswswwsw
nwnwnwnwnenwnenwswenwwswenenwnwnenwnw
swswswswswswwseswswseseswswneswswswsese
swswswwneswsweswwsewswwnwswwswswsww
nenewneneneswnwnwene
enweeeeeeeneeeeeswneeeswne
enenwneeeeeneeneeneneeeeeswsw
seseseseseswseseseseseseseseseenwsesesese
nwnwswwwnwwsenwwenww
eseseeseneseseseseseeeseewsesenwse
seseseseseswseswsenwswseswsenw
nwswseseseeseeenweeeseseeeeseee
nwwwwwwwseeswswewnwswsw
eseseseeseeseneseseeeeeweeesee
seenwsewseeeseswswseseseesenweesesee
neseweneenenenenenenenenwnenenenenwsw
swseewneswswswswswseseswswswseswsenwsw
swwneswswswswswswswseswwswswswswswwsw
wswswwwswweswsweswwnwswswswwwwww
wwwwwwswwswwnwwseswwewwwwnew
nwnwnwnwwnwwweswnwnwnwnwnwnwnwwnwnw
nenenenwseneswesewenewenenenwseenw
eenweeeesweeeeeeeeeenee
newswwnwswnenwwnwe
senwseswseneeseeseseenwwsenesesesenesew
eeeeeweeeeeeenweeseeseswsese
neneneneneewneneneneneeswnenwneseeese
enwswnwwnwneenwwnwnwnwnwnenwnwswnwnese
swnwseenwwwseeseesesese
seswwnenwwwnweeswenewnwswswnesee
seswsweswseswswseeswnesewenwwnwsesesw
nwsenwwnwnenenwwnwenesenwne
neeenwneseewneswnwnwsewseswneswwse
eseswsenesesweseeenwneesweneeee
wnenwseweneeswswneswsesenwseswneesesw
nwnenwsenenwnwnwseneswenwneswnwwnewne
eeneeseeewsweew
swwswnwswwwwswswwsewwwsewnesww
eeeeneweseeeeseneseseseeeweese
swnenwnewwswseneseswe
swnwswsewswnwweseswswseseseseswneneswwe
eneeseseswesenwsweseeeseneseesesese
neenenwnwneseneswwneenenesw
wwswwwwswwswwswswwwseswswwnew