From 663fc5bc6e1aa23b9f14d5c2c2e977d6e5a26f53 Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Wed, 13 Dec 2023 20:01:24 +1000 Subject: [PATCH] 2023: Day 13, part 1 --- 2023/day13/Cargo.lock | 7 + 2023/day13/Cargo.toml | 8 + 2023/day13/src/main.rs | 85 +++ 2023/input/day13.sample | 16 + 2023/input/day13.txt | 1339 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 1455 insertions(+) create mode 100644 2023/day13/Cargo.lock create mode 100644 2023/day13/Cargo.toml create mode 100644 2023/day13/src/main.rs create mode 100644 2023/input/day13.sample create mode 100644 2023/input/day13.txt diff --git a/2023/day13/Cargo.lock b/2023/day13/Cargo.lock new file mode 100644 index 0000000..74e24a1 --- /dev/null +++ b/2023/day13/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "day13" +version = "0.1.0" diff --git a/2023/day13/Cargo.toml b/2023/day13/Cargo.toml new file mode 100644 index 0000000..36c9510 --- /dev/null +++ b/2023/day13/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "day13" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/2023/day13/src/main.rs b/2023/day13/src/main.rs new file mode 100644 index 0000000..b079639 --- /dev/null +++ b/2023/day13/src/main.rs @@ -0,0 +1,85 @@ +use std::string::FromUtf8Error; +use std::{env, fs}; + +type BoxError = Box; + +fn main() -> Result<(), BoxError> { + let input_path = env::args_os() + .skip(1) + .next() + .ok_or("missing input file path")?; + let input = fs::read_to_string(&input_path)?; + + let mut vertical = Vec::new(); + let mut horizontal = Vec::new(); + + for pattern in input.split("\n\n") { + if pattern.is_empty() { + continue; + } + + println!("{pattern}"); + let lines = pattern.lines().collect::>(); + if let Some(i) = find_mirror_point(&lines) { + horizontal.push(i); + continue; + } + + // transpose the lines to try to a vertical mirror point + let transposed = transpose(&lines)?; + if let Some(i) = find_mirror_point(&transposed) { + vertical.push(i); + } else { + return Err("no vertical or horizontal split".into()); + } + println!() + } + + let part1 = vertical.iter().sum::() + horizontal.iter().map(|h| *h * 100).sum::(); + println!("Part 1: {part1}"); + + Ok(()) +} + +fn find_mirror_point>(lines: &[T]) -> Option { + let mut prev: Option<&str> = None; + for (i, line) in lines.iter().enumerate() { + match prev { + Some(prev) if prev == line.as_ref() => { + print!("possible mirror point at {i}: "); + // split the array in half, see if they're the same + let (first, second) = lines.split_at(i); + // ensure they're the same length + let len = first.len().min(second.len()); + let start = first.len() - len; + let (first, second) = (&first[start..], &second[..len]); + if first + .iter() + .rev() + .zip(second.iter()) + .all(|(l, r)| l.as_ref() == r.as_ref()) + { + println!("seems to be mirror point"); + return Some(i); + } else { + println!("no match"); + } + } + Some(_) | None => {} + } + prev = Some(line.as_ref()) + } + None +} + +fn transpose(lines: &[&str]) -> Result, FromUtf8Error> { + let mut transposed = Vec::new(); + for i in 0..lines[0].len() { + let mut col = Vec::new(); + for line in lines.iter() { + col.push(line.as_bytes()[i]) + } + transposed.push(String::from_utf8(col)?); + } + Ok(transposed) +} diff --git a/2023/input/day13.sample b/2023/input/day13.sample new file mode 100644 index 0000000..b056c34 --- /dev/null +++ b/2023/input/day13.sample @@ -0,0 +1,16 @@ +#.##..##. +..#.##.#. +##......# +##......# +..#.##.#. +..##..##. +#.#.##.#. + +#...##..# +#....#..# +..##..### +#####.##. +#####.##. +..##..### +#....#..# + diff --git a/2023/input/day13.txt b/2023/input/day13.txt new file mode 100644 index 0000000..b3ff455 --- /dev/null +++ b/2023/input/day13.txt @@ -0,0 +1,1339 @@ +#..#..##.#. +#..#..##.#. +......#..## +##########. +..####.#.## +#.#.##....# +..#.##....# +..####.#.## +##########. +......#..## +#..#..##.#. + +#..#####.##.#.#.. +####..#.#....#### +..##.......##.#.# +#..######.#.##### +#..######.#.##### +..##.......##.#.# +####..#.#....#### +#..#####.##.#.#.. +#..#...###..#..#. +#..#.###.#..#...# +###.##..#.####.#. +.##.###.##...#.## +##.###.#..###..## +#..###.#..###..## +.##.###.##...#.## +###.##..#.####.#. +#..#.###.#..#...# + +##.##.# +..#...# +###.##. +###.##. +..#...# +##.##.# +..#..#. +##.#.## +.####.# + +#..#...#..#.. +####.##....## +.##.####.#### +......######. +.##..#......# +.##.##..##..# +#..###.#..#.# +.....#......# +#####..#..#.. +.##..#.#..#.# +#..##..#..#.. +#..#..##..##. +#####..#..#.. + +.##.....##... +.##.....##.#. +.#.###...###. +#..##.#.##### +#####.##..... +#####.##..... +#..##.#.##### +.#.###...###. +.##.....##.#. + +#.#..#### +.##..#..# +.##..#..# +#.#..#### +###...... +#.#.#.### +..##.##.# +.#.#.##.. +.#.#.##.. +..##.##.# +#.#.#.#.# + +####..##..# +..##..#.##. +#####...##. +#..##.#.#.. +####..##### +.####..#### +#.#.##.#..# +####...#### +##.#.#..... +......#.... +##...###..# +..#.#..#..# +..#.#..#..# +##...###..# +......#.... + +.....#. +#..#..# +..#.#.# +####... +#..#... +.##..#. +#..###. +.##.... +.##.... + +...######..##..## +.#...#....####... +###..#..##....##. +#.....#.###..###. +#.....#.###..###. +###..#..##....##. +.#.#.#....####... +...######..##..## +.##..#.....##.... +####.#.########## +...####.#.#..#.#. +.##.#.#..#....#.. +.###.#.....##.... +..#...#.##....##. +.##...#..##..##.. + +.#..#.#.. +.......## +######.#. +#.##.###. +#....#.## +#....###. +######.#. +.####.... +.####.#.. +######.#. +#....###. + +.####....####.#.# +.#..#.##.#..#.### +#.##.#..#.##.#..# +..##......##..### +##.########.###.. +.####....####.#.# +#....#..#....#.## +................# +#....####....##.# +#....####....#..# +..............#.# +..##..##..##..... +......##.......#. + +.#..#.. +.#..#.. +##..... +..#.#.# +##.##.. +.###.## +...##.# +#.#.### +#.#.### +#..##.# +.###.## +##.##.. +..#.#.# +##..... +.#..#.. + +..#....#..# +##.##..#..# +###...##..# +.....#..##. +##...#..##. +##.####.... +#####...... +##.###.#..# +##......... +..###.##.## +###.#.#.... +###...##### +..##.#..... + +..####### +.#####... +###..##.. +#..##.#.. +.##...... +#..##.#.# +###.###.. +.#.#.#... +.#.#.#... +###.###.. +#..##.#.# +.##...... +#..##.#.. +###..##.. +.#####... +..####### +.######## + +######.##..#.## +#####.###.#..#. +..#.######.##.# +.#.#.##...##... +###..##.##....# +###..##...##... +..#....#..#.... +##..##.#.#..##. +##..##.#.#..##. +..#....#..#.... +###..##...##... + +###.#.##..#.##.## +###.#.##..#.##.## +.##..##.####.###. +##...##.##.....## +..#.##......#.#.. +.#####..#.###..## +.#..##..#.#..#.## +.##.#.#....#..##. +.###.#.#.###..### +#.#.#.###.#.#.##. +#.#.#.###.#.#.#.. + +#..#.########.# +.#.#####....... +#...#...#.#.... +.####....##..#. +.###.....##..#. +#...#...#.#.... +.#.#####....... +#..#.########.# +#..#.########.# + +#.#....#### +...#####..# +..######### +.#.#.#.#..# +......#.##. +.##.##..##. +###.##..##. + +##..##...###.#. +##..##...###.#. +....#####.##.#. +##.#####...#.## +#..#..#.#.##### +..#...#.#.##### +##.#..#.....### +#..#...######## +.#..##..#####.# +##..#....#.#... +##..#....#.#..# + +.########.##..#.. +.###..###.####... +.########..##.#.. +.###..###.#.#..## +####..####....... +..#.##.#...####.. +###....###....#.. +##.#..#.####...## +.#......#...#..## +.###..###.#.###.. +##.#.##.##.####.. +...#..#....#..#.. +.#......#.#.##.## + +#.#...##. +#.#...##. +##..###.# +.###.#.#. +##....### +#.....#.. +.######.. +###.##.#. +##....### +.##.####. +.......## +.......## +.##.####. +##....### +###..#.#. +.######.. +#.....#.. + +..##.#.#.##..#.#. +##.#.#.#.....#.#. +#..####.#.###..#. +.#.#.#...##.##### +.#.#.#..###.##### +#..####.#.###..#. +##.#.#.#.....#.#. +..##.#.#.##..#.#. +##.#.##.########. +....#.#..#....#.. +....#.#..#....#.. + +#..##..#.##.# +.#....#.####. +###..####..## +.#....##....# +.........##.. +..####...##.. +..#..#..#..#. +...##....##.. +#......#....# +...##........ +...##....##.. + +.#.....#..#..## +#..##..####..## +##.##.#...##.## +.##.###.#..##.# +.##.###.#..##.# +##.##.#...##.## +#..##..####..## +.#.....#..#..## +#.#.##.#.#.#.## +..#......#.###. +##..#..##.####. +.#..#...###..#. +.#......###..#. + +..##...####.#.. +#########..#### +.####.#.###.### +.####..##.#.#.. +######.###..### +.#####.###..### +#.##.#.#..##... +.#..#.#.#.#..## +.......#...##.. +.#..#.#...#.... +##..##.##.##### + +..##.## +....#.. +....#.. +..##.## +..#..## +##...#. +..###.# +###.##. +.####.# + +.#..#..###..#.. +..##.##.#.....# +......#.###.#.# +........#.#.#.. +#######....#... +######..#...##. +#.##.#...#.##.# +.####.#..##..#. +.####......#### +#.##.##....###. +......###.####. +......###.####. +#.##.##....###. + +..#..#.#..###..## +#####.#..######.. +..#....#.#######. +#.#.####...###### +..###..#.####..#. +##.######..##.#.. +##..####...#..#.. +..#.#.##..##.#..# +####...####.....# +####.##...##..#.. +#####.#..###....# +..##.#.####..#..# +..##.#.####..#..# + +###.##.#..#.##.## +##....#.##.#....# +..##..#.##.#..##. +##..#...#....#..# +...###.####.###.. +....#.#....#.#... +###.###.##.###.## + +..##........# +.####..##..## +##..###..###. +.#..#..#...#. +#....##..##.. +#....#....#.. +######.##.### + +..#...###..## +.##..##....#. +.#.#.#####... +.#.#.#####... +.##..##....#. +..#...###.### +..#....#.#### +#...#..##.#.. +#...#..##.#.. +..#....#.#### +..#...###.### +.##..##....#. +.#.#.#####... + +#.##### +...#..# +####..# +.#.#..# +#..#### +#.##### +#...... +#.##..# +#.##..# +#...... +#..#### + +#####.####.#####. +....#......#...#. +.#..###..###..#.# +.##.#..##..#.##.. +##..#.#..#.#..##. +################. +..###.#..#.###... +###..#.##.#..###. +###..#.##.#..###. + +#......#.##.# +..#..#..####. +.....##..##.. +....####.#..# +.####.#..##.. +#.#.###...... +.##....###### +#####.##....# +...####..##.. +...####..##.. +#####.##....# +.##....###### +#.#.###...... + +..#..#.## +.##.#..#. +.##..#### +###...#.# +.##.##.## +.#.#..#.. +##..##.## +##..##.#. +#.###.... +#.##.#.#. +.###..##. +.#.#.##.# +...#.##.# +...#.##.# +.#.#.##.# + +.........#.##.# +...........##.. +.#.##.#....###. +.#....#.#.#..## +#.####.#..####. +...##.....##... +...##....#..#.. +#.#..#.#.###.#. +...##....##...# +.#.##.#..##.### +.#.##.#..####.. +.##..##......## +.##..##......## +.#.##.#..####.. +.#.##.#..##.### +...##.....#...# +#.#..#.#.###.#. + +..#..#.##.##. +....####.#### +..#..#.#..... +####......##. +####.#.#...#. +##..#........ +..##.#.#.#..# + +#..##.... +.#.##.... +##....##. +#.#.#.##. +.####.##. +###..#..# +#.#.#.##. +.#.#.#### +..#.#.##. +.##..#### +#####.##. +.#.#.#### +.#...#### +.#.#.#### +.#.#.#### +#####.##. +.##..#### + +#.###.##.## +#.###.##.## +..#.#....#. +####..##..# +......##..# +##......... +####.#..#.# +.###..##..# +#.......... + +#..#...#...##.#.# +#..#.#.#....#.#.# +.#.#####...#..#.# +.#.##...#.#.##.## +.#.##...#.#.##.## +.#.#####...#..#.# +#..#.#.#....#.#.# +#.##...#...##.#.# +..#..###.#....##. +#..#.#..#.##....# +..###.##..#####.# +..###....###.#### +..###....###.#### + +.##.###..#.#... +####.#.##..###. +...##...#.###.# +####..###.###.. +....#..#.#.#..# +#..#.#.##...... +#..#.#.##...... + +...##########.... +#.#..######..#.## +#...#..##..#...## +##...######...### +##...#.##.#...### +#####.#..#.###### +..#.##....##.#... +..###.####.###... +.#.#.######.#.#.. +..#####..#####... +######.##.####### +#...##....##...## +.#..########..#.. +#...########...## +#............#.## +#.###.#..#.###.## +.##.##.##.##.##.. + +.#....#.....#.# +###..###.#...#. +###..###.#...#. +.#....#.....#.# +.#.##.#.###..## +..#..#....##### +#.#..#.#...#.#. +##########.###. +.#....#.#.##### +.#.##.#.#...##. +###..###..#..#. +.#....#.##.##.# +##....##.....#. +...##.....####. +##....#....#### + +.#..#.##...#. +##..##...#.#. +##..##...#.#. +.#..#.##...#. +.####..##...# +###.###...##. +##..####...#. +#######....## +######.#.###. +.......##..## +######.###.## +..##...###... +#....#.#..### +######.#...#. +#.##.#####... + +#..#..#...#.# +.##.####.#.#. +.###.##.##### +...#.####.### +.....#####.#. +.....#####.#. +..##.####.### +#####..##.### +#####..##.### +..##.####.### +.....#####.#. +.....#####.#. +...#.####.### + +..#.### +####.## +...#### +.##.... +#..##.. +####... +.###... + +..##...#### +#...##.#... +#.#.#.##... +#.#.#.##... +#...##.#... +..##...###. +##..#..#... +##..###.... +..#.....### +....###..## +#.#..###.#. +.#.#..##.## +.#.#..##.## + +##.##.### +...#####. +###.#...# +##.###.## +..##..##. +...#.###. +.....#### +..#.##... +.##.#.... +....###.. +....#...# +##...#..# +##...#..# + +#####...# +#####.### +####..##. +#..#.##.# +.##.##.#. +.##.##.#. +#..#.##.# +####..##. +#####.### +#####...# +####.#.## +.....#... +#####..#. +#..#..#.. +.##..#### +##.#.#... +#..#..#.. + +##.#... +##...#. +##..##. +###.#.# +....#.# +..#.### +..#.### +....#.# +###.#.# +##..##. +##...#. +##.#..# +...#... + +#####..###.#.###. +#####..###.#.###. +.#..#.##..#.#.... +.#.#....####..... +...##..###.####.# +.#####..#...##..# +.#####..#...##..# +...##.####.####.# +.#.#....####..... +.#..#.##..#.#.... +#####..###.#.###. + +..####.###.##.# +.#...##...#.##. +#...###....#... +#...#..#.#...## +#..##..#.#...## +#...###....#... +.#...##...#.##. +..####.###.##.# +###.###...##### +#.##.#..#####.# +#.##.#..#####.# + +..####.#..###.# +..####.#..###.# +#..##.###...### +.#...#...##...# +..#..#####..##. +..#..####...##. +.#...#...##...# +#..##.###...### +..####.#..###.# + +#.######.##..##.# +#...##...##..##.. +##.####.########. +#.##..##.##..##.# +#..####..######.. +####..####....### +###....####..#### +.##....##..##..## +.##.##.##..##..## +###.##.####..#### +.#......#.#..#.#. +...#..#...#..#... +#.##..##.#.##...# +.########......## +#........#....#.. +#..#..#..#....#.. +##......##.##.##. + +...........#.#.#. +.#..#.#..##.#.... +.#..#.#..##.#.... +...........#.#.#. +.#..#....#.##...# +..##.#.#..##.#... +.####...#####...# +#....###.#####.#. +######.###..##.#. +.####.##.#..#.... +.#..#..##.....#.# +..##..#..####.##. +######.#...###... +#....##.#..#...#. +..##.....#.###... + +##..#.# +#...#.# +#..###. +#...##. +.###.#. +##.#.## +...##.# +.#.##.. +.#.##.. +...##.# +##.#.## +.###.#. +#...##. +#..###. +#...#.# + +#.#..#. +##.##.# +.#....# +#.####. +#.####. +.#....# +##.##.# +#.#..#. +.##..#. +#..##.. +##....# +.#....# +#...... + +.####.#..## +.#..#..##.. +######.#### +#.##.####.. +#......##.. +.####..#... +#....###### +..##..#.... +##..####### +#....#.#... +.####.##### +######.##.. +######.#### +..##...#### +.####...... +######.#.## +..##....### + +##.#.## +##..#.# +....#.# +##.#.## +##.#.## +....#.# +###.#.# +##.#.## +##.#### +....#.. +##.#... +..##### +##.#.## + +##.#.###. +##...###. +##..#.### +#.#...#.# +.#....### +.#.####.. +...#.#### +.#...#### +.#..##.#. +#..#...## +.##...#.# +#.##..#.. +.#...#... +....###.. +....###.. +.#...#... +#.##..#.. + +.#....#.. +##....#.. +#...#.#.. +#..#....# +.####.... +.#.###.## +.##.###.# +.##.###.# +.#.###.## + +###..#....# +...######## +###.#...... +##..##....# +####.###### +##..#.#..#. +..###.#..#. +..#.#.####. +....#.#..#. +.......##.. +#####.####. +##.#######. +###.###..## + +#..#...########.. +#######...##...## +.##...#........#. +....###..####..## +.##.............. +#..##..########.. +....##..#....#..# +.##.#..##....##.. +#..#.###..##..### +....##....##....# +....#...##..##..# + +.#.#....#.#.##.#. +..###..###..##..# +##..#..#..##..##. +....####......... +.#.#.##.#.#....#. +#.########.#..#.# +.##......##....## +..########......# +#..#.##.#..####.. +#..#.##.#..#..#.. +..#.#..#.#..##..# +....####......#.. +##.######.######. +#.#.####.#.####.# +#..######..#..#.. + +######.###..####. +######.....##.#.. +####..##.##....## +####...####.#.##. +#####.#.##.###.#. +....##..##.##..#. +......######.###. +####..#.#.###...# +.##.#.#.####.##.# + +#..##..###..### +..#..#...#..#.. +.........####.. +#......##.##.## +..####..#....#. +...##.....##... +#.####.##.##.## +..........##... +...##...##..##. +.#....#...##... +.#....#.#....#. +.#....#......#. +##....##..##..# + +....#..#... +..##....##. +..########. +##.#.##.#.# +...##..##.. +##...##...# +..########. +..#..##..#. +###.......# +##.#.##.#.# +##.######.# + +##..##.#......... +##....#..###..### +..###..##...##... +....#..#......... +.#.####..#......# +##...#....##..##. +##.#..#..#.#..#.# +....#..#.#.####.# +####.#.##.##..##. + +#....####....## +#.##.#..##..##. +#....#.##....## +.####..#..##..# +#######.##..##. +.####..######.# +######.##.##.## +##..##.##....## +.#..#.#..####.. +.####.#..#..#.. +########..##..# +.#..#..#..##..# +#....#....##... +#.##.#.#.#..#.# +######..#....#. +.........#..#.. +#....#.###..### + +##..######..##.## +#...#..#.#...#..# +###.######.#####. +..##......##..### +#.#........#.#.#. +..###.##.###..#.. +..###.##.###..#.. + +#.#..#.#.#. +###..###..# +..####...## +#..##..#### +.#....#.#.# +#.####.###. +.##..##...# +##....####. +########..# +##....##.## +##.....#.#. +#..##..##.. +..####....# +###..###... +#..##..#### +##....###.. +##....###.. + +####..#..#..# +.#####....### +#.##..#..#..# +#...##....##. +.############ +#..#..####..# +#######..#### +.######..#### +.######..#### +##.....##.... +.##.##....##. +#.#.##.##.##. +#.#....##.... +..#.......... +.##.##.##.##. + +.####.#.##. +##..#####.. +...#...#### +..##..#.... +......##### +#....####.# +.#..#..#..# +..##....### +.#..#...### +..##...##.. +.####...#.# +.####...#.# +..##...##.. +.#..#...### +..##....### +.#..#..#..# +#....####.# + +..#..#...######## +#.####.###......# +.........#.#..#.# +.######..###..### +##.##.##......... +##.##.##.#.#..#.# +#.####.#####..### +.######.###....## +#.#..#.#.#.#..#.# +........###....## +.........#.#..#.. +########...####.. +#.#..#.##.#....#. + +##...###.#..#.# +..###.##.##.### +...#..#.####..# +..####.##.#.... +..#.##...#..#.. +###...#.#.....# +###...#.#.....# +..#.##...#..#.. +..####.##.#.... +......#.####..# +..###.##.##.### + +..####...#### +#.#..#.##.##. +.#....#.##### +...#....##..# +..####...#..# +..#..#..#.##. +##########..# +.#.##.#.#.##. +##....###.##. +.######.#.##. +#......#..... + +##.##......#. +##..#.##..##. +##..#.##..##. +##.##......#. +####.###....# +...#...#.#... +...##...#.#.. +#.##..#.#...# +.........#### +...#.#####.## +########....# +###..####.#.# +..#.#.###.... + +#.#.##.###. +#.######.## +..######..# +#........## +##########. +#..#..#..#. +#..#..#..#. + +##..###.#.# +......##### +.#..#.##... +#...###.... +######.#### +##..##..### +.####.#.### +#.##.#.#.#. +#....#..### +.#..#.....# +.#..#.....# +#....#..### +#.##.#.#.#. +.####.#.### +##..##..### + +#..#.###... +###.....### +.....###.## +......##... +.##.#.###.. +.##.#.###.. +......##... +.....###.## +###.....### +#..#.###... +....#..#### +#..##..#... +......####. + +#.#....## +#.#....## +###.#.#.. +###..#### +...##..#. +#.###...# +####...## +####..### +#.###...# +...##..#. +###..#### + +....#.#..##..#.#. +..##.####..####.. +#..###.#....#.### +###.###..##..###. +#.#.....####..... +.....####..####.. +.#............... +##...###....###.. +..#.#.#......#.#. +..#.#.#......#.#. +##...###....###.. +.#............... +.....####..####.. +#.#.....####..... +###.###..##..###. + +#.##.#..#...# +#.##.#..#.#.# +.#..#...#..## +#.##.#....#.# +#.##.####.#.. +......####### +##..##.##.... + +####... +##..#.. +..#.#.. +..#.#.. +#####.# +...#... +.##..#. +##.#.## +####... +##..#.. +##.#.## +###...# +##.##.. +..#.... +...##.# +..#.#.# +..#.#.# + +.#.###. +...#.#. +....### +##....# +##....# +....### +...#.#. +.#..##. +###.##. +###.### +###.### + +.##...#.. +.##...#.# +.###.##.# +..####.#. +#..#.#.#. +..#...#.. +##...#..# +#.##.#.## +...##.### +#..#.#.## +#..#.#.## +...##.### +#.##.#.## +##...#..# +..#...#.. + +.#.##..##.#..#. +.#.######.#..#. +........#...... +..###..###....# +...#.##.#...... +..###..###....# +#.##....##.##.# +##........####. +##.#.##.#.####. + +.###### +..#.... +..#.##. +###.... +#..#... +####..# +#.#.... +#.#.##. +##..... +##.#### +###.... +###.... +.#..##. +#..#### +#..#### +.#..##. +###.... + +##..#..#....# +##..#..##.### +##..#..##.### +##..#..#....# +###.#......#. +....#..#.###. +###..###.#... +####.#.#####. +..##.######.# +##.#..##.#.## +##..#####..#. +##.#.###..#.. +...#####...## +.#..#..##.#.. +..#......#.## +..#.#####.... +##...#.#.#### + +####..##.#.##.#.# +##.##.########### +...##....##..##.. +####.###..####..# +...#.####.#..#.## +.......#.#.##.#.# +.....#.#.#..#.#.# + +..#...##... +.###.#..#.# +.#.##.##.## +.#..######. +.##.#.##.#. +.##.######. +#...#....#. +..######### +.#..##..##. +.#.#.####.# +#..######## +##.#......# +.#..######. +##...#..#.. +#####....## +#.###....## +##...#..#.. + +.##.##.##..#..... +#.##.#########.## +##..##..####.#.## +#.####...#.####.. +......#.#.##..#.. +#....##..#..#..## +....#.#....#.#### +....#.#....#.#### +#....##..#..#..## +......#.#.##..#.. +#.####...#.###... +##..##..####.#.## +#.##.#########.## +.##.##.##..#..... +....#.##..##.#... + +#.#.##.#.#... +..#.##.#....# +####..####.#. +..#.##.#...#. +#.##..##.#... +#..####..#.## +.#.#..#.#.#.# +#.######.#..# +.#......#.... +..#.##.#...#. +.#.#..#.#.#.. +.#..##..#.#.# +.###..###.### +..........##. +.########.#.. +.#..##..#.#.# +.#..##..#.### + +.....#..#.#....## +.....#..#.#.#..## +###....#........# +###....#.#.#.#### +...#.#..#.##.###. +..#.####...#....# +######...##.#.#.. +..##.####.####..# +..#######.##.##.. +##...#.#####..#.# +..#..#.##.#.#.#.. +...#..#.....#.### +##..#.#.##..####. +##....#...#...#.. +...#.###...###..# +##.##.#.##.###.#. +..#.#....#.#.##.# + +..#..#...#..#..#. +.#.....#..##....# +..###.#.#....##.. +#..#..#..###.##.# +###...##.###.##.# +#..##..###.#....# +.###.######.#..#. +###.#..#....####. +...#..#..#..#..#. +##.#..###.#...... +.##.#..###.###### +....#.##..##.##.# +..###...####....# +..#...#...##.##.# +..#...#.#.##.##.# + +....#.#.. +......#.. +.##.#.... +....#.### +####..##. +.#.#.##.# +.##.##... +.#.#.#.## +.#.#.#.## + +#....#.#. +..##..#.. +..##..#.# +#....#.#. +##..###.. +##..###.. +#....#### + +#######.#.. +#..#.#..##. +#..#.#.#..# +.##.....##. +.##...##... +#..#..##... +.....##.#.# +.....##..#. +.....##..#. +.....##.### +#..#..##... +.##...##... +.##.....##. + +###..##..###. +..#.####.#... +..#.####.#..# +###..##..###. +##........### +#.##.##.##.## +#.########.## + +###..## +...##.. +..#..#. +##.##.# +###..## +..####. +#####.#