1
0

4 Коммиты 3dc465124b ... 46f4ab574e

Автор SHA1 Сообщение Дата
  Piotr Czajkowski 46f4ab574e Added description 2 недель назад
  Piotr Czajkowski 4faeb28825 Solved part2 2 недель назад
  Piotr Czajkowski 971651f10e Solved part1 2 недель назад
  Piotr Czajkowski a9cd86c4ab Able to read input 2 недель назад
3 измененных файлов с 425 добавлено и 0 удалено
  1. 113 0
      04/code.go
  2. 176 0
      04/description.txt
  3. 136 0
      04/input

+ 113 - 0
04/code.go

@@ -0,0 +1,113 @@
+package main
+
+import (
+	"bufio"
+	"fmt"
+	"log"
+	"os"
+)
+
+func readInput(file *os.File) [][]byte {
+	scanner := bufio.NewScanner(file)
+	var lines [][]byte
+
+	for scanner.Scan() {
+		line := scanner.Text()
+		if line == "" {
+			break
+		}
+
+		items := make([]byte, len(line))
+		for i := range line {
+			items[i] = line[i]
+		}
+
+		lines = append(lines, items)
+	}
+
+	return lines
+}
+
+type point struct {
+	x int
+	y int
+}
+
+func howManyNeighbors(lines [][]byte, x, y int) int {
+	var count int
+
+	for row := y - 1; row <= y+1; row++ {
+		if row < 0 || row >= len(lines) {
+			continue
+		}
+
+		for col := x - 1; col <= x+1; col++ {
+			if col < 0 || col >= len(lines[row]) {
+				continue
+			}
+
+			if row == y && col == x {
+				continue
+			}
+
+			if lines[row][col] == '@' {
+				count++
+			}
+		}
+	}
+
+	return count
+}
+
+func removeRolls(lines [][]byte) int {
+	var count int
+	var toRemove []point
+
+	for y := range lines {
+		for x := range lines[y] {
+			if lines[y][x] != '@' {
+				continue
+			}
+
+			neighbors := howManyNeighbors(lines, x, y)
+			if neighbors < 4 {
+				toRemove = append(toRemove, point{x: x, y: y})
+				count++
+			}
+		}
+	}
+
+	for _, p := range toRemove {
+		lines[p.y][p.x] = '.'
+	}
+
+	return count
+}
+
+func main() {
+	if len(os.Args) < 2 {
+		log.Fatal("You need to specify a file!")
+	}
+
+	filePath := os.Args[1]
+	file, err := os.Open(filePath)
+	if err != nil {
+		log.Fatalf("Failed to open %s!\n", filePath)
+	}
+
+	lines := readInput(file)
+	part1 := removeRolls(lines)
+	fmt.Println("Part1:", part1)
+
+	part2 := part1
+	for {
+		removed := removeRolls(lines)
+		if removed == 0 {
+			break
+		}
+
+		part2 += removed
+	}
+
+	fmt.Println("Part2:", part2)
+}

+ 176 - 0
04/description.txt

@@ -0,0 +1,176 @@
+--- Day 4: Printing Department ---
+
+You ride the escalator down to the printing department. They're clearly getting ready for Christmas; they have lots of large rolls of paper everywhere, and there's even a massive printer in the corner (to handle the really big print jobs).
+
+Decorating here will be easy: they can make their own decorations. What you really need is a way to get further into the North Pole base while the elevators are offline.
+
+"Actually, maybe we can help with that," one of the Elves replies when you ask for help. "We're pretty sure there's a cafeteria on the other side of the back wall. If we could break through the wall, you'd be able to keep moving. It's too bad all of our forklifts are so busy moving those big rolls of paper around."
+
+If you can optimize the work the forklifts are doing, maybe they would have time to spare to break through the wall.
+
+The rolls of paper (@) are arranged on a large grid; the Elves even have a helpful diagram (your puzzle input) indicating where everything is located.
+
+For example:
+
+..@@.@@@@.
+@@@.@.@.@@
+@@@@@.@.@@
+@.@@@@..@.
+@@.@@@@.@@
+.@@@@@@@.@
+.@.@.@.@@@
+@.@@@.@@@@
+.@@@@@@@@.
+@.@.@@@.@.
+The forklifts can only access a roll of paper if there are fewer than four rolls of paper in the eight adjacent positions. If you can figure out which rolls of paper the forklifts can access, they'll spend less time looking and more time breaking down the wall to the cafeteria.
+
+In this example, there are 13 rolls of paper that can be accessed by a forklift (marked with x):
+
+..xx.xx@x.
+x@@.@.@.@@
+@@@@@.x.@@
+@.@@@@..@.
+x@.@@@@.@x
+.@@@@@@@.@
+.@.@.@.@@@
+x.@@@.@@@@
+.@@@@@@@@.
+x.x.@@@.x.
+Consider your complete diagram of the paper roll locations. How many rolls of paper can be accessed by a forklift?
+
+Your puzzle answer was 1428.
+
+--- Part Two ---
+
+Now, the Elves just need help accessing as much of the paper as they can.
+
+Once a roll of paper can be accessed by a forklift, it can be removed. Once a roll of paper is removed, the forklifts might be able to access more rolls of paper, which they might also be able to remove. How many total rolls of paper could the Elves remove if they keep repeating this process?
+
+Starting with the same example as above, here is one way you could remove as many rolls of paper as possible, using highlighted @ to indicate that a roll of paper is about to be removed, and using x to indicate that a roll of paper was just removed:
+
+Initial state:
+..@@.@@@@.
+@@@.@.@.@@
+@@@@@.@.@@
+@.@@@@..@.
+@@.@@@@.@@
+.@@@@@@@.@
+.@.@.@.@@@
+@.@@@.@@@@
+.@@@@@@@@.
+@.@.@@@.@.
+
+Remove 13 rolls of paper:
+..xx.xx@x.
+x@@.@.@.@@
+@@@@@.x.@@
+@.@@@@..@.
+x@.@@@@.@x
+.@@@@@@@.@
+.@.@.@.@@@
+x.@@@.@@@@
+.@@@@@@@@.
+x.x.@@@.x.
+
+Remove 12 rolls of paper:
+.......x..
+.@@.x.x.@x
+x@@@@...@@
+x.@@@@..x.
+.@.@@@@.x.
+.x@@@@@@.x
+.x.@.@.@@@
+..@@@.@@@@
+.x@@@@@@@.
+....@@@...
+
+Remove 7 rolls of paper:
+..........
+.x@.....x.
+.@@@@...xx
+..@@@@....
+.x.@@@@...
+..@@@@@@..
+...@.@.@@x
+..@@@.@@@@
+..x@@@@@@.
+....@@@...
+
+Remove 5 rolls of paper:
+..........
+..x.......
+.x@@@.....
+..@@@@....
+...@@@@...
+..x@@@@@..
+...@.@.@@.
+..x@@.@@@x
+...@@@@@@.
+....@@@...
+
+Remove 2 rolls of paper:
+..........
+..........
+..x@@.....
+..@@@@....
+...@@@@...
+...@@@@@..
+...@.@.@@.
+...@@.@@@.
+...@@@@@x.
+....@@@...
+
+Remove 1 roll of paper:
+..........
+..........
+...@@.....
+..x@@@....
+...@@@@...
+...@@@@@..
+...@.@.@@.
+...@@.@@@.
+...@@@@@..
+....@@@...
+
+Remove 1 roll of paper:
+..........
+..........
+...x@.....
+...@@@....
+...@@@@...
+...@@@@@..
+...@.@.@@.
+...@@.@@@.
+...@@@@@..
+....@@@...
+
+Remove 1 roll of paper:
+..........
+..........
+....x.....
+...@@@....
+...@@@@...
+...@@@@@..
+...@.@.@@.
+...@@.@@@.
+...@@@@@..
+....@@@...
+
+Remove 1 roll of paper:
+..........
+..........
+..........
+...x@@....
+...@@@@...
+...@@@@@..
+...@.@.@@.
+...@@.@@@.
+...@@@@@..
+....@@@...
+Stop once no more rolls of paper are accessible by a forklift. In this example, a total of 43 rolls of paper can be removed.
+
+Start with your original diagram. How many rolls of paper in total can be removed by the Elves and their forklifts?
+
+Your puzzle answer was 8936.
+
+Both parts of this puzzle are complete! They provide two gold stars: **

