From 2f04763e1cb4f4f8d16aefe5b1561935f6a2d5a0 Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Tue, 12 Dec 2023 20:21:57 +1000 Subject: [PATCH] 2023: Day 12, part 1 --- 2023/day12/Cargo.lock | 7 + 2023/day12/Cargo.toml | 8 + 2023/day12/src/main.rs | 103 ++++ 2023/input/day12.sample | 6 + 2023/input/day12.txt | 1000 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 1124 insertions(+) create mode 100644 2023/day12/Cargo.lock create mode 100644 2023/day12/Cargo.toml create mode 100644 2023/day12/src/main.rs create mode 100644 2023/input/day12.sample create mode 100644 2023/input/day12.txt diff --git a/2023/day12/Cargo.lock b/2023/day12/Cargo.lock new file mode 100644 index 0000000..5e9bbe3 --- /dev/null +++ b/2023/day12/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "day12" +version = "0.1.0" diff --git a/2023/day12/Cargo.toml b/2023/day12/Cargo.toml new file mode 100644 index 0000000..ba13763 --- /dev/null +++ b/2023/day12/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "day12" +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/day12/src/main.rs b/2023/day12/src/main.rs new file mode 100644 index 0000000..8d03297 --- /dev/null +++ b/2023/day12/src/main.rs @@ -0,0 +1,103 @@ +use std::env; +use std::fs::File; +use std::io::{BufRead, BufReader}; + +type BoxError = Box; + +fn main() -> Result<(), BoxError> { + let input_path = env::args_os() + .skip(1) + .next() + .ok_or("missing input file path")?; + let file = BufReader::new(File::open(input_path)?); + + let mut state = Vec::new(); + let mut combinations = Vec::new(); + let mut part1 = 0; + for line in file.lines() { + let line = line?; + if line.is_empty() { + continue; + } + let (pattern, info) = line.split_once(' ').ok_or("unable to split line")?; + + let info = info + .split(',') + .map(|n| n.parse::()) + .collect::, _>>()?; + + // generate all combinations of wildcards + combinations.clear(); + state.clear(); + generate(pattern.as_bytes(), &mut state, &mut combinations, &info); + // dbg!(&combinations); + part1 += combinations.len(); + } + + println!("Part 1: {part1}"); + + Ok(()) +} + +fn matches(s: &str, pattern: &str) -> bool { + s.chars() + .zip(pattern.chars()) + .all(|(a, b)| a == b || b == '?') +} + +fn generate( + pattern: &[u8], + state: &mut Vec, + combinations: &mut Vec, + contiguous: &[u32], +) { + if pattern.is_empty() { + let candidate = String::from_utf8(state.clone()).unwrap(); + let candidate_info = count_contiguous(&candidate); + if candidate_info == contiguous { + combinations.push(candidate); + } + return; + } + + match pattern[0] { + b'.' | b'#' => { + state.push(pattern[0]); + generate(&pattern[1..], state, combinations, contiguous); + state.pop().unwrap(); + } + b'?' => { + state.push(b'.'); + generate(&pattern[1..], state, combinations, contiguous); + state.pop().unwrap(); + state.push(b'#'); + generate(&pattern[1..], state, combinations, contiguous); + state.pop().unwrap(); + } + _ => unreachable!("unexpected char"), + } +} + +fn count_contiguous(s: &str) -> Vec { + let mut counts = Vec::new(); + let mut in_contiguous = false; + let mut count: u32 = 0; + for c in s.chars() { + match c { + '#' if in_contiguous => count += 1, + '#' => { + in_contiguous = true; + count = 1; + } + '.' if in_contiguous => { + counts.push(count); + in_contiguous = false; + } + _ => {} + } + } + if in_contiguous { + counts.push(count); + } + counts +} diff --git a/2023/input/day12.sample b/2023/input/day12.sample new file mode 100644 index 0000000..e925935 --- /dev/null +++ b/2023/input/day12.sample @@ -0,0 +1,6 @@ +???.### 1,1,3 +.??..??...?##. 1,1,3 +?#?#?#?#?#?#?#? 1,3,1,6 +????.#...#... 4,1,1 +????.######..#####. 1,6,5 +?###???????? 3,2,1 diff --git a/2023/input/day12.txt b/2023/input/day12.txt new file mode 100644 index 0000000..512205d --- /dev/null +++ b/2023/input/day12.txt @@ -0,0 +1,1000 @@ +.????#?.??? 1,3,3 +?#??#?##??.??? 7,1,1 +.???.??.?? 1,1,1 +##?.#????.???? 2,2,1,1 +??.#???..???.#? 1,2,1,1,1 +????.??.???#??#??? 1,1,1,1,2,2 +?#?#.??.??. 4,2 +????##?##?????? 1,6,1,2 +??.????..??????##?? 1,3,6 +#????#?.?##?##? 1,3,6 +?.???.?????? 1,1,1,1 +.??.?#???####?#.#? 1,1,8,2 +##??#???###?#??? 2,1,7,1 +#..?????????##? 1,2,2,2 +?????#???#???#????.? 1,2,3,1,3,1 +?#??##???????#?? 7,6 +.???????.?? 2,1,1 +?#??????.?#?? 7,4 +.##?????#?.????? 9,1 +.#?.?????.?# 1,1,2,1 +??#??#???.#. 5,1 +??????.##?###?# 1,2,6,1 +????##?#????#?????? 8,7,1 +????#????#??? 1,9 +???????#?????#.? 9,1 +.?????#????##.?? 4,3 +????.??????.?? 1,2 +??#.?.????##???#???. 3,1,11 +#??#???.#??.?????# 7,3,1,1,1 +??#?#.##????.?? 4,2,1,1 +?#?.????#????????. 3,5,1,1 +?#??????#?. 2,3 +#??#?#???? 1,5,1 +?.???#..????# 2,1,4 +.###???#??..????? 9,2 +?.????.?????#?????# 1,1,2,1,8 +.???#??????? 1,2,1,2 +?#????.??.? 2,2 +#??#??#?#?.??#???? 9,3,1,1 +#?#??#?....##? 4,2,2 +?????#???#?.??#?#??? 8,2,1,1 +??#??###???##????#.. 7,4,1 +??.????.##??????? 1,1,1,3,4 +#??#.??.##?#???? 2,1,1,6,1 +???..????. 1,1,2 +#?.??.#?##?.???.?? 2,1,4,3,1 +??????????#?#? 4,1,2,1 +??.???????#??.?#?.? 8,3 +?.##?.??.?. 2,2,1 +????##..?#??#???..? 4,7 +???#??.#?##???#?#? 1,1,4,1,2 +?.???#????.?.????? 6,1,1,1 +??...???##?? 1,1,4 +#?.#????#?????#?.??? 1,9,2,1 +???????.???.??. 3,1 +?.?#???.??????#??#?? 5,10 +?.??#??????.? 1,5,1 +???..??????? 1,1 +.#??.???#????? 1,1,6 +??.??.???###????#??? 1,2,8,1,1 +??.?..??????? 1,1,7 +?.??#??#?..#??# 1,1,5,1,1 +?????.#?#??#?...#? 1,1,7,1 +?#?#??#???#?#?#. 11,3 +.?#??#??.##?#?. 5,4 +?#.???????? 2,1,3 +???#???###?#??#????? 11,4 +??#?????.?#?# 4,2,4 +??.#.#.?????##??.# 2,1,1,8,1 +#??.???#.?????#?# 3,1,2,7 +.??#??#??#??.#?.? 7,2 +##????.??????. 5,1,1,1 +..?#..???##???????# 2,11 +?#?#?#??#??#????#??? 5,1,4,1,1 +?#?????#?????? 1,1,6 +??#??.?#????#???#? 1,3,1,2,1,4 +??.#?.????#?. 1,2,5 +??..?????.?. 1,2 +?????#?#..? 1,3,1 +?##?.?.???? 2,1,1 +.?##?#..#. 4,1 +.????#???. 4,2 +???????.##? 1,1,2 +.?????#?#?? 1,6 +??????????.?#. 2,1,2 +.??#?.???????..??.? 3,1,4,1,1 +?.?##????#??????.??? 1,3,7,1 +.?#???.#????? 3,1,2,1 +?.#?.??#????.?#..? 1,1,3,1,2,1 +??#???#??##???.# 1,1,5,1,1 +??.?.#????#?#.?##??# 1,1,6,5 +????#?..??#?????.?? 2,1,3,2,2 +.??#??????...##. 2,3,1,2 +?#??.?????#.??#. 2,1,5,1 +.??#?#????#...????? 10,1 +.#?##???.???#??.. 5,1 +#?.#??.?#??#??#??? 2,1,1,2,1,5 +?.#??????? 2,1 +???#?.??.?.#??? 1,1,1,1,3 +#?#?#.??#.#? 5,2,2 +#????.#?#???# 3,1,3,1 +#.?.?.????????? 1,1,2,4 +??#???????????.? 3,1,7,1 +???##.#????#?#??. 5,1,4 +??????.????. 3,3 +#?#??.???????? 1,3,2,1 +?.???..?..# 2,1,1 +???#??????#?? 6,1,3 +#?????.#????## 1,2,7 +????????????#?#??? 3,2,5 +#??.?.?????#? 1,1,1,2 +?.##??????#????.#??? 1,12,1,2 +?????.????#???? 1,1,1,3,1 +?#?...#?.??##??#? 2,1,6 +.???.#.#?#..?? 2,1,3,1 +.????#.?.????? 5,3 +.????.???? 1,3 +.?#???????#?#.??? 4,6,1 +????##.???.? 6,2 +???#???.?##??? 7,3 +???#?.????.????##### 3,1,1,2,6 +.????????.??? 4,1,1 +?#??.???.??. 4,1,1,1 +?#.#??.?#????#?????? 2,2,2,2,3,2 +?.#???.???? 4,1 +##????..??##??#????? 2,1,11 +???###?????##.?#?? 12,3 +???#????.?????? 7,1,2 +???.???#????????? 1,6,3,1 +???.??.???#??#..?? 1,1,1,3,1,1 +..#.??.??#. 1,1,2 +.????????????????? 3,4,4 +????.??...??#. 1,1,1,1 +??????#???#??????#?? 1,1,8,2,2 +??#???##????? 2,4,2 +#.????#??????? 1,1,6 +.?#?#?.????????#? 1,2,8 +.???.????. 2,2 +?????##?##????..#??? 11,2,3 +.?#????#????.? 1,1,5,1 +.???#???#?##?# 3,6 +#??????#???#??? 8,2,1 +?#????.???? 5,2 +???.?##?????..##??? 2,6,1,5 +#???.#??#???#??? 3,2,1,2,1 +???.?##???. 2,3 +##???.???#.??? 4,1,2,1 +?.#?#??###????????#? 1,1,9,2,2 +?????##?#???. 1,1,8 +?#????????.?????? 8,2,1 +?.#.#?..#??? 1,1,2,1 +???.??####..??? 1,6,1 +???.#?#????##?#. 3,1,2,4 +???????##???#??#???? 1,1,3,8 +.?#???##?????????? 9,4 +?.###????#????##?? 5,9 +????##?#????? 1,3,1,2 +???.??##?#?#??.#. 3,7,1 +..?????.?. 4,1 +???.?#??#??##????. 2,1,1,2,1,1 +?#?#??#???#? 2,2,1,3 +?.#?#????#?? 1,1,4,2 +..??..????.#????? 2,1 +.#?#?#?##???.# 1,3,5,1 +?##?.??.#?.#?????. 3,1,1,2,2 +?????.?.???#??.?.??? 2,1,1,4,1,3 +????#???#?.#? 5,1,1,1 +??????.#??..?#???.## 1,2,1,1,4,2 +?????#?.???..##?#? 1,1,1,1,1,4 +???.??...??????????? 4,2 +??#?#.??#???? 1,3,1,2 +???##???#.??.?? 9,1 +????????#??#??#??# 1,11,1,1 +????????????..? 2,6,1 +?.????#??.? 1,4 +??#?#???### 3,3 +.??##?.#.? 3,1,1 +?###?#?####???????. 16,1 +??#??#?#??.#?? 2,4,2 +???##??#.?. 4,1,1 +.??#????#?##?#??? 1,2,9,1 +???.?#????.?.??#??## 3,3,2,1,6 +.???????#???. 3,1,1,1 +?.?##??.?#?##??#... 3,7 +?????..??#??.? 3,3,1 +.?...?????? 1,1,1 +?#?..#??.???????.?? 1,1,1,1,4,1 +??##.????#?.?????? 3,1,1,4 +#.???#?##??.?#????? 1,9,2,1 +.?.???#??.??####?? 6,4 +?..???.?##??#.???? 1,1,3,1,3 +?.#..?.?#?.#??? 1,1,3,2 +.?.????##.#?? 1,5,2 +#??????#?????#?.?#? 1,1,9,3 +.??#????.???#?? 1,3 +#?.??????? 2,1,1 +??.????????## 2,1,2,3 +?.???????..????????? 6,3 +??????????##???? 1,1,7 +???????.?#?.???##??? 3,3,5 +???.??.???#?##??#?.? 1,11 +#.?#?#??#.??????.? 1,4,1,3,1,1 +?#?.???????.#. 1,3,1,1 +##????.?#.#? 2,1,2,2 +?????#??#????? 7,1 +?.????#???????? 5,2,2 +.??##????? 1,7 +???#??##???.???#??? 8,1,2,1,2 +??????????#?#??#???? 1,1,1,5,2,1 +????????.?# 1,2,2 +?#??.???..#? 3,3,2 +??#?????#??#?. 4,1,5 +?.??#.#??? 1,1,3 +??????#???#????. 2,9 +??#??#??.?#??#??. 1,4,1,2,3 +###?????.??????#? 7,1,1,1 +?.??#?????#.?????# 3,3,1,3,1 +?...?????.????. 1,2,3 +##??#???.?? 3,4 +?#??#??.??#?# 3,1,1,3 +??####?.?? 5,2 +.?#??????##??#??#?? 7,10 +.?#???????.? 5,1 +??.???##????#?#?.#? 1,5,6,1 +??????#??##?##?.? 1,12 +????????????##?. 1,1,4 +??.?#?.??##. 1,2,3 +??#??????.?#? 4,2,1 +.?.??#?#??? 3,1 +?.#?????#??##???#? 1,5,2,3,2 +.#??..?#???#??? 2,8 +#..?????????? 1,9 +?#???..#??? 3,3 +?#??###?#????????.?. 11,2 +.???????.##?#?????## 2,11 +.????.???# 1,1,2 +?.??.???.?. 2,1,1 +???.###??.??# 1,3,1,1 +?.???.#??#??.??.#?? 1,3,6,1,1 +???##???#???????. 1,11,1 +??.??.?????###? 1,2,6 +?#???#?#?????? 1,3,3 +??????????#? 1,3,2 +???#????????#??.. 4,5 +???????#??.?? 5,1 +??.?##???#?????#? 2,4,1,1,1 +#.?.??#?????##? 1,3,2,4 +??????#??#??# 7,4 +?#.?#??#????#??#??? 2,2,2,2,2,1 +???#??.#???.#? 6,1,1,2 +.??????#?. 1,4 +?#?#???#??? 4,2 +?#????.#.??????.?.?. 6,1,4,1,1,1 +#???.??.#.?... 4,1,1,1 +?.??#??#?????###?? 3,10 +??.?????..?.?..?? 1,5,1,1,1 +?#?????.#? 5,2 +??#?.???.#??? 2,1 +??.?.??#????## 1,8 +?#???#.?##? 1,2,3 +?#.??#?#??#. 1,1,1,1 +?????????###?.. 3,6 +?.#??#?????????# 1,3,6 +?????.#.?? 5,1,1 +#?.?#??.#???..?? 1,3,1,1,1 +??????#?.?? 1,4,1 +?.??#?.??.???.?? 3,1,1,1 +#????##??#??.#?#?# 1,7,1,1,3 +????#????.#?#???### 1,2,3,5 +.?##??##????##?.#.? 2,3,4,1 +??#.??#???????# 3,2,3,2 +??????.??.?# 6,1,1 +??????###???#?? 1,7,2 +.?.?#???#????#.? 1,4,3,1,1 +.?#.?.?????#???????? 1,1,11 +?????#????? 4,1 +????.#?#?#????.? 3,8,1 +????????????#?.?? 1,3,1,1,2 +???#.?##?## 1,1,6 +???..?.??###??##??? 2,1,10 +..????#??? 6,1 +.???.????#? 2,2 +????.?#?#. 1,1,1 +#?##????#??.??#. 1,2,4,1 +?#.????##? 1,1,3 +????.???##. 2,4 +??#?????.????#??.? 1,4,1,3,1,1 +.???????????#??# 4,1,4,1 +.???.???????????#?? 1,1,1,2,2,1 +.#????.??? 3,1,1 +.#??#??..??.????? 6,1,1,3 +??#??#???.?#??? 1,4,2,1,2 +????##.??.?##??.? 4,1,5 +.##????????##.????. 12,4 +#????##????#???##.#? 1,1,3,1,6,1 +.??#?????##???#???? 11,4 +??????#.?#?????# 3,1,1,2,4 +##?????..?? 3,2,2 +????.??.#?.## 1,2,1,2 +..?.????.?# 1,4,1 +????.#?..#???.#. 2,2,1,1,1 +#???#..???#??#?? 1,1,6 +?.???###??? 5,1 +?.??????.? 1,5 +????#???????.??????. 2,1,4,3,1 +#?#????#??.# 1,3,2,1 +???#??.??.? 1,2,1 +####??#??#?. 5,2,1 +..?.?.??#?.# 1,1,3,1 +??.?..??#?? 1,1,5 +?????#.?.??#?.??#?## 5,3,6 +??????#????#??.????. 11,1 +???.#?#???#?##?#.. 1,1,10 +?#??#?###.?.???#. 9,2,1 +?????#?.?????? 6,4 +???##????#???##? 3,7 +?????##?##???#..??? 6,6,2 +.?##???#?????? 8,1,1 +????..??#? 1,3 +??.?###????? 4,2 +??..?#..?.? 2,1 +???????#.?##? 1,2,3 +?###??#??????? 5,7 +.????.??#.?#. 3,2,1 +????..??#???## 1,3,3 +???..?????? 1,2,1 +?.????.??.?? 3,1,1 +#???.?#.???? 1,2,2 +#?#???.??#?#.#? 4,1,2,1,1 +.##??#??#??#?. 6,5 +???##???.#???#?. 7,6 +?##?????????#? 2,6,1 +?.?????#???#????? 1,5,3 +.????#???.?#??.?## 3,1,2,1,1,2 +#?#???##????.????.?. 9,4 +?.##.??#??#???? 2,1,1,5 +??..#??##..?? 1,5,1 +????#?#??#?????# 11,2 +???#?.?.???? 1,1,1,1 +???????.????#?#???? 1,1,1,1,1,7 +.?##?.??.?? 2,1 +?##????.?#????#. 5,3,3 +??????#?##? 1,7 +???#?.???.??# 4,1,1 +?..??#..??? 3,2 +?.??##.??#.? 4,1 +?????.???#?????? 1,1 +???#??????? 6,1 +?????#?##..##?? 2,6,4 +?###?#?#.?#?#??##? 5,1,5,3 +?#?#?#?.?????#??? 6,1,5 +.????#?.?.#??????? 2,3,1,1,1,1 +?#??#.??????#.#???#. 1,1,3,1,5 +??#.???##.?? 1,1,3,1 +.##????#???????#? 2,1,1,7 +??#???#????.???.??## 1,2,2,1,1,4 +???##?#?##????? 8,2 +??#?###?????.??. 9,1 +???##?##?#???#? 8,2 +?????#?????#.? 9,1 +??.??##?#? 3,1 +?????.?##?. 2,2 +???.?????#??#?? 2,1,8 +?#?????#???#??#????. 17,1 +????.????? 2,2 +???###..#?? 5,1 +??#?????##??#??#? 3,4,4 +?#??#??.???#?#??.?.? 5,5 +??#??????..??? 6,2,2 +???#???###??? 4,4 +?.?#??.??. 4,1 +.#..?#??????? 1,3,1 +?.?.???.???. 1,1,1,2 +?##?????##?#.??..#? 11,1,1 +.??#????.?.?????#? 2,1,1,2,3 +?.??????#??#?.??? 1,2,2,1,3 +????.?#.#??.?#?#? 4,1,3,4 +??##???#??.??#.?. 4,3,1,3,1 +.??#?#???????#??#. 1,14 +??.??#????????.??? 1,10,1 +?#.??##?#????.??? 2,2,2,1,2 +?????#???.???. 2,1,2,2 +??##??#??.????????#? 1,6,7,1 +??#?##??##???.???? 2,3,3,3 +..??#?#???##??#? 4,6 +?????????. 3,3 +.???#?????????##??.# 1,6,1,6,1 +??????#?##????? 4,1,2,1,1 +?#..?#?.???#??? 1,3,2,1 +?.?.??###?? 1,1,3 +?.??#???.?#?. 4,3 +?.#.??.????. 1,1,1,2 +?????#???#?.???????? 4,2,2,4,2 +???.?.?.#??.???#???? 1,1,1,3,1,6 +?#?#????#?#..? 3,1,4 +#??????.?..??? 3,1,1,1 +??.#???##????#???? 1,1,4,3,1 +????#?#.??##? 5,3 +??.??.?????#??#?? 1,1,2,6 +??.?????###???# 1,9,1 +.??.???###?????????. 7,2 +?????.?.??## 2,1,2 +?.??.#???.?? 1,1,4,2 +#?##??#.????? 7,1,1 +?.###?.##?? 4,3 +??#????.???????#? 7,1,6 +.##.#..???.?????.?? 2,1,1,1,4,1 +??#.???#.?. 2,1 +.??????####?.?.#??.? 1,1,7,2,1 +??#?#????.?.?? 5,1,1,2 +#?.?????###? 1,8 +###????#?? 3,2 +???#???#????#.?? 7,1,1 +??#?#???.?#? 4,3 +#..??#??#??????? 1,2,4,2 +???##??????.?? 7,1 +?#?#.??????????#?. 4,7,2 +#???#???#???????. 12,1 +?#??#??????##??? 1,2,1,5 +???#???#####??..???. 3,7,1 +.????.????#?#?#??? 3,10 +?..##.???????#?? 1,2,1,5 +?.#?##..??.? 1,4,1,1 +?????##?#?#??? 1,9 +?#.??.?#?#?.#? 1,1,3,2 +.##??##?.???? 2,3,2 +???#?.???..?#??????. 4,1,2,1,1,1 +..#?##?##??#???.??? 12,2 +?????#.?.??.?.. 1,4,1,1 +?.?.?#??.?????##?? 1,2,1,1,3,1 +??#?##?#??#???## 6,1,2,2 +??????#??#.???#??.. 1,8,2,3 +?.??##??#????.#?#? 1,5,1,1,1 +?#???##???#???#????? 1,5,10 +.????#?##.??#???. 4,3 +..??#.????????????? 2,5 +..#???##?.? 1,3 +.??#???..??? 4,1 +?#?#????#????..##? 4,7,2 +.?#?##???#???.?.?#?? 12,2 +##?..##??#??.??.? 3,6,1 +?..???#?#???????#??? 1,1,4,1,2,4 +#?#??##?????#?. 1,6,2 +.?.#?#????????? 1,3,3,2 +????.??#??#???##?#? 3,13 +??##.?.???.?. 3,1,1 +?#?#????????#?.#. 2,4,2,1,1 +.#?#?.????# 4,4 +????..???# 3,1,1 +.????.????????.???? 3,1,2 +???#???#?????#?????# 1,15,1 +..#?.?????#??? 2,5,1 +#.?.?.?##.?? 1,2 +??.??#.????##?..?? 1,1,1,4,1 +????????.??? 5,3 +#?.##?.?#? 1,3,1 +?????..##? 2,2 +#???#?????.??.????? 1,3,1,1,3 +???.#???#??#?????#? 3,11,1 +??####??#.#?#?? 6,1,3 +.??#?????.?.##??#?#? 4,7 +.??.?#?.??????? 1,2,2,1 +?.????..#????. 2,4 +?????.???.?#??#?#? 2,1,1,7 +##??????#? 2,2,3 +#.??#.#.??? 1,2,1 +??..????????? 1,2,1 +???..?#.?. 2,1 +?###?????##?????.. 4,4,3 +??#??????..????? 1,1,1,1,3 +#????????#??#??#. 3,1,9 +.?#????#?#.??? 3,3 +???##????.#?? 1,6,2 +?#?#?...?.???#???? 4,1,3 +#???#?#????#??#.??# 3,1,1,5,1,1 +?#???????#????? 2,2,2,1 +????#??#??????? 12,1 +#???#??#?.#?#. 5,1,3 +.??###????##?##??. 4,8 +??????..????.??#??? 4,2 +?#??.????.??#..#???? 2,1,3,3,4 +.#???#??#?..?? 2,3,1,2 +?#????..???.#??? 3,2,1,1,1 +????#???..?? 1,3,1,1 +?#?????##?#.??.#.? 1,1,6,2,1,1 +????.?.#.? 3,1 +?#????#??#??????.?.. 12,1,1 +?.??##???#????. 1,1,10 +#????.??##???? 1,1,6 +???#?.??##?#? 1,2,1,5 +???##??#???.????? 3,2,1,1 +?#????.??##??# 3,1,7 +.??????##?#??.### 1,8,3 +#??##??#??#?? 1,10 +?##?#?#???###???.?#? 8,4,1,3 +??.????#?????? 1,9 +???#???????.???#??? 7,6 +?.??#???.????##?. 2,4 +???????#??#.??#? 1,8,2 +??#?????#??#?????. 2,1,8 +???..?#?.?.###? 1,3,1,3 +.?????#????###?..?? 4,9,2 +????#?#?#.?#????##. 6,3,3 +?.#?#???.????# 1,5,1,1 +..##?.?#?.?????? 2,2,1,1 +?###??#??.????.? 5,1,1,1,1 +.?###?#?#?##? 7,2 +?#??#??????#?###? 1,1,2,8 +.???#?.??.#..????? 4,1,1,1,1,1 +.??#?????????? 3,1,4 +.?????#..#??? 5,4 +.#.???#???#.? 1,1,1,1 +.?##??#???###?#??? 15,1 +??#.?????????.?? 1,2,4,2 +##???????#???.?? 2,9,1 +#?#.??.??#???.#.?#. 1,1,1,5,1,2 +??#?.?#?.??? 2,2,1 +?##???##.?.??#???#?? 7,3,2 +???.???##????????.?# 2,8,1,1,2 +.???.?.??. 2,1 +??.???#??#?##??? 1,1,7,1 +??#.??????? 1,1,2 +??????.?.?# 1,1,2 +??.??#?.?? 3,1 +#??.?#?????? 1,3,1 +?.??#??..???.???? 5,1,1,2 +.?#?..#?????.? 2,4 +#??#?#????.?..? 8,1 +#?##.##.????. 4,2,2,1 +.?##?????##?? 2,3,3 +#?????????#?#? 4,3,4 +?????#?###??# 1,1,6,1 +????#???#?#?#?##??#? 3,1,9 +?.????????. 2,1 +?.???..?????. 1,1,1,1 +#?.??#?.##????.?? 1,2,3,1,1 +??#???.#??.?#?#.. 3,2,4 +.???##??##???..??#. 4,3,1,1,1 +.?.#???#??????#??#?? 1,5,1,1,1,1 +?.?????.??.??#? 2,1,3 +##?##????????.. 6,1,1,1 +??????.?.#????? 3,1,1,2,2 +??#?.????? 2,3 +.????.????? 3,1,1 +..???.#..?#?. 3,1,1 +#?##????#? 5,3 +#????#?.???...#? 6,3,1 +.??.?#???#??#????? 3,9 +?.?#???#???#??. 2,7 +.??????#????#?#??## 1,1,14 +??#??.???? 3,4 +??#????##????##?? 2,9 +???#??#???...? 2,5,1 +?????..?#.??? 1,1,2,1 +????###?...##?#?. 7,5 +#????#??????.?#??#? 1,7,1,2 +???##?#?#??#?? 5,2,2 +#???..????#..#????? 4,1,1,1,1,1 +???????????#??#. 2,8 +#???#????##??????# 1,1,1,1,7,1 +???....?????.??#???? 2,4,5 +?#?.?????. 1,4 +?..##?.???#??# 1,3,1,5 +?#???????.? 4,3 +??.?.????#???? 1,1,2,4 +#?##?##??.?#?? 4,2,3 +???#????.#??#. 5,1,1,1 +??????????? 1,1,2 +???????##?#?##???# 1,5,4,1,1 +.?#?##.?????? 5,1,1,1 +.#???.?.#?# 1,2,3 +?#.?#????.?????? 1,4,2,2 +#?#.#??????#???#???? 1,1,4,1,3,2 +?????????##? 4,6 +??.??????#??.?????? 1,2,1,3,1,1 +.??.#????#???#.? 1,2,5,1 +??#.???#?.#?.#?#??#? 2,2,1,2,6 +..?.???????? 1,3,1,1 +??#???#?????.??#? 4,4,1,4 +.?####???.???? 6,1 +????????#?.??????? 1,8,1,2 +???#?????#.??.#??. 1,1,1,1,1,3 +??.???..?? 1,1,1 +??????.?#???.???? 5,3,4 +????#????????? 2,4,4 +?##??.???????#.? 5,3 +.?##?#???##?#???#??? 7,4,3,1 +?????##.??# 1,3,1 +.?#?????.???#...?? 1,2,3 +?..#.???????#.. 1,6 +???#???#?? 1,2,1 +.???.?????????#? 2,1,1,1,2 +?????#.?.?#?. 6,1 +..#?.?#?.#??? 1,2,3 +???.?#????#?###.?? 1,11 +.?#?#.#?.??.????#?. 1,1,2,2,2,1 +??#?????###???##.#? 4,5,2,1 +?.#?????#??#??.???? 1,1,9,2 +????#?.#?.?? 1,3,1,1 +#???#.???.??? 1,1,3,1 +???##.?.????? 4,4 +????##?##??#?#?#???. 3,9,2 +?..?#?#.?.?????.?..? 1,3,1,5,1,1 +.??.?..???? 2,1,3 +.?###..??#?? 4,3 +.##???????? 2,4 +?#.?#?#?#?#? 1,3,1,1 +??#??.???? 3,3 +??????#.???##?#??#?? 7,3,1,2 +??#?##?#?##?????#?#? 14,3 +??.#???..#?#??????? 2,2,1,10 +?????#?###????#.. 2,7,3 +?.?????#?#?.?? 1,5 +?????????.??#???# 8,1,1,3 +#??###???#?????? 7,2,1,2 +??#??#?#?.???? 2,4,1,2 +.??#?.??.###???#???? 2,9 +.##.?#??????#.#???# 2,4,1,2,2 +?.#???????#????#?## 1,1,8,1,2 +???????##???.?? 2,8 +??????#??.?.?????? 1,5,1,1,1,1 +#???.##??????##? 1,10 +???.?????.????.# 1,1,5,2,1 +#?????.?##?. 1,2,1,3 +???#?.#?.#??##?. 2,1,1,4 +????#.?.??????? 2,2,1,3,1 +#.????????? 1,7 +#?????#..??##?#. 1,3,4,1 +?????.###?#?.#?????? 2,1,5,3,1,1 +.?????#??????????#. 1,4,1,1,1,1 +??.??#.???#?????? 1,2,2,3,3 +???#???##??#.?#??#? 2,1,4,1,4 +??.?##?.?#??????##?. 1,3,9 +.???#??#?# 1,3 +?????????#??. 2,2,4 +??###??#??????? 8,1,1 +?#???????#..#?#??? 6,1,1,3,2 +?.??????#?#?#??.#??? 1,1,1,9,1,1 +?#???#????.?.???.#? 8,1,1,1,2 +#?###?????????# 8,1,1,1 +?#??#?.#?..??##?? 6,2,3 +#??????##.??.?# 3,3,2 +.???.??.#??? 1,3 +?.????????? 1,1 +??#?????.?#?. 1,6,2 +??#???.?...#. 3,1 +?.?###?#??. 1,5,1 +.?.???????#????#???# 1,1,10,1 +?.#?#?#?#?????.. 3,8 +.????#?.??. 1,2,1 +.#?#..??#?#..#?.# 3,1,3,2,1 +#??#???#????##????? 9,8 +?.#?##?????? 1,5,1,1 +.?#####?#.?.#???.?? 6,1,1,2,1,1 +???????.?? 4,1 +??????????.???????? 6,1,1 +?#?.???##????#???## 1,8,2 +?.???.????#??#?#??#? 1,1,1,1,9 +??#????.?#.? 4,2 +?.?.#??##?. 1,6 +.?????.#.? 1,1,1 +??#???.?#??#? 1,1,3,1 +???????.#.#??. 1,2,1,3 +?#????####??#?????? 1,1,9,1,1 +.???.?#??.??.#?? 2,4,1,1 +?.??????#? 3,4 +?????.#????..???. 2,1,3,1,1 +.?????..???. 1,2 +??#??.????? 1,2 +#?#??.?.????#?? 5,1,1,1,1 +??##?.??#?.? 4,1 +.??#???#..??? 3,1,1,1 +??.?.??#??##?#????# 1,1,7,6 +?#?#???????.??##???? 3,2,2,5 +??.??#?#.. 1,4 +.???.????#??#????# 1,2,9 +??????#.????..??? 2,1,1,3,1 +?.#.?????#? 1,2,1 +???#.#?.#???#? 3,1,6 +???????.?? 3,1,2 +??????????????#??## 1,1,6,1,2 +???###?.??#?#??.?#? 6,1,1,1,1,1 +.?????#??.?? 4,1 +??#.?#?##??.??.??? 3,7,1,1 +?.?????#?.#?.? 1,6,1,1 +????.#?##???#? 1,4,1 +??#???##??#?????? 6,6 +##??#????????????. 7,6,2 +#.?.?????##???.???? 1,3,6,1 +?##???.????.?.?? 3,1,2,1,2 +.?#??????.? 3,2 +??#??????????#?##?? 4,6 +?????.#?????????? 4,1,7,1 +??????.???#? 1,3,1,1 +#??#??#??#??#?#??? 5,1,1,4,1 +.??###???#?????..#? 13,1 +??.#?#???#?##? 1,10 +????#??#.?..? 3,1,1,1 +??#??.?????? 4,4 +????#?#??????#?.?. 4,5 +#?.????????#. 2,1,1,2 +.??##?????.?..?????? 8,5 +??????????.??#?#??.? 1,1,3,4 +?????#?##?????? 1,11 +.??#.??#?? 3,3 +?..#.??#?# 1,5 +???.????.#???.?? 3,1,1,3,2 +?#????#??????#?#. 8,1,4 +?##?.??????? 3,1,4 +????????????##?#??.. 2,6,5 +??##??.?#?#?. 5,3 +???.??.##??? 1,1,2,2 +.?#??.?#?. 2,3 +???????????? 1,4,1 +????#???#??#?#???#. 2,1,10 +?#.?#??.?..##?.#.#. 2,3,3,1,1 +??##??#??. 2,1,1 +.#????#?.?#?# 3,3,4 +?.?..?#????#????? 1,1,8,1,1 +?????.???????###???. 1,3,13 +?#?#?????. 4,1 +????##????#?.# 11,1 +..#?#?#??.??? 6,1 +#???.????#?#.?#? 1,2,6,1 +#?..?.???#?#??? 2,1,6 +.?#?#?#.???#??#.? 6,5 +?.#???????.?? 1,4,1 +??##?##???#.. 7,1 +??#?.??????# 4,1,2 +##.#????#??.# 2,7,1 +??##???????.#?. 5,2,2,2 +?.?????.??###??#???? 2,10 +??#??#?.??.??? 4,1,1,1 +?.???#????##?? 1,3,5 +?#?????.???????#.# 2,1,1,8,1 +??#?????###? 3,1,5 +?????..#??????# 4,6,1 +???..????#.?????# 3,1,1,2,1 +??#.???#???#?? 1,1,9 +??.#???#..#?..? 1,5,1,1 +?..??????.? 1,2,1 +?????.?????#??? 2,1,3,1,1 +.??????????.??.. 5,3,2 +#????????..#???????# 1,5,9 +??.#????#?? 1,2,1 +?????.???#????#??.?. 1,11 +??##??#??.?.??#.?.?. 8,3 +???.??????????##? 2,1,6,3 +?##??#??.??#? 3,1,1,1 +?#?#???#????#?? 3,3,4 +#??.?????#.?.??. 1,1,2,1,2 +?????????????#??.## 10,1,1,2 +?????.???? 3,4 +..#???#?#? 1,5 +????.##???#?? 1,3,1,1 +?.#?.????. 1,1 +.???.???#?.? 1,1,2,1 +?????#?.#???.# 5,2,1 +????#.?.???#?#???#?# 2,2,2,1,7 +?#.??#.?#??#?????. 2,2,2,3,1 +??#???##.?? 7,1 +.??????#??#.?.? 1,1,1,2,1 +??????????? 2,4 +..???.#.????? 1,1,1,1 +?##???#?????#?#.? 4,8,1 +??.?????????#??. 3,7 +.??##??#???#.?????# 7,1,1,2 +#??????#?.#. 1,2,1,1 +#??????????#? 6,1,2 +..??#??.??#?#????? 4,3 +??##?.?.?## 2,2 +???.?#???#?? 1,2,3 +?#????.?..?#??.#??? 5,2,2 +?#?.???#?????.. 2,7 +??#?.??.???????#??. 2,10 +#?#???#????#???.? 3,3,2,1,1 +.??.#??????? 1,8 +.?..???#???#???#### 1,1,12 +#????#??##? 2,3,3 +#??.???#???# 1,1,7 +???#??###?#????#?#? 1,1,4,8 +??..??.?????#.?? 1,1,6,2 +?????????????.???? 3,2,1,3,1 +?###??#?????? 10,1 +.?.?.?#??? 1,3 +??#?..?????.#??#??? 2,1,1,1,4,1 +#.?.?#?.?? 1,1,1 +??#??????. 1,1,3 +.#???..?.??? 3,1 +??????????#??#?.?? 2,4,3,3,1 +#?##.?????????#???.? 4,6 +??#???.##???##? 1,1,1,7 +##?#?.??.????????# 2,1,1,1,4,1 +?#??..#?.???.#?? 1,1,1,2,2 +???..???..??#???? 2,1,5,1 +???#?????#. 1,2,4 +?.???#.?#. 4,2 +????#????#?????? 6,6 +#?#?##???.#..?.##.?? 9,1,1,2,2 +..?###.??#?????. 4,4 +.?#????#.#?## 3,2,4 +??.???.#??#?#???? 1,3,6,1,1 +?..?#????.?#.??? 1,6,1,3 +?????#.??##????.#? 1,1,1,4,3,2 +????#???#??? 2,5 +.#??#.???.? 4,1 +??#??.?????????? 1,1,1,4 +???##??.?????????.?? 6,2,2,2,1 +??.????#?# 1,1,4 +?#?#..????#??#?. 3,4,2 +?#?.???????##????? 2,13 +.??.?.?.#?.? 1,1,1,1 +?##?????.???#?.? 4,2 +???#???.??#????# 6,7 +????..??.?? 3,2,2 +???.????.#?.? 1,4,1,1 +?.??#.#???#????#?.? 1,1,6,3,1 +#.#???#??.????.. 1,7,1,1 +.?#?.?.??##?.#??? 3,1,5,1,1 +.????.#.?????#?????? 1,2,1,4,5,1 +#?????#?????????? 1,9,1,1 +??.?#???????? 3,5 +?#???##??.#. 2,3,1 +????????#?#??????.?? 12,1,1,2 +#?#?##????.??.??? 1,8,1,2 +.??#.??#??.? 3,2 +????#??#?.? 2,2 +??#..#????.#???#?? 2,5,1,4 +???##?#?????.? 6,4 +#.#.??.????#???. 1,1,2,5,1 +???#??#??..????#.??? 6,4 +??#?.#.#??????#.##?? 3,1,4,3,4 +.?..???#????# 1,7 +?????.?#.??? 5,2 +????##..?#?.?#? 6,2,2 +?#??????#?. 3,1,1 +?.??##?.#?????#?#??? 3,12 +?.?????????????#?? 1,1,10 +?????.#????#.#?? 1,1,6,1,1 +##??.?#??.?. 4,4 +??????#??#??#???.# 2,1,7,1 +??#?????.? 2,1 +#??..?#??#???????#?? 1,1,2,10 +???#????#???#?. 1,11 +?.???##?.#???#.??? 1,1,4,3,1,1 +##.?????#?? 2,2,2 +???.#???#?.??##??? 2,1,2,6 +??????.?#??.??# 1,2,4,1,1 +.?#????.?#? 4,2 +??.??#???? 2,6 +??????????..??.. 6,2,1 +?#.?????##? 1,7 +#?????????? 1,6,1 +?.???.???????#? 1,9 +??#???.?.?. 1,1 +??#??????????? 1,6,1 +.???#??#??????? 5,2 +??#??????##????.?? 13,1 +?#?.#?????##??#? 2,1,1,6 +?.#???.??? 2,2 +.???#??#?#??#?#?? 1,7,4 +##???#?????.#???? 2,8,1,2 +??##.????..? 4,1,1,1 +#????#?##?#??? 1,11 +????.?#.??????#?.?? 2,2,5,2,1 +?.??#????? 1,4 +#?.#????????.?? 1,3,1,2,1 +##???#??.?..???.?? 8,1,2,2 +?????#?##? 2,5 +????.???#???.?#.?. 3,1,4,2,1 +..#?.##???????##?? 1,6,1,3 +??.?#????#??#. 3,5 +..?#?????#?.##??##?# 4,1,1,8 +??..??#????? 2,2,2 +?????..????.? 3,1,1 +????##...??#??.?.## 5,5,2 +#??#.?????????. 4,7 +?????.????? 1,2,4 +?#???#.???# 2,2,4 +??????????.. 1,3 +.??.???#????. 1,2,3 +.??#?.?.?? 1,1,1 +?????.????#??.##???. 1,2,1,4,3,1 +?#?????????.?????? 9,4 +.???#?..?#???.. 3,4 +??.?#?????#???# 2,1,2,1,1 +?.???.#???# 1,5 +???????#.?.? 4,1,1,1 +?????#???? 2,3 +????????#?.? 1,1,2 +??.??#??#?# 1,6,1 +.#?#??#???????##?.. 1,6,6 +#???..????? 1,2,1 +?##??##..??#??### 2,3,2,3 +#??#??.?.??? 1,3,1,2 +??##??...# 2,1,1 +#??????#???#???##.?? 4,1,1,2,4,1 +?.??#..??# 1,3,3 +?..?#???????? 1,2,1,2 +???.?.???? 3,3 +?###?.#.?.??..#???. 5,1,2,1,1 +???#??#?#??#?.???? 12,1 +??#????#????..#??#? 10,1,5 +??????##?.? 1,1,2 +??#.#..??? 3,1,2 +#????###??#??##??#? 1,1,5,1,2,2 +?????.#??#???#?. 1,8 +.??#???#??????????? 7,5 +??..?#?#?#????.??.? 9,2 +.?.????##??#?#???# 1,12,1 +#?????.????#??# 2,1,1,3,1 +??##???#?#??? 4,1,2 +????.?#??? 1,2,1 +???..#.?##?.?#????? 1,1,3,7 +?..?#?.??##????##.# 1,3,1,4,2,1 +????????.####? 5,1,5 +#?#??????##?. 7,2 +.???#????#??????. 1,11 +?#?.??#?##??????? 2,5,4 +???#??.#??###??.??? 6,8,2 +.??#????#?#?????? 8,3 +??##????###?##. 4,7 +???.?#???????#??.. 2,1,3,4 +?.??##??.??. 5,1 +?..#??..????#?#. 2,5,1 +?????#??##???#?? 1,11,1 +?##?##???? 2,6 +???##??????###??.??. 7,3,2 +????#??##?#?#. 4,4,1 +?????????#??? 1,1,4 +??##?.?#??? 5,2,1 +.??..???#? 1,3 +?#????????#???.. 4,1,2,1 +.#??#?..#???????#??. 1,1,5,3 +??#?#.???### 2,1,1,3 +.???#.????? 4,1 +????????????? 1,1,3,3 +?????#?.???#???? 1,2,1,1,6 +#??????.????#?? 5,2,3 +??????##???#?.??#?? 9,2 +??#.#??.??. 1,1,2 +???#?.?.?. 1,2,1 +##???.?### 4,4 +#.?#?#??????. 1,4,1 +??#?.???#.??.? 2,3,1 +??#?##??????..?#??. 11,2 +???##??###.???.???? 10,1,1,1 +?#???#?.?.#?#?#?#??? 2,2,1,7,1 +????????#.####??#?? 1,2,1,1,9 +.###..??.? 3,1,1 +??.?##?.?????# 2,4,2 +?.?????#?????#?#?.?. 7,5 +????..?..#??? 1,1,2,1 +???#????####??.?# 2,9,1 +?????????. 4,2 +?##?..?.?? 3,2 +..???.?#????#?. 2,7 +.?#.??#??..?#.#?#.? 2,5,2,3 +#?##????.??..?? 4,2,1,1 +???###.?#??.??## 3,2,4 +?##?#.#???# 5,2,1 +???.??##??#.???#? 1,1,5,4 +???..?#?#???# 1,2,2,2 +?.?#????#???? 1,2,4,1 +?#?.#?.?.#?? 1,2,1,1 +??????..??????? 4,3 +?##.??????.?#.???#?? 3,1,3,1,1,3 +?#??#??.??????? 1,4,5 +?????##???.?????.??? 3,3,1,5,2 +.?.?.??????? 1,2,1,2 +??..?#??.???????? 3,3 +.?.?.?.#?#.??#???? 1,1,1,3,4,2 +?#?.#???..???# 2,1,2,4 +??#????###????# 2,7,1 +?#???#????#???#??. 1,1,12 +?#??.?.#???##??#?#. 3,11 +???.????##?. 1,5 +.?..?.???? 1,1,2 +??#??####??????#?? 7,6 +??#..????????.? 1,6 +?????#???????#?. 3,7 +???#??????##?. 1,5 +.?????.???#? 1,1,4 +??##???.?? 5,1 +????.#???? 1,1,2 +.??????#.#????? 2,3,2,1 +?#?.?#??##?? 3,6 +#?#??#??.##??????. 4,2,2,5 +?????.?#?#?.?#.. 3,5,1 +??.?#???#??#?#??.??? 1,2,4,3,2 +?#??#???.?#?? 1,3,3 +??#??????? 3,2,1 +??????.??.?.?.??? 3,1,1 +?????????????#??? 10,1,1,1 +.?#???##???#.? 3,7 +???#.???#?? 1,1,4 +??#???.??.????. 6,2,1 +?????#??.??..#??#.?? 2,4 +??.??#??##.?.?# 2,3,2,1,2 +???#?#??.?##??? 6,5