advent-of-code

Perserverance, or the lack thereof

git clone git://git.shimmy1996.com/advent-of-code.git
commit 4118813ce11ef321a27230231c8e4276934215e8
parent e6795db3a88bdc123df78d42ae8cfe7508722e23
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Thu, 14 Dec 2023 01:24:35 -0500

Add 2023 day 13

Diffstat:
A2023/day13/day13.scm | 93+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A2023/day13/input.txt | 1387+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 1480 insertions(+), 0 deletions(-)
diff --git a/2023/day13/day13.scm b/2023/day13/day13.scm
@@ -0,0 +1,93 @@
+(use-modules (ice-9 popen))
+(use-modules (ice-9 rdelim))
+(use-modules (ice-9 format))
+(use-modules (srfi srfi-1))
+
+(define (parse-input filename)
+  (let ((file (open-input-file filename))
+        (maps '())
+        (curr '()))
+    (while #t
+           (let ((line (car (%read-line file))))
+             (if (eof-object? line)
+                 (break)
+                 (if (equal? line "")
+                     (begin
+                       (set! maps (cons (reverse curr) maps))
+                       (set! curr '()))
+                     (set! curr (cons (string->list line) curr))))))
+    (if (> (length curr) 0)
+        (set! maps (cons (reverse curr) maps)))
+    (reverse maps)))
+
+(define (diff-col map a b)
+  (let ((diff 0))
+    (do ((i 0 (1+ i))) ((>= i (length map)))
+      (if (not (equal? (list-ref (list-ref map i) a)
+                       (list-ref (list-ref map i) b)))
+          (set! diff (1+ diff))))
+    diff))
+
+(define (diff-row map a b)
+  (let ((diff 0))
+    (do ((i 0 (1+ i))) ((>= i (length (car map))))
+      (if (not (equal? (list-ref (list-ref map a) i)
+                       (list-ref (list-ref map b) i)))
+          (set! diff (1+ diff))))
+    diff))
+
+(define (has-mirror-col map a tol)
+  (let ((diff-tot 0)
+        (left a)
+        (right (1+ a))
+        (x-min 0)
+        (x-max (1- (length (car map)))))
+    (do ((left a (1- left))
+         (right (1+ a) (1+ right)))
+        ((or (> diff-tot tol) (< left x-min) (> right x-max))
+         #t)
+      (set! diff-tot (+ diff-tot (diff-col map left right))))
+    (= diff-tot tol)))
+
+(define (has-mirror-row map a tol)
+  (let ((diff-tot 0)
+        (up a)
+        (down (1+ a))
+        (y-min 0)
+        (y-max (1- (length map))))
+    (do ((up a (1- up))
+         (down (1+ a) (1+ down)))
+        ((or (> diff-tot tol) (< up y-min) (> down y-max))
+         #t)
+      (set! diff-tot (+ diff-tot (diff-row map up down))))
+    (= diff-tot tol)))
+
+(define (find-reflection map tol)
+  (let ((mirror-col #nil)
+        (mirror-row #nil)
+        (col-max (- (length (car map)) 2))
+        (row-max (- (length map) 2)))
+    (do ((i 0 (1+ i)))
+        ((or (not (null? mirror-col)) (> i col-max)))
+      (if (has-mirror-col map i tol)
+          (set! mirror-col i)))
+    (if (null? mirror-col)
+        (begin
+          (do ((i 0 (1+ i)))
+              ((or (not (null? mirror-row)) (> i row-max)))
+            (if (has-mirror-row map i tol)
+                (set! mirror-row i)))
+          (* 100 (1+ mirror-row)))
+        (1+ mirror-col))))
+
+(let* ((maps (parse-input "input.txt"))
+       (scores-1 (map (lambda (x) (find-reflection x 0)) maps))
+       (tot-1 (fold + 0 scores-1))
+       (scores-2 (map (lambda (x) (find-reflection x 1)) maps))
+       (tot-2 (fold + 0 scores-2)))
+  ;; 40006
+  (format #t "Part 1: ~d" tot-1)
+  (newline)
+  ;; 28627
+  (format #t "Part 2: ~d" tot-2)
+  (newline))
diff --git a/2023/day13/input.txt b/2023/day13/input.txt
@@ -0,0 +1,1387 @@
+.#..#......
+..#.#......
+..#...#....
+#.##...####
+.#..#..####
+#.#.##.####
+###..#.#..#
+
+.#.##.#.###
+..####..##.
+#########..
+.##..##..##
+.##..##..##
+#########..
+..####..##.
+.#.##.#.###
+#.#..#.##.#
+..#####.###
+...##.....#
+..#..#..#..
+...##...#..
+
+..##.#.
+#...###
+#...###
+..##.##
+..#..#.
+....##.
+#.#.#..
+.#...##
+##.#...
+###.###
+###.###
+##.#...
+.#...##
+
+#.#.###
+..##.##
+...####
+##....#
+##....#
+...####
+..##.##
+#.#.###
+#.#####
+....##.
+.#...#.
+#.#####
+#....##
+#..##.#
+#..##.#
+#..#.##
+#.#####
+
+###...#...#.#..
+.#.##.#.....#..
+..###..#..#....
+..###..#..#....
+.#.##.#........
+###...#...#.#..
+###..#..##.#.##
+
+##.#.....
+##.#...#.
+..#.#..##
+..##....#
+#..#....#
+#.#..##..
+#.#..##..
+#..#....#
+..##....#
+..#.#..##
+##.#...#.
+##.#.....
+#.#..#.#.
+
+#..#..#..#.##
+..........###
+..........###
+#..#..#..#.##
+###....####.#
+....##......#
+##..##..##..#
+###....####..
+....##.....##
+.#......#.#.#
+.##....##..##
+..#.##.#....#
+####..######.
+.##..#.##.###
+..##..##...#.
+
+..#.###..#.
+####.#.....
+..#.##.##..
+...##...#.#
+###.#......
+#######.###
+..#.#...###
+###.###.##.
+###..#...##
+##....##.#.
+####...#.##
+..###......
+.###..#.#..
+##.##..#.#.
+##.##..#.#.
+
+#.##.###......#
+.#..#.#..##..##
+..##..#.#..#...
+#....##.#.#.#..
+#....##.######.
+######....###.#
+#.##.#...##.##.
+..##..#####.###
+..##..######..#
+..##..######..#
+..##..#####.###
+#.##.#...##.##.
+######....###.#
+#....##.######.
+#....##...#.#..
+
+......#....#...
+.####...##...#.
+######..##..###
+######..##..###
+......##..##...
+.####.######.##
+.#..#.######.#.
+
+#############..##
+.########...###.#
+.########...#.#.#
+#.##..##.###..##.
+..#.##.#....#.#..
+..#....#...####..
+#.#....#.##.#.#..
+.#......#......##
+.#......#......##
+#.#....#.##.#.##.
+..#....#...####..
+
+...#.###.#.
+....##.#.##
+..##..#.###
+..##..#.###
+....##.#.##
+...#.###.#.
+#.#.#.#.#..
+...##.#..##
+.#.####...#
+.#.#.##...#
+...##.#..##
+#.#.#.#.#..
+...#.###.#.
+....##.#.##
+..##..#.###
+
+.#.##.#.#.#..#.
+.........######
+###..####.#..#.
+##.##.##.......
+..#..#..##....#
+.#.##.#...####.
+##.....#..####.
+..####..#..##..
+##....##...##..
+
+....####.####..
+.#..####.####..
+#.#.##..#####..
+##..#.#.#######
+.#.#.##.##.##..
+..##..#.##..#..
+####....#...#..
+..#.#....##.#..
+#..#..#..##.#..
+.#.......#.####
+..........##...
+#.....####.#.##
+##....##....###
+.....#.##.#####
+.#..#.##....#..
+#.....###...#..
+#....##........
+
+#..##..#....###
+#..#.#......###
+.....#..####...
+.##.##.##...###
+.....##.###..##
+.##..##....#.#.
+.##...#.#.#.#..
+
+.###.....##
+..#......#.
+..####.####
+#.##...#.#.
+#..#...####
+##.#.#..###
+##.#.#..###
+#..#...####
+#.##...#.#.
+..####.####
+..#......#.
+.###.....##
+.#.##.#..#.
+..#...###..
+..#...###..
+.#.#..#..#.
+.###.....##
+
+###..##
+...####
+.#..#.#
+#.##...
+#...#..
+#...#..
+#.##...
+
+..#......#.....
+#.#......#.#..#
+.#..####..#....
+.#.#....#.#.##.
+..########..##.
+..#.####.#.....
+..###..###..##.
+#..######..####
+.#####.####.##.
+#..#....#..#..#
+##........##..#
+.....##.....##.
+.##.#..#.##....
+
+...#.##
+...#...
+#..####
+#..####
+...#...
+...#.##
+#.###.#
+.##.#.#
+.#.###.
+.##.##.
+.##..#.
+.#.###.
+.##.#.#
+
+..#...##.
+..###..##
+...##.#..
+###.#.##.
+..##..##.
+###..###.
+..#.#.#..
+####..#..
+...#####.
+##.####..
+###.#..##
+..#######
+..#######
+###.#...#
+##.####..
+...#####.
+####..#..
+
+.##...##.
+#..##..#.
+###..####
+#..##.##.
+.##..##..
+#..###.##
+.##.##.##
+....##.##
+.##.##..#
+.##.##...
+.##.##...
+.##.##..#
+....##.##
+
+#...#.##.##..#.##
+##..#.###...#####
+##..#.###...###.#
+#...#.##.##..#.##
+...#.....###..##.
+..####.#.#.####.#
+..####.#.#.####.#
+...#.....###..##.
+#...#.##.##..#.##
+
+.##..####.#####
+.##..####.####.
+.##.#.##..#.###
+#..#.######.#.#
+.#....##..##...
+##..#.####..##.
+.....#......##.
+##..##..#.#.###
+...##..#.#.#.#.
+...#..##.###...
+...#..##.###...
+
+#..##.#.#.#
+######..##.
+#..#...#..#
+#..#...#..#
+######..##.
+#..##.#.#.#
+#..#..##..#
+#...##.#.##
+######.##.#
+....#..####
+####..##.#.
+
+##.##..##.#.##.#.
+....##.###..##..#
+.##.#.##..######.
+.##.#.##..######.
+....##.###..##..#
+##.##..##.#.##.#.
+#####..#...####..
+..##....###.##.##
+.####...##.#..#.#
+.####....#......#
+##..#...#........
+.##.#..#..##...#.
+#####..#.##....##
+#.#.#.#..#.####.#
+##.######........
+
+....#.#..
+....#.##.
+##.##.#..
+##...#.#.
+#.##..###
+#.##..###
+##...#.#.
+
+##....###.####..#
+##....###.####..#
+.#.##.#.....#####
+.######..#.#..#.#
+.######.##.######
+..#..#....####.##
+.######.#.#.###.#
+###########.#.##.
+........##....#..
+##.##.###..#.####
+#......##....###.
+#.....#####...#.#
+###..###.##...##.
+
+#..#...##
+........#
+....##...
+....###..
+........#
+#..#...##
+####.##..
+
+.##..#.
+##....#
+##....#
+.##..#.
+...#.#.
+#####.#
+#####..
+...#.#.
+.##..#.
+
+.##....#.#.##
+#..#.....#...
+.##.....###..
+#..#...##....
+#..#...#...##
+..#.#.#......
+.....#.#..###
+
+#.....###....#.##
+#.##.#.....#...#.
+....#####.#...###
+#...#..#...#.....
+....#...#...####.
+....#.#.#...####.
+#...#..#...#.....
+....#####.#...###
+#.##.#.....#...#.
+#.....###....#.##
+.##.##....#..##..
+...#.#.#..#.#...#
+####...##.##...#.
+.###.....###....#
+.###.....###....#
+
+..##..#...##...
+##..##..#....#.
+......#.#.##.#.
+..##..#.#.##.#.
+#.##.###.####.#
+.####.....##...
+.###..#........
+.#..#.####..###
+##..###...##...
+#.##.####.##.##
+######....##...
+######.##.##.##
+.####.#.#.##.#.
+######..##..##.
+.#..#..########
+#.##.##...##...
+#....##.##..##.
+
+#..#..##.##.....#
+....###.#...##.#.
+##..#.#...###.##.
+##...#..#.#..##.#
+..#.#.....#.#####
+..#.#.....#.#####
+###..#..#.#..##.#
+##..#.#...###.##.
+....###.#...##.#.
+#..#..##.##.....#
+#..#..##.##.....#
+....###.#...##.#.
+##..#.#...###.##.
+###..#..#.#..##.#
+..#.#.....#.#####
+
+##.########.####.
+......#...#.####.
+#.##..###.#######
+##...#.###.##..##
+##...#.###.##..##
+#.##..###.#######
+......#...#.####.
+##.########.####.
+..#####..#.######
+#..###.#.#.#....#
+..#.#....##.####.
+......#.###..#...
+..#...##...#....#
+#...#....##..##..
+.###.#.##.##.##.#
+..#...##.##......
+.##..#.##....##..
+
+.###...#...#.#.
+.###...#...#.#.
+#...#.###..###.
+##.##.#..#.####
+.........#..###
+..##.###..###.#
+.......####....
+####.#.#.#..###
+####.###.#..###
+.......####....
+..##.###..###.#
+
+.#..#..
+.#..#..
+#.#.#..
+.##.#.#
+#..#.##
+..###..
+.#.....
+######.
+#####.#
+#####.#
+######.
+.#..#..
+..###..
+#..#.##
+.##.#.#
+
+#....#.#...##
+######....#..
+..........###
+########.#...
+#...###...###
+##..###....##
+..##...##....
+#....##...#..
+......#.#.#..
+
+##########.#.#.##
+..........#.#.##.
+#..#..#..#..##..#
+..........#.###.#
+..........######.
+.##.##.##.####.#.
+#..####..#####..#
+#..####..##...##.
+..#.##.#...###..#
+#..####..#......#
+####..#######..##
+#..####..##.##.#.
+####..#####..####
+....##.........#.
+.............##..
+
+.#..#.####..#.#..
+####.#...#.......
+#.##.#.#.##..#...
+.........#..#.###
+......#..#.#.##..
+######.#.##...#..
+.####..##.#...###
+
+...##.##.
+.....#.##
+##...#..#
+...##.##.
+..#######
+..#######
+...##.##.
+##...#..#
+.....#.##
+...##.##.
+..####..#
+....#####
+.#.##....
+
+..##....###
+######.#..#
+..##..#.#..
+#######.###
+...#.####..
+##..#.###.#
+##..#...#.#
+###.##..##.
+###.#.#.#.#
+...#...#..#
+###.#.#####
+###..##....
+...#.#....#
+...#.#....#
+###..##....
+###.#.###.#
+...#...#..#
+
+##..####.#.
+##..###.###
+......##.#.
+######...##
+##..##..#.#
+##..###...#
+##..###.###
+#.##.#.####
+......####.
+
+..#.##.##.#
+#.##..####.
+#....#.##.#
+.##....##..
+#..##......
+##.#.......
+#####......
+#.#.#.#..#.
+##..#.####.
+#.#...#..#.
+#.##..###..
+###........
+###.#......
+..###..##..
+..###..##..
+
+####.###.##.#
+......#......
+....##.##.#..
+....#..#.#..#
+#####..#.###.
+.....##...##.
+#####.#.#.#..
+....#......#.
+.....#..#...#
+####.#####.#.
+#####.#..#...
+.##...######.
+.....#.######
+####.#.##...#
+.....##..####
+....###.###.#
+####.####...#
+
+..###....###...
+.##...###......
+#.#..#..###....
+##.##.#...#..##
+#.####.#.##.###
+#.####.#.##.###
+##.##.#...#..##
+#.#..#..###....
+.##...###......
+..###....###...
+#.#..#......###
+....#..##.#.###
+...#.##..#.###.
+.#.####.#.##.##
+.#...##.###.###
+###..#...#...##
+###.#.#........
+
+...##..#.##
+..#..###..#
+##.##.##..#
+..#.#.#....
+##....#.##.
+..#####....
+##..#.##..#
+###...#....
+...#.#.#..#
+...########
+###..##....
+..##.......
+###..#.....
+###.##.....
+###.#.#....
+
+.#.#..#
+#..#..#
+.#.####
+#...##.
+..#....
+##.#..#
+.#.....
+#...##.
+#...##.
+.#.....
+#..#..#
+
+###...##.##..#.#.
+..#.####...#....#
+....#..######....
+....#.....#..#.#.
+....#.....#..#.#.
+....#..######....
+..#.####...#....#
+###..###.##..#.#.
+###..#......#..#.
+##..###.##..#####
+...#...###....#..
+
+.#.....####..##.#
+#.####.##.##.....
+##..###.###.##..#
+...###.##.##.#...
+##.#.#.##.#..#...
+#..#.##.#.....#..
+.#..#...##....##.
+.#..#...##....##.
+#..#.##.......#..
+#..#.##.......#..
+.#..#...##....##.
+.#..#...##....##.
+#..#.##.#.....#..
+
+##..##..##..#
+..##.#..#.##.
+##...#.##...#
+###..####..##
+..##..##..##.
+..#...##...#.
+.....####....
+....#....#...
+..###.##.###.
+###........##
+..###.##.###.
+##..######..#
+..#..#..#..#.
+##..##..##..#
+..##.#..#.##.
+
+#....########
+.#....#..##..
+#.##...##..##
+..#.#.#.####.
+##...#..####.
+###.#...####.
+.#.##...#..#.
+.#....#..##..
+..#...#.####.
+..#...#.####.
+.#....#..##..
+.#.##...#..#.
+##..#...####.
+
+#.#......###.##.#
+#.#...#..###.##.#
+#..###..#.#..##..
+###.#..##..##..##
+.#..#..##........
+#.###.....###..##
+##..#.#.##.######
+##.#.....#.#.##.#
+##...#.##..#....#
+...#.##..........
+.##.#.#..#.......
+
+..#####.#
+....##.##
+..#.#####
+#..###.#.
+###..##.#
+.#...#.#.
+.#...#.#.
+###..#..#
+#..###.#.
+..#.#####
+....##.##
+..#####.#
+.###..##.
+...#.####
+..###...#
+..###...#
+...#.####
+
+..#...#...##.#.
+##.....####.###
+##.....###..###
+..#...#...##.#.
+##........#....
+..#.##.###.#...
+####.###.#####.
+####.....###..#
+....#.....#####
+##....#.#..#..#
+....##..#..#.#.
+...##.###.....#
+###.#.##.....##
+##..###.#..####
+##..####....##.
+##.###....#.#.#
+###..#.#.##.#.#
+
+...#.##..
+..#.####.
+####.##.#
+###.#..#.
+##.#.##.#
+..#..##..
+###......
+....#..#.
+.....##..
+####....#
+...#.##.#
+..#..##..
+##.######
+
+#.##.....
+..#.#..#.
+..#.#..#.
+#.##.....
+.##.....#
+##.##..##
+..###.###
+.##..##..
+.##..##..
+..###.###
+##.##..##
+.##.....#
+#.###....
+
+#....#.##.####...
+##.#...#..#..#.#.
+####..####.######
+..#...#...#...##.
+###....#.#.#####.
+###.#..##.....#.#
+##.####.##.##..##
+....##...##..#..#
+##.....#.#.#...##
+###.#.##.#.##..##
+..##..##....#.###
+##.##..#...###...
+...###.#...####.#
+...#....##.....##
+##########...#..#
+##....#.#.#......
+##....#.#.#......
+
+###.##.####
+.##.##.##.#
+#####.####.
+#.#.##.#.#.
+.#..##..#.#
+..##..##...
+#...##...##
+#.#.##.#.##
+##.####.##.
+####..#####
+..##..##..#
+.##....##.#
+.##....##.#
+..##..##..#
+####..#####
+##.####.##.
+#.#.##.#.##
+
+.###............#
+..#..##......##..
+###....#....##...
+###..####..####..
+.....##.#..#.##..
+..###.###..###.##
+.##....#.##.#....
+..#...#......#...
+#..#.###.##.###.#
+#.##...#.##.#...#
+..#.##.#.##.#.##.
+####...#....#...#
+####...#....#...#
+..#.##.#.##.#.##.
+#.##...#.##.#...#
+
+#..##.#
+.##..##
+.##..##
+#..##.#
+.#...##
+..#####
+....#..
+.#...#.
+.#.###.
+.#.###.
+.#...#.
+....#..
+..####.
+
+##.......
+##..#..##
+#####....
+.#.#..#..
+.....#.#.
+.##.##.##
+.##.##.##
+.....#.#.
+.#.#..#..
+#####.#..
+##..#..##
+##.......
+##.......
+##..#..##
+#####.#..
+
+..###....#.#.###.
+#........###.####
+..#...##.###.#..#
+.#.##.##....#....
+#.##.###..#.#####
+##..###.#.....##.
+##..###.#.....##.
+
+..##.#.##.#.##..#
+.#.##.####..#.#.#
+...###....###...#
+#....#....#....#.
+####.#....#.#####
+.##..........##..
+.##..........##..
+####.#....#.#####
+#....#....#....#.
+
+..##...##
+.....#.##
+.###.#...
+..###.#..
+..#.##.##
+...#.####
+...##..##
+##.##...#
+#####.#..
+###.####.
+.......#.
+##.#.####
+##.#.####
+.......#.
+###.####.
+
+#..#..###
+#####..##
+..#.#....
+###..#..#
+##.###...
+...###.#.
+##.###.#.
+...#.....
+...###..#
+....#..#.
+##.#####.
+###.#.###
+###.#.###
+##.#####.
+....#..#.
+...###..#
+...#.....
+
+...#...
+...#.#.
+##.....
+....##.
+...#.#.
+..#.#..
+#.#.#.#
+#.#.#.#
+..#.#..
+...#.#.
+....##.
+##.....
+...#.#.
+...#...
+##..#..
+#.#.#..
+#.##...
+
+#..#...##.#....
+#...#....###..#
+.#.##.......##.
+##..##..#..#..#
+####..##..#....
+###..#.........
+#..##.#.##..##.
+##..#.#.#..#..#
+.###########..#
+..........#.##.
+###....#.#.....
+##...##.####..#
+##...##.####..#
+###....#.#.....
+..........#.##.
+.###########..#
+##....#.#..#..#
+
+####.##.###..
+###########..
+....##...##..
+########.####
+####.####.#.#
+....##.#.####
+####..#.##.#.
+######.#...##
+#..#..#..#...
+........#....
+....##...##.#
+
+.###..##.
+###.#.#..
+.######..
+###.##.#.
+###..#.#.
+....#..#.
+....#..#.
+###..#.#.
+###.##.#.
+.######..
+###.#.#..
+.###..##.
+..#.##..#
+..#.#...#
+..#.#...#
+..#..#..#
+.###..##.
+
+###.#..
+.#.####
+#.##.##
+...####
+.#.#..#
+##.#.##
+#####..
+#####..
+##.#.##
+
+..##.###..##.##.#
+#.#....##.#...#..
+#.#....##.#......
+..##.###..##.##.#
+..##.###..##.##.#
+#.#....##.#......
+#.#....##.#...#..
+..##.###..##.##.#
+##.##.##....##.#.
+.#.#.###.###..#..
+...##.#.#.#######
+##..#.#..###.####
+#.....##.###.#..#
+.####.##..#.##...
+###.#.#...##.#.#.
+
+#....###.###..#
+#######.#...#..
+######.##..###.
+#....#..#...#.#
+##..##..####.#.
+#########......
+.#..#.####....#
+######.##....#.
+######.##....#.
+.#..#.####....#
+#########.....#
+##..##..####.#.
+#....#..#...#.#
+######.##..###.
+#######.#...#..
+
+##.##..##.####.
+.#........#..#.
+.#..#..#..#..#.
+###.#..#.######
+##........####.
+##.#....#.####.
+..###..###....#
+.#...##.#.#..#.
+###.####.######
+
+#...#..#.
+#.#.#..#.
+#.#..##..
+###.#..#.
+#.###..##
+#.#..##..
+##..#..#.
+####....#
+.#.#....#
+
+##.....##....
+.#...##..##..
+#..##.#..#.##
+##.###.##.###
+.#.####..####
+....########.
+.##..######..
+#.#..#....#..
+.##...####...
+#.###.#..#.##
+..###.#..#.##
+.##..######..
+##.###....###
+
+#.#.###..
+#.#.#.#.#
+#.#.#.#.#
+#.#..##..
+#..##...#
+....##...
+#.#..###.
+##...#.##
+##...#.##
+#.#..###.
+....##...
+#..##...#
+#.#..##..
+
+.....##..###..#
+##..#..##.##...
+.##...##..#..##
+.#..###.##.##.#
+.#..###.##.##.#
+.##...##..#..##
+#...#..##.##...
+.....##..###..#
+#.###.......#.#
+##..##...#.####
+##..##...#.####
+#.###.......#.#
+.....##..###..#
+
+#........
+..#.####.
+..#..##..
+##.......
+####....#
+##.......
+...######
+..##.##.#
+#####..##
+
+##......#####
+#.######.##..
+#..####..##..
+..##..##...##
+##......###..
+.#.#..#.#....
+##..##..###..
+.#.#..#.#.###
+##########.##
+..#....#..#..
+.##.##.##....
+#..####..#...
+#.#.##.#.#...
+#.#.##.###...
+....##....###
+###....###...
+##.#..#.###..
+
+....###...####...
+.##.#.#..##..##..
+......##...##...#
+#..##.####.##.###
+.#...#..#.#..#.#.
+.##.#.###......##
+#..##..###....###
+.##.#..###.##.###
+.##...#..#.##.#..
+........#.####.#.
+####.###.#.##.#.#
+####..#.########.
+######...######..
+.....###...##...#
+#..#.##.########.
+
+###..####..
+......##...
+......##...
+###..####..
+...#..##..#
+#..#.####.#
+##.#.####.#
+.##.#.##.#.
+..#........
+#..##....##
+..#.#....#.
+..#........
+#..#....#.#
+.#....##...
+#.#...##...
+
+###......###.
+####....#####
+..#..##..#.#.
+....####....#
+#.##....##.##
+.##.#..#.##..
+...##..##....
+#.##.##.##.#.
+#.##.##.##.#.
+...##..##....
+.##.#..#.##..
+
+.##.....#..#.
+....####....#
+.#.####.#..#.
+##.#...#....#
+##.....#....#
+##.##..#....#
+..#..#...##..
+..#..#...##..
+##.##..#....#
+##.....#....#
+##.#...#....#
+.#.####.#..#.
+....####....#
+.##.....#..#.
+.#..###..#...
+
+...#...######
+.###....#####
+..##....#....
+#.#.#.##.#..#
+##.##..#.####
+##.....#.####
+..#.##...#..#
+.#.......#..#
+##..##.#.####
+##...#.#.####
+.#.......#..#
+
+.#.###..#.##.
+.#.###..#.##.
+..#...#...###
+##.....#.##..
+#.#.#....#..#
+###....#.....
+.#.###.#...#.
+########..#.#
+##.#####..#.#
+
+#.#....#....#..
+######.#....#.#
+.#####.######.#
+##....#.#..#.#.
+.##...####.###.
+....#..######..
+#######.#..#.##
+.......#.##.#..
+.###....#..#...
+#..##.#..##..#.
+.#.##.###..###.
+...##..######..
+...##..######..
+
+.#.####.#.....#.#
+...#..#...#...##.
+###....###.#.#.##
+#.#.##.#.#.#.#...
+##.####.#####..##
+##.#..#.####...##
+#######.##.#..##.
+##..##..####.#..#
+#..####..#....##.
+#.######.#.##..#.
+##########.####.#
+#.#.##.#.##.##..#
+..#....#..####.#.
+#........#..####.
+..######....#.###
+..######....#.###
+#........#..####.
+
+#.#..#..##..#
+#.#..#..##..#
+.###...#..#..
+.#.##..####..
+.###.#......#
+...#..######.
+...###.#..#.#
+###.....##...
+###.##......#
+#...##.##.#.#
+..##..#.##.#.
+
+.#....#.#.#..#.
+##.####.##.#..#
+.#..#.#.##..##.
+.#..#.#.##..##.
+##.####.##.#..#
+.#..#.#.#.#..#.
+...#..#.###..#.
+..##....#.#.#.#
+##.#.#..##..##.
+..###.#..##..##
+#.#..##.##.#...
+..#..###...###.
+#..#...####.###
+...#.#.#.###.#.
+...#..#...##..#
+...#..#...##..#
+...#.#.#.###.#.
+
+..#.#.###...#.##.
+#####...###...#..
+#...#..#.#..##.#.
+#...#..#.#..##.#.
+#####...###...#..
+..#.#.###...#.##.
+.#.##......#.#...
+.........#..##...
+####.#...#....#.#
+.#..##.###....##.
+.#..##.###....##.
+####.#...#....#.#
+.........#..##...
+.#.##......#.#..#
+..#.#.###...#.##.
+
+#..#.#.#..##..##.
+.#..#.##..##..##.
+#....#.#....##...
+..##..#####.##.##
+#....#.###..##..#
+..##..#.#..####..
+######.#.#.#..#.#
+#.##.#..#...##...
+#.##.#....##..##.
+..##..###.######.
+##..####..#....#.
+##..##...#..##..#
+##..###..##.##.##
+##..######.####.#
+..##......#....#.
+
+##..###.#
+..##.##..
+###.#...#
+####.####
+###..###.
+...##....
+...##....
+###..###.
+####.####
+###.#..##
+..##.##..
+##..###.#
+######...
+....#..##
+######.##
+
+..###.####.......
+##..####.###.##..
+#.....#..##.####.
+#.##.##..#.##..##
+.#####.#.#.#.##.#
+##....##...######
+####....##.######
+#.#####.##.#.##.#
+...#.###..#..##..
+....##.......##..
+....##.......##..
+...#.###..#..##..
+#.#####.##.#.##.#
+####....##.######
+##....##...######
+.#####.#.#.#.##.#
+#.##.##..#.##..##
+
+.#.##.#.##.
+.#.##.#.##.
+#.#..#.####
+.######.#.#
+##....###.#
+.#.##.#.##.
+#.#..#.#.##
+#.####.##.#
+..#.....###
+
+..#####....
+..###..####
+..#..#.#...
+#..#..##..#
+..##..#....
+#..#..##..#
+.####......
+..######..#
+...#.#.####
+#.##.#.#..#
+..#..#.#..#
+..#..#..##.
+..#..#..##.
+
+#....##....##
+###......####
+#..#....#..##
+#.#.#..#.#.##
+#.###..###.##
+###.#..#.####
+.#........#..
+##.######.###
+#..##..##..##
+.####..####..
+#.#..##..#.##
+#.#.#..#.#.##
+#.##....##.##
+##.######.###
+..#.####.#...
+###..##.#####
+##...##...###
+
+.#.####...###
+##.###.#.##..
+#...##..#.###
+#...##..#.###
+##..##.#.##..
+.#.####...###
+#.#...#.##...
+...#.......##
+####.##.#.#..
+
+..#.#..
+##..#..
+##..#..
+...####
+####.##
+....#..
+#####..
+#..##..
+.....##
+..##...
+....#..
+##..###
+...##..
+
+.##..#...#.#.
+.##..#...#.#.
+.....#..####.
+.##.#.#..###.
+.##...#..#..#
+#####.##.#.#.
+#.##.#..#.#.#
+
+#....##...#.##.
+#....#...###..#
+.####.##.##....
+..##...########
+##..##..##.#..#
+#.##.#.....#..#
+..##..#.....#..