+ 136 - 0
04/input

@@ -0,0 +1,136 @@
+@@@@@.@..@@.@@..@..@@@@.@@@...@@...@@.@@@@.@..@@....@.....@@..@@@@@@.@@.@@.@@.@@.@..@@@@@.@@@@@@@.@@@@@.@@@@@@@@@@@.@..@@@@..@@.@....@.@
+.@@@@..@@@@@@..@.@@.@@@.@@@..@@@@@@.@...@@@@@.@@@@.@.@@.....@@@@@@.@@@@@.@@@@..@@.@.@@.@.@@.@@@@.@@.@@@@@@@.@@@..@@@@....@@@..@....@@...
+.@@.@@....@@@..@.@.@@@@@@@@@.@@.@.@.@@@@..@@.@.@@@.@@@....@.@.@.@.@@.@..@@@@@@.@@@@@.@@@@.@..@.@@@@@.@@@@@@@..@@@@.@@@.@@@.@@@.@.@@@.@..
+.@@@....@@@.@@.@@...@@.@@@@@@@@@@....@@.@@@@@@@@..@@.@..@@@.@.@....@...@@@.@..@@.@@@@@@..@.@@@@@@@@@@.@.@@@....@@..@@@..@@@@.@@.@@.@@@@.
+@@@@@@.@@@..@@@..@@.@.@@@....@@@@..@@@.@..@.@@@@@@@@.@@@@.@.@.@@@@..@@.@..@@@@@@@...@@@.@@@@@@@.@@@@@@@..@@.@@@@@@@.@@.@@@@@@@.@...@@@@@
+@@@..@.@@@@@..@@@....@.@@@@.@.@@@@.@.....@.......@..@...@@@...@@@@.@.@@.@.@@.@.@.@@@.@.......@@..@.@@..@@@@@@@@@@@@.@@.@@@...@..@@@@@.@.
+@@@.@@@@.@@.@@@.@.@@.@.@..@@@@@@@@..@@@@@.@..@@@@.@@@..@@..@@.@@@@@@..@@@@@@@@.@.@@@.@...@.@.@@@@@@...@@@@.@@@@@@@..@.@@.@.@@@@@@@@@.@@.
+@@...@@@@...@@@@@@@@@.@@@.@@@@..@@@@.@@@@@@.@.@.@.@@@@@.@@@@@.@@@@@@@@.@@..@.@.....@.@@@@@@.@@@.@..@@.@@@.@@@..@.@@@@...@@@@.....@@@.@@.
+@.@@@.@.@.....@@.@@.@@@@...@@@@...@@@.@@@@@@@@@@@@@@.@@@@@@..@..@@.@@@@@..@@.@@@.@@@..@.@@@@@@.@@..@.@@@.@@@@@@@@@@@.@@@@@....@@@.@@@@@@
+@@@@@@@@@.@@@@@@@.@...@.@..@@@..@..@@..@@.@@.@@@.@.@@@@@@@@@@@.@.@.@@@@@@.@@@.@@.@@@@.@.@@@@@@@@@..@@@@@@.@...@.@.@@.@.@@@@@@.@@@@@.@.@.
+@@@...@.@@@@....@..@@.@@@@.@.@@.@@@.@.@...@@@@@@@@..@@@@.@@@@@@@......@...@..@@@@@@@@@@.@@.@@@@..@@@@...@@.@..@@@.@..@@@.@..@@@@@@@@.@@@
+@@.@..@@.@@@.@@..@..@@@.@@@@@.@@@@@@@@@@@@@.@@..@@..@.@.@@@@.@.@..@@..@.@@.@@@.@@@@@@@@@@@@@@@.@@..@@@@@@@@@@@@@@@@@@.@@.@.@@@@..@@.@@@.
+@@@@.@.@@.@@@@@@@@@@.@@@.......@@@@.@..@@.@.@@@.@@@.@@.@.@@.@.@@@.@@@.@.@@@.@@@@@@@@@.@..@@.@@..@@@@@@@@.@.@@..@@@.@@@.@@.@@@@.@@@@.@.@.
+.@@@.@@.@..@@@@.@..@@..@@.@@.@@@..@@@@@.@.@@@.@@@@@@@@.@@@..@@@..@..@@@@@.@@@.@@.@@.@..@@@@@.@@@@@.@@.@..@@@@.@.@@..@@.@@@@.@@.@@@@@@@@@
+@@.@.@@.@.@....@@@@..@.@@@@@@@...@@@@@.@@...@@@.@@@..@....@@.@@@.@.@@..@.@@@..@@@.@.@@@...@.@@@@..@@.@@@.@..@@@@@..@@.@@@@@@@@.@@@@@@@..
+.@.@@.@@@@.@.@@.@..@......@.@.@.@.@@@.@@@.@@@@.@@@@@.@@@@@@@@...@.@.@.@.@.@.@@.@@@@@@@@..@@@@.@@@@@..@.@@.@@.@@.@@@@@@@@.@.@.@@.@@@@..@@
+@@@.@@@@@.@@@.@.@@.@@.@@@..@.@@.@@@@..@.@..@@@@.@@@@.@@@.@@.@@@.@@@@@@@.@@@@...@@@@..@...@@.@@@@@@@@@..@@@@@@@@@@@.@@@@@.@@@@@@..@@..@@@
+@.@@@@@.@@@.@@.@@@.@@..@.@@@.@@@@@@...@..@@@@@@@@@.@@@@@@@@@@@@@@@@.@@@@@.@@@@@@@@@@@@.@.@@.@@...@.@@.@.@.@@@.@@@..@@@@@.@.@@@@@..@..@..
+@@....@..@.@@.@@@@@@@.@@@.@@@@@.@@.@@.@....@@..@@.@.@@.@@.@@@@.@.@@.@@@@..@@@@@@.@@..@@@@@.@@@@@.@.@@@@...@@@@.@@@@@@@.@@@@@@@@@@..@@@.@
+@@@@@....@...@@@.@@@@.@@.@.@@@@@...@@@@.@.@@..@@.@@@@@.@@.......@..@@@@@@..@@...@@@.....@.@@@@.@@@@..@@@..@@.@@@..@.@.@.@@@.@...@..@@@@@
+...@@@@@@..@@@..@@@@.@.@@@@@@.@.@@@...@.@@@.@@@@@@@@@.@@...@@.@@..@@@@...@@@@.@@.@@..@.@@.@@@.@@@@@@@.@..@.@...@..@.@....@@@..@@@@@@@@@@
+@.@@@@@...@..@@@.@@@.@.@.@@@.@@@....@.@@@.@@..@.@@@@@@.@@..@@@@@@..@@.@@.@.@@@..@.@..@@..@@@@@@@.@.@@@.@@@.@.@@..@@@@@@@@@@@@..@@..@@.@.
+@..@..@..@@@@@..@@...@@.@@@@.@@.@@.@.@@@.@@..@@..@@@..@.@@@@..@@@@.@@@@.@@.@@@.@@@@@@@...@@.@@..@.@@@@@@.@@@@@@.@.@.@.@.@@@.@..@.@@.@.@@
+@@....@@@@@..@@@@@.@@@@@@...@@@@..@@@..@@@@@@@..@.@@@@@@@@.@.@@@@@@@@@@..@.@...@.@.@@..@@.@.@@.@@@@.@@.@@@.@@@..@@...@@@.@@.@@@@.@.@@@.@
+.@@@.@@.@.@.@@@.@@@@@@@.@.@@@.@@@@@@@@.@...@.@..@@.@@@@@....@@@...@.@..@@@@.@.@@.@..@@@@@@@@@.@.@@@.@@..@.@@.@.@@@@@.@@@.@@@@@.@@.@@.@@@
+.@@@@@.@.@@@@@@.@..@.@.@.@@@@....@@.@..@@.@@...@@.@@.@@@..@@@.....@@@.@@...@.@@.@@@@..@@@@.@@....@@..@.@.@@.@@@@@@@@.@@@.@.@.@.@@@@@@..@
+...@@@.@.@@.@.@@.@@@@@@@.@@..@..@@..@@.@@@@@.@@@@..@.@.@..@@.@..@.@@@@@@@.@.@@@@@.@..@@@@.@@.@...@..@@@@@@.@@@@@@@@@@@..@@@@@@@@.@.@@.@@
+@@@...@@@@@...@@..@.@.@@.@@@@..@@@.@@@@.@@@.@@@@@@@@@.@.@..@@@.@@@@@@@@.@.@@@@@@.@@@...@.@.@@@@@..@@@.@.@@.@@@.@..@@@.@@@@@.@@.@....@.@@
+@@.@@@@..@.@@@@@@@.@.@@@@@@@..@@.@@...@@@..@@@@@@@@@.@...@@@@.@@...@@@@@.@.@@@@..@.@@@@...@@.@@@@...@@@.@.@@@.@@.@.@@@.@@.@@...@@..@@@@@
+.@@...@@@@@@.@.@@@.@...@@@@@@..@@@@@.@@.@@@@@@@@@@@@.@@@@@.@.@@..@@@@@.@@.@..@@.@.@@@.@@@..@..@@@.@.@@@@@.@.@@.@@.@.@@.@@@..@@@@@.@@@@@@
+@@..@@@@@@.@@.@@@.@@@@@@.@@@@@...@..@@@.@@@.@.@..@.@@@.@@@.@@@@@@.@@@..@@.@..@..@.@@@@@.@...@@...@@@@.@@.@.@@..@@@.@.@@.@.@@@@.@@...@.@.
+@.@.@@.@@@.@.@@@.@.@@@.@.@...@@@.@@...@@.....@...@@..@.@@.@.@@@@@@@.@@.@@@@@@@.@.@@@.@..@.@.@..@@@@.@@.@.@.@.@@@@@@..@.@@.@@@.@@@..@@..@
+@.@.@@@@.@@@@..@..@@.@@@@@@......@@@..@@..@.@@@@@.@@@@.@.@.@.@..@..@.@...@@@@@@.@.@@@@.@@.@@@@@.@.@@.@@@@@...@.@@@@@.@@@@@.@...@@.@@.@@@
+..@@.@@.@@@@..@....@@@@..@@.@.@.@@@@.@@.@@@...@@@.@@..@....@@...@@@@.@@@@@....@@@@.@@.@@@@.@@@...@.@@@.@@@@.@@@....@.@@.@@.@...@@..@@@@@
+@..@@.@@.@.@@@@@@.@@@@@@.@..@@@@.@.@@.@.@@.@@...@@@@@@.@@@@@...@@@@@@...@.@@@@@...@@@..@..@@@@.@@.@@.@@@@..@@@@@@@@@@@@@@.@@.@.@@.@.@.@@
+@@@@.@.@@@.@@.@@.@@@.@..@...@@.@@@.@@@@@...@.@@@.@@@..@.@.@.@.....@@@@@@.@.@@@.@@.@@....@.@..@@@.....@@.@@@..@@@..@@.@@@.@@@.@@.@@@...@@
+...@..@@.@..@@@@@@@.@@@.@@@@.@.@@@@@@@@@@@@.@@..@.@@@@@.@@@@@@@@.@@.@...@@.@@@@@@@.@@@@.@..@...@.@@@@..@@..@@.@@@.@.@...@@...@..@.@@@.@@
+@@@@@@.@@.@.@.@@@.....@@@@@@@..@.@@@....@@@.@.@@@@..@@.@@@@...@@@@@@..@@@@.@..@.@.@@@.@.@@@@@.@@@@@@@@@...@@.@@@@@@@..@@...@@@@@@@.@.@.@
+@@@@.@@@.@@.@.@.@@@@@@@@@.@@@@@...@.@.@@@.@@..@@@@@@@@@@@.@..@@..@@@@.@@..@@@@@@@@@@.@@..@....@@@@@@@@@.@...@@@@@.@@@.@@@@@..@@@.@@@.@@@
+@.@@.@@..@@....@@.@@.@@@@@.@@@@@@@@@@@@@@..@@.@@@....@..@@@@.@..@.@@@@@@@@@.@@@...@.@@.@@...@@..@@..@.@@@@.@@@@.@.@@.@.@@.@@@@@@@@@..@.@
+.@@@@@.@....@@.@.@@.@@@@@.@@.@@@@.@.@@.@.@@@.@@..@.@@@..@@.@..@@..@.@@@@@.@.@@@@..@@@@@...@@@.@.@@@@@@@@@@.@@@@.@@.@@@@..@@@.@@.@@@@@@.@
+..@..@@@@@..@@@.@@@@@.@@@...@@.@@@@..@@@@@@@..@@@@.@@.@.@@.@@...@@..@@@.@@.@.@@@@...@..@@.@@@..@@..@.@@@@@@..@@@.@@@.@@.@@.@@@@...@.@@@.
+@@@@@@@@@@@@.@@@.@@...@@@.@.@@.@@.@@.@.@....@@@@@.@.@@@@@@@@.@.@.@@@.@@@..@@@.@.@@...@@..@@@.@@@.@@@@@@@..@@@@@@@.@.@@@.@.@@@@@...@.@@@.
+.@@@.@@.@..@@..@@.@@@.@@.@.@@@.@@@@@.@@@@@@@@.@.@.@@.@@@@@..@...@@@.@.@@@@@@@.@.@..@..@...@....@.@..@@@@@.@@@.@..@@@@.@@@.@.@@@@...@.@@@
+..@@@..@@@@..@@@@.@@.@@@.@.....@@@@@@@@@.@@@@@@.@@@@@..@...@@@@@@@@@.@@.@@@@@@@..@@@@@@.@@.@@@@@.@.@@@@@@@.@@@@@@@@@..@@..@.@@@..@@@.@@@
+@@@@@.@@..@..@.@..@.@@@@@@.@@@@@@@@.@@@@@@@@..@@.@..@@@@@@@@.@@@@@@...@@.....@.@@@@@@....@..@@.@..@.@@.@@.@@@.@@@@@@@.@@...@@.@@@@@@@@@@
+.@.@@...@@.@.@.@@.@@@@@@@@@.@.@@@...@@..@@.@@@@.@@@@@@@@@.@@@@@@@@@...@...@@@@@.@@@@@@@@@@@@@.@@@@@@.@@@@@@@.@.@@@@.@.@.@.@.@@@@@.@@@..@
+@..@@@@@.@..@@@@@@@.@@@.@@.@...@@@.@@@.@@.@.@@@.@@@@@@@.@...@@@..@@@@@@@..@.@.@..@@.@@..@@@..@@.@.@@@@@@@@.@@@@.@.@..@@.@@@@..@@@@@@@@@@
+@@..@@.@@@@@@@@@@@@@.@.@.@@@.@@@@@@@.@@@@@..@.@@.@..@@@.@.@.@.@@.@...@.@@@@..@@@@.@.@.@@.@..@.@@.@@@.@@@@@.@.@@@.@.@@@@@.@.@.@@.@@@...@@
+@@@.@@@.@@@@@.@...@.@@@@@.@@..@..@@@..@.@.@@@@@@......@.@@.@@@@@@..@@@@@@@@@..@..@.@.@@.@@@@.@@@@.@..@@@..@@...@@@.@@@@@@.@.@......@.@@@
+@@@..@..@...@@@@@@@@@@.@@@..@.@@..@@@.@@@@.@@..@@@@@..@.@..@@@@.@.@.@..@@@.@@.@.@@.@...@.@@@@@@.@..@@@@@@@@@@@@@@@.@@@@@.@@.@@@@@.@.@@..
+..@@@.@@...@@@@@..@@.@@.@@@@@@@@.@@@@@@...@@....@@...@@@@@@@@@@@.@@.@@@...@@@.@@@@.@.@@@@.@@.@@@.@@@@@@@@@@..@@.@..@@.@@.@@@@.@.@@.@...@
+.@@.@@..@@@@@.@@..@@@@@@.@....@.@@@@..@.@..@.@@@...@@@.@.@@@@@@@.@.@@.@@.@@.@@.@@...@@@@@@.@@@@.@.@@@@@@@@...@@.@@@.@@.@@@@@.@...@@@@@@@
+.@@@@.@@@@@.@@@.@@.@.@.@@@.@.@.@@..@@@.@@...@@.@@.@@.@@@.@@@@@@.@.@@@.@..@..@@.@..@@@@@.@@.@.@@.@@.@..@@.@..@@@@.@@..@@@.@@@@@@@@.@.@..@
+@@.@....@@@.@@.@@..@.@.@.@.@.@@..@@@@@.@@@..@@....@@.@@@..@@@@@..@.@.@@@@.@@@@.@@@@...@@@..@@@@@@.@..@@@.@@@@@@@@@@@..@@..@@@@.@@.@.@..@
+..@.@@.@.@@@....@@@.@.@@@@@@@@@@.@@@...@.@@.@@.@@@@@@@.@.@@@@@@@@.@...@@@.@@@@@..@.@@.@..@.@@@@@..@@@@@@@@@@..@@.@@@@.@@@@@@@@@@...@..@.
+@@..@@.@@@@@@@..@@..@@@@.@.@.@@.@.@@@@.@@@.@.@@..@....@@@.@@@....@@.@@@.@@...@@@..@@.@@...@@@.@@@....@@@.@@@.@@@@..@@..@.@@.@@..@@@.@@@@
+@@.@.@@@@@@@@@@@@@..@@@..@@.@@@@@@@@@@@@.@..@.@@@@@.@.@@@..@@.@@@@@...@@..@@@..@...@@.@..@.@...@@....@.@@.@..@.@@@@@@.@@@.@.@@.@.@@.@@..
+@.@.@@@@@@@@@@..@..@@.@.@@@@@@@@.@@..@@@@@.@@@@@.@..@..@@@.@@@.@@@@.@.....@@@@.@@@@@@@@@@.@@@@@.@@@..@@@.@@@..@.....@@...@..@.@@@..@@@@@
+....@@@@.@..@@@.@@@@...@@@@.@.@.@.@@..@....@@..@@@.@....@@@.@@@..@@@@@....@..@@.@.@.@@.@@@.@..@@@@.@....@@@@@@.@@@@..@.@@.@.@@.@.@@@.@.@
+@.@...@@@@@@@@@.@@@@@@.@.@.@@@..@@.@.@.@@@@@@.@@....@.@@..@.@.@@@@.@@@@@@.@@@.@@.@..@@.@.@@@...@@@.@.@@..@.@@.@.@.@@@@@@@@.@@@@@...@@@@.
+@@.@.@@@@@.@@@.@@@.@@@.@@@..@@@.@.@.@@@@.@..@@@@.@@@@@@@@@.@@...@@@.@@.@..@....@@@@@@@.@.@@@@@@.@@..@.@@@.@@@@@@...@.@.@....@.@.@@.@@@@.
+@@@.....@..@@@@.@.@@@@@@@...@.@@@.@@@.@@.@@@@@@...@@.@.@@@...@@@@@@@..@@@...@.@...@@@@@.@@..@...@@@@@.@@@.@.@@@.@@..@.@@..@@@@@@@.@.@..@
+@@@@@@@.@.@@..@@@@@@@@@...@.@.@@@@.@..@.@.@.@@.@@.@@..@@@.@@@@@.@@@@@.@@@@.@.@@.@@.@.@@..@@@@..@..@@@@@@.@.@@@@@...@@.@..@..@.@@.@.@@..@
+@.@@@@@@@@..@@...@@@.@@@@..@.@@@@@@...@.@@.@@@@@@.@@@@.@@..@.@.@@..@@..@@.@..@.@@..@..@@@@...@@@.@@.@@.@@.@@@@@..@@@.@..@.@@.@@@@@@...@.
+@@.@.@@@@@@@@@@@@..@@@..@.@@@.@.@@@.@@@@...@@@@@@.@.@@@..@@@@@@@.@.@@@@@..@@@...@@@..@@..@...@@@@@..@@..@.@@.@.@@@@@@@@@@.@..@@@.@@@@.@.
+..@@...@@@@@@@.@@.@.@@@@@@@..@@.@@@@..@@@@.@@..@@@.@@.@@.@@.@@.@.@@@..@...@.@@@@@.@@@@@@@@.@.@..@@@@@.@@.....@@@@..@@.@@@.....@@@@@..@@.
+.@.@@@..@@@.@@@@@@..@@@@@@..@....@@@@@.@@@@@@.@@@...@@@@...@..@@.@@@@@@@@@@.@.@@@.@.@@..@.@@@@.@@.@.@..@.@@@@@@@..@@@@@@@@@..@.@....@.@@
+@@@@@@@@@..@@...@@@@.@@@@.@....@.@@@@@@.@@@@@@@.@@.@.@@.@@@..@@@@@@.@@.@@.@@@@@@...@@@@@@@@@.@@@@..@@@..@..@..@@.@.@@@.@@@...@@...@..@@@
+@@@..@.@@@.@@@..@.@...@@.@@@...@.@@..@.@@@@@@.@....@@.@@.@@@@@@@@.@@@@@@..@@.@.@.@@@@@..@..@@@.@.@..@@.@@...@.@@@@@.@..@@..@...@@.@@@..@
+@..@@.@@@@@@.@.@@..@.@@@@@.@@@@@@@.@.@@@.@..@@@@@.@@@@@@@..@.@@@@@...@@@.@@.@.@@.@..@.@..@@@..@@@@@@@@@@@..@@.@.@@@@@.@@@..@@@......@@.@
+.@@.@.@@@.@@.@.@@@@..@@@@@@..@..@@@@....@.@..@@.@@@@..@@@@.@@@@@@@@@...@.@@.@@@@.@@@@@@@@@..@.@@@@@@@@@@@@@@.@@@..@@.@@.....@@@@@@@@@...
+@...@@@@.@@@@.@@@.@...@.@.@@.@@..@@..@..@@@@..@.@@.@@@.@@@@@@@@.@@@.@...@.@....@.@@.@@.@@.@..@@.@@.@@.@@.@@@@@.@@@@.@@@@@.@@.@@@@@..@.@@
+@@@@@@@@..@@...@@..@@.@@@.@.@.@@@..@.@@@.@.@.@@@.@@@.@@...@@@@.@.@@@@@@@.@.@@@.@@.@@@.@@.@@@@@@.@.@@.@.@.@@@..@@@@.@@@@@@@....@@.@@...@@
+@@@.@@@@@@@@@@@.@..@.@....@@@@@.@@@@@..@@@@.@@......@@@@@@@.@.@@@.@..@@@@.@.@@@@@.@@@.@..@.@@...@.@.@.@@.@...@..@@@..@@@.@..@@@@.@..@@@@
+...@@.@@@.@@.@@@@@..@@..@@.@@...@.@@.@..@.@@@@.@@@...@..@@@@@@@@@@@@@.@@@@.@.@.@@.@@@.@.@@@@.@..@@@@.@.@@.@@.@@....@@..@@@@...@@@@@.@@.@
+@@@@@......@@.@@@.@@...@@@@@@@.@.@@@....@@.@..@@.@@.@@@@@@@@@@@@..@....@@.@.@@.@@@@@@@@.@.@@@.@.@.@@@@@@@@@..@@@@.@...@.@@@@@@@..@.@..@.
+@@@.@@.@.@@@@.@@@.@@@.@@@@..@..@@@@.@@@.@....@@@@@.@.@@@@@@.@.@@@@@@...@@..@@@.@@..@..@..@.@..@@@@.@@@@@@@@@@@.@@@.@@@@.@.@@@.@@...@..@.
+...@.@@@.@.@@.@@@@@...@@.@@@@....@@@@@@@@@@@..@@.@..@@...@..@@.@@@@.@..@.@@@....@@@@.@@.@.@@@@@@@...@.@@..@.@@@.@@@@@..@@@@@.@@@@@@@@@@@
+@@.@@@@@@@....@..@@@@@...@@.@@@@@....@.@.@@.@@@.@@.@@@@@.@@@@@@@@@@@.@.@@.@@@@@..@.@@@@@@@.@..@.@.@.@@@@..@@@@@@.@..@@@..@..@@@...@@.@..
+@@@..@.@@@.@...@@@..@.........@@.@.@@@@.@..@@@@@@@@.@@@@.@@@@@@@.@@..@..@@@..@.@@@...@@@..@.@.@@@@.@.@@..@@@@.@..@@.@@@@..@@@.@@.@..@@..
+@.@@@@@..@@@.@@.@.@@.@@@@@@@..@.@@.@.@@@..@.@@@.@@@@@@.@@@@@..@@.@@..@@@@@...@@@@.@@@.@@@..@@.@@@@@..@@@@@.@@@@.@...@.@.@.@..@@@.@@@@@..
+.@@@....@@...@.@.@@.@.@@@@@@@@@@.@.@..@@.@@.@@....@..@@.@..@@@.@@@@@@.@@@.@@@@.@@..@..@.@..@@@@.@@@.@@@@@@@.@@@@.@@@@@@@@.@@@@.@@@@.@.@@
+@@@@@@@@.@@@.@.@@@@@@@.@......@@.@@@.@..@@@.@.@..@@.@@.@.@.@.@@.@@@@.@@@@@.@.@@@.@@.@.@.@@@@.@@..@@@.@@..@@@@.@@@@@..@@@.@@@@.@@.@.@@@.@
+@.@@@@..@@@@@...@@@@.@..@@@@@.@.@..@@.@@@....@..@@@....@.@@@..@..@@.@@@@..@@@@@@@...@...@@.@@@@@@..@@@@@@..@@@@@@@@.@@@.@@@@.@.@@.@.@@@@
+@@.@@.@@.@@@@@.@.@@@.@..@@..@@@@@..@@@@@@@@@..@..@@@..@@@@@.@@..@@@@@@...@.@@@..@@..@@@.@@.@@@.@..@..@@@.@@..@@@@.@@@@@@.@.@..@@@..@.@.@
+.@@@@@.@@@@@.@@@@@@@@@@@@.@@.@@....@@.@@.@@@@@@.@.@@@.@.@.@.@@@@@.@....@.@@.@@.@@.@@@@...@@@.@..@..@.@@@@@..@.@..@@@@@@@@@@@@@@.@@@@...@
+..@..@@@.@..@@..@@@..@@@.@..@.@@@.@@@@@@.@.@.@@@@@..@@@@@.@..@.@@.@@@.@@@@@..@@@...@@@@.@@@@@@.@.@@@@.@@.@@....@....@@......@@@@@@..@@..
+@@@@@@@.@.@@@@.@.@@.@@@@.@.@@@@.@.@@@.@@@@@@.@@@..@@.@..@@..@..@.@.@.@@@.@..@@...@.@@.@@@@.@...@.@@@@.@@..@@@@@@@.@@@@.@@@@@..@@@.@@@...
+.@@@..@@@@.@@@.@@@@@.@@@...@..@..@@@@@..@.@@@..@@@@.@.@@@@.@@@.@.@@@.@@@@@@.@@@@..@@@.@.@.@@@....@@@@@@..@@@.@@..@.@@.@@..@.@@@@@@.@@@@.
+@@.@..@.@@@@@.@@@@@@@@@.@.@@@@@@.@.@.@@...@..@..@.@@@@@@@@@@.@.@@.@...@..@.@.@@..@@@.@..@@@@..@@..@.@.@@@@@@.@.@.@@@@@@@..@.@@@@.@@@@@@@
+.@..@..@@.@@...@.@@@@@@@.@@@@@@.@@.@@.@...@..@@@.@..@@@@..@...@@@.@..@.@@.@@@.@@.@.@@@@..@...@.@.@@.@@..@..@@.@@@.@...@@..@@@@@@..@@....
+@@@..@@@@@@@.@@.@@@@..@..@@@...@@@@@@@@@.@.@..@@@..@@@@.@.@....@..@@@@@..@@@@@@@@@.@@@.@..@@@@@@..@@@...@.@@@@@.@@.@.@.@...@@@.@.@@..@@.
+@@@.@.@@@@....@.@@@.@@@@@@@@@@@@@@@.@@.@.@@@@@@@@@.@.@@.@@.@@@.@@.@@.@@@@@@@@.@@.@..@..@@.@@.@@@....@@..@@@@@@@@@@....@@@@@..@@.@@.@@@@.
+@..@@@@@@@@@@..@@..@.@.@.@@@@@@@@@@@@.@.@@.@@.@@..@.@@@@@.@@@@@@@@.@@@..@.@....@@..@@.@..@..@@@.@.@..@.@..@@@@@@@@@@..@.@.@@@..@@@@@@.@.
+@@@@@.@@..@@@@@@@@@@@.@@@.....@.@@....@@@.@@@@.@.@@@@.@.@@.@@....@@.@@@@.@@.@..@..@@@@@..@@@..@@..@@@@.@@@.@..@@.@..@@...@@@@...@@@@.@@@
+@@.@..@@..@...@@@.@.@....@@..@@@@.@@@@..@@@.@@@.@@@..@@@@..@@@@@@@@..@@@@@@@@.@..@....@.@.@@@@@@.@@@@@....@@@@@....@@@@.@@@....@@.@@.@@@
+@@.@@@@.@@..@.@.@..@@.@...@@..@@@..@@@@..@@@@.@@.@..@...@.@@@@.@@@@@@.@...@@@....@@@@.@.@@..@@.@@@@@@@..@..@@.@@@@@@@@@@.@.@.@@@...@.@@@
+.@..@@@@@..@@@@.@@@.@@..@@@@..@@@.@@.@..@.@..@@...@@.@@@@@@@.@@@@@@.@@.@@.@@@@@@@@@@..@...@@.@@@@..@@@@.@@.@@.@..@...@@@@...@.@@@@@..@@@
+....@@@..@.@@@@@@.@@@@.@@@..@.@.@@.@@@@..@@@.@@@@.@.@@.@@..@..@@@......@.@@@@.@@.@.@.@@..@.@....@@@.@@.@@@@....@@@@@.@.@@@..@..@@.@@@..@
+@@@@@.@.@@@@@..@@.@@@.@.@@@@.@...@@@.@.@@@@@@@@@@@@@..@@@@@..@@@@@.@.@.@@.@@@..@@@@...@..@@.@.@@@.@@@@@..@.@.@@@.@.@.@.@..@@@@..@.@@@@..
+.@.@.@@@.@.@@.@@@.@@@@..@.@@@@..@.@@@.@@.@.@.@.@@@@..@@@.@@@@.@@@@@@@@@.@.@@@@@.@.@.@@@@@.@.@@.@.@@@.@@.@.@..@@@.@@@@@.@@@@@@@@..@@@@@@@
+@..@@..@@..@..@@@.@@.@@.@@@.@.@@.@@@@..@@.@...@@.@@...@@@@..@.@.@...@.@.@.@@@@@@@@@.@@@@@@@@.@@.@@..@.@.....@...@@.@@.@@..@@@@...@@@@@@@
+@@@.@@.@@@..@@@.@@@@@@.@@@.@@@.@@.@@@.@@.@.@..@@.@@...@@.@@.....@.@@@@.@@@.@.@@@@@.@@..@.@@@@@@.@.@@@@.@@.@..@@@@..@@@@.@@@@..@@@@@..@@@
+.@..@@@@@@@@.@@.@@.@.@@.........@@.@@.@@@..@@..@@.@.@.@..@@@@.@@@@@@.@@@..@@@.@@@@.@@.@@.@@..@@@@@@@@.@@@@...@@@@@@...@@@@@.@....@@@@@@@
+@@.@.@@@.@.@@...@.@@.@@@.@@@@@.@..@@.@@@.@...@@@@@@@@.@@@.@@@@@@.@@@.@.@.@@@.@.@@@@..@..@@..@..@@.....@..@@....@.@@@@@@.@@@@@@.@@.@@@@@.
+@..@@@@@@.@.@@@@.@.@@.@@.....@.@.@@@.@@@.@@@....@.@@@.@@@.@@.@@@@.@@.@@.@@@......@@@.@@@@@@@@...@@@.@.@@@..@....@.@.@.@@.@@.....@@....@@
+@.@@@.@@@@@.@@.@.@...@@.@@@@@.@@@@.@.@@.@@...@@.@@@@@@@@@@@@@@@@.@@.@@@@@@@.@@@@@@..@@@@@@@..@.@@.@..@.@.@@@@@.@@@@@@@@.@@@@.@@@@@@@..@.
+@@.@.@@@@....@.@.@@@@@@.@@..@@@@@@@.@.@.@@@.@@@@@...@.@@....@@.@@.@@@@@.@.@.@@..@.@.@@@..@@.@@@..@@@@@@.@@@@@...@.@@@@@.@@@@.@@.@.@.@@@@
+@.@.@.@@@@@...@.@@.@@.@@@@@...@.@@..@@.@.@@@.@.@..@@.@@.@..@..@@@@@@@@@.@@@....@@..@.@@.@.@.@@@.@..@@@@@@@@@@.@.@@..@@.@@@@@@@@@@@@.@@.@
+.@...@@@.@@.@@@.@@@@@@@.@@@@@@.@.@@.@@.@@.@@@@.@....@..@...@@.@@@@@@@.@@@@@@@@@@@@.@@@@@@...@@@@@..@@@.@.@..@@@@@.@@@...@@@@@.@@@@@@@@@@
+.@@..@.@.@@.@@.@@@@@@@@.....@.@@.@..@@@.@@.@@.@@@@.....@.@@@@@.@@@..@.@@....@.@.@@..@..@.@@@..@@.@.@@.@@.@@@@.@@@@@..@@@@@@@...@@.@.@..@
+.@.@@..@@@@@....@@@@@@@.@..@.@@@@@..@.@.@@@@@@@@@.@.@@...@.@@.@.@@.@@.@@@@@.@..@..@.@.@@@@@@@...@..@@@@@@@@.@@@@@.@.@.@@@@@.@.@.@.@.@@@@
+@.@@@.@@@.@@@@.@@@@@@.@@.@@.@.@@..@...@@..@.@.@@..@@@.@.@@.@@@.@@@...@@@@.@..@@@.@.@@..@@@@@@...@@.@@@@@.@@.@@...@.@.@@.@..@@......@@@.@
+.@@..@@@@@@@@@...@@.@@@@@@@.@@@@..@@@.@.@@..@@.@.@.@....@@@@@@@@.@@@.@.....@@@@...@@.@@.@.@@.@..@@@.@@@@@@@@@...@.@.@.@@@@.@@@.@@@.@@@.@
+@@@...@..@@@@.@@.@@@@@.@@@@@..@@@@@@@@@.@@@..@@..@@@@.@@.@.@...@.@.@@@@@@@@@@..@@@@@@.@@...@@.@..@@@@@.@@@@@@@@.@@...@@.@.@@.@@@..@@.@@@
+@@@.@@@@@@.@@.@.@@.@@@.@..@.@.....@@@@@.@@....@@.@..@@@@@.@@@..@@@..@@.@@@.@@@.@@.@@@@@@.@.@@@..@@@@.@@@..@@@..@@@.@@@....@.@@@.@...@.@.
+@.@@.@@@@.@@@..@.@@@.@@.@@...@...@@..@@@@@@.@@.@@@@@@@..@@@@@@@@@.@.@@.@@@@@@..@@..@.@..@.@@@@..@@@@@@@@.@@@.@@@@..@.@.@@.@@.@@@@@@.@@@@
+@..@@...@.@.@@@.@.@.....@..@.@@..@.@..@@@@.@@@..@@.@@@..@@.@@..@.@...@..@@.@..@@@.@@.@@@.@@@.@@.@@@@.@@@.@@@@.@...@@@@@.@@@@@..@@@@.@..@
+.@.@@@.@@.@@.@@.@@@.@@@@@@@@..@@@...@.@@.@@.@@.@@@@@@@@.@.....@.@.@@@@@@@.@.@.@@@@@.@@@@@@@@@@@@@.@@.@@..@.@...@.@@@..@@@.@@.@.@@.@.@..@
+@@@..@@@.@@@@@@@@@@.@..@@.@@@.@@@@@@..@@..@@@.@.@....@@@@@@.@@@@@@@@.@@...@@@..@@...@@@..@.@@..@@@@@..@@@@.@@@.@.@@@@...@..@.@.@@.@@.@..
+..@@.@.@.@@..@...@..@...@@@.@@@@@@@@@..@@@@@@..@@@@.@@@@.@@@@...@@@@@@@@@@.@@@@@@@@..@.@@@@@@@@....@@@@@@@@@@....@@....@@@@..@.@@@.@.@@@
+@.@.@@@@.@@.@.@.@@..@.@@@@.@@.@@@@.@@@@@.@@@.@@@@@@@@@.@@@@.@@.@.@@@@.@@@@.@@@@..@@@@.@.@@.@.@.@@@@@@@.@@.@@@@@...@@@@.@@@@@@@..@@@@.@@@
+.@@.@@@@@@.@.@.@@@@@@..@..@@@@....@@..@@@.@@@@@...@@@@@.@@..@@@@..@.@.@@@@.@.@...@...@@.@..@@@...@@@..@.@@@@@...@@..@@@@.@@@@@...@@.@.@@
+@@@@@....@...@@..@.@...@...@@@@@@.@.@@@@.@@@@@@@.@..@@@@@@@@..@@@@...@@.@@.@.@@.@@...@@@@.@.@@@.@@..@@@@.@@@....@...@.@.@@.@.@..@..@.@@@
+..@.@@.@@@@@@@@.@@.@@.@@@...@@..@@@@@@@.@..@@..@@@.@@.@@.@...@@.@@@@@.@@@@@..@@@.@.@@.@@@@.@@@.@@@..@.@@@@@@@..@@@....@@@@....@@@..@.@@@
+@@@.@@@.@@...@..@.@....@@@.@@..@@.@@@.@@.@@@.@@..@..@..@.@@@.@.@@@@@@@.@@..@@.@@@.@.@@@@@.@.@@@@@@@@..@@..@.@@.@@.@.@..@@.@..@.@@@@@@@@.
+@@@@@.@@@.@..@@@.@@@@@@@@@@@.@@.@@@@@.@@@@@.@@..@@@@.@..@.@@@@@@...@@@@@@.@@..@@.@@.@@.@@..@@@@.@@.@...@@@@@@...@.@@@@@.@@@@@@@@@@@@.@.@
+@.@..@..@....@@@@.@.@@@@@.@@@.@@@@@.@@@@@@@@...@@.@@@.@.@..@..@..@@@@@..@@.@@..@.@@.@@.@.@.@..@@.@@.@...@.@@@@@@.@.@..@.@@.@..@@@..@@@@@
+@.@@@.@@.@@@@.@...@@@.@@@.@@@@@@@@.@@@@@@@@@@.@@@....@@@@.@@@...@@@.@.@@@@.@.@@@..@..@..@@.@@@@@@.@...@@@.@@@@.@@@@@@@@@....@@@.@@.@.@@.
+@@@@..@@@@@.@@@@@@.@@@@...@..@@@.@@@@@@@.@.@@@.@.@.@@@@.@...@.@.@.@@...@@@@@@@@..@@@.@@...@@.@@@.@@@.@@@@@@@@@.@@@@.@@@..@@@@.@@@.@@@.@.
+.@@@@@.@@@..@@@@@.@@@@@.@..@....@@.@@.@@@.@@@@@@@.@@@....@@@@@@@@@@@.@@..@.....@.@.@@@@@@@@..@...@@@.@@@@@@@@.@@.@@.@@@@.@@@@@.@@@..@.@.
+@@..@.@.@.@@@@@.@.@@@....@.@.@.@.@@@@.@@@.@..@@@@@@..@@.@@@...@@@@@...@..@@@@.@.@@..@.@@.@@@@.@@@.@@@.@...@@@.@@@.@.@@@@.@@@@@@....@.@..
+@.@.@@@@.@@@.@.@@@@..@@@@@@.@..@@@..@@.@@@@..@@@@.@.@.@.@@@.@.@.@@@@@@.@.@.@...@...@@..@@@@@.@@..@@@@@@@@@.@@@@.@@@.@.@@@@@@.@@@@@...@@.
+.@.@..@@@@@@@.@@@@@@.@..@..@@@@@@@@@@@@@@@.@.@....@@@@@@@.@.@@.@@..@@@@.@.@.@.@@.@@.@@@@.@.@@@.@.@@@@@@@..@..@@@@@@@@.@@@@@@@.@.@.@.@@@@
+...@@@@@@..@.@@@@@@@..@@@..@@@@@@@.@@...@..@@@.@@@@@...@.@.@.@@@@@@@@@@@..@@@@.@@@@.@...@.@@.@..@@.@@.@..@@@.@@@@@@@@.@.@.@.@@@..@@.@.@.