This commit is contained in:
2024-12-16 11:56:47 +01:00
parent 28c35f5375
commit 0a36d9db83
4 changed files with 211 additions and 0 deletions

38
16/16-1-ki.py Normal file
View File

@@ -0,0 +1,38 @@
file = './ex.txt'
#file = './ex2.txt'
#file = './input.txt'
from heapq import heappush, heappop
def solve_reindeer_maze(maze):
start = next((i, j) for i, row in enumerate(maze) for j, cell in enumerate(row) if cell == 'S')
end = next((i, j) for i, row in enumerate(maze) for j, cell in enumerate(row) if cell == 'E')
directions = [(0, 1), (1, 0), (0, -1), (-1, 0)]
heap = [(0, start[0], start[1], 0)]
visited = set()
while heap:
score, row, col, direction = heappop(heap)
if (row, col) == end:
return score
if (row, col, direction) in visited:
continue
visited.add((row, col, direction))
for new_direction in range(4):
new_row, new_col = row + directions[new_direction][0], col + directions[new_direction][1]
if 0 <= new_row < len(maze) and 0 <= new_col < len(maze[0]) and maze[new_row][new_col] != '#':
new_score = score + 1
if new_direction != direction:
new_score += 1000
heappush(heap, (new_score, new_row, new_col, new_direction))
return float('inf')
# Einlesen des Labyrinths und Lösen
maze = [list(line.strip()) for line in open(file, 'r')]
result = solve_reindeer_maze(maze)
print(f"Die niedrigste mögliche Punktzahl ist: {result}")

15
16/ex.txt Normal file
View File

@@ -0,0 +1,15 @@
###############
#.......#....E#
#.#.###.#.###.#
#.....#.#...#.#
#.###.#####.#.#
#.#.#.......#.#
#.#.#####.###.#
#...........#.#
###.#.#####.#.#
#...#.....#.#.#
#.#.#.###.#.#.#
#.....#...#.#.#
#.###.#.#.#.#.#
#S..#.....#...#
###############

17
16/ex2.txt Normal file
View File

@@ -0,0 +1,17 @@
#################
#...#...#...#..E#
#.#.#.#.#.#.#.#.#
#.#.#.#...#...#.#
#.#.#.#.###.#.#.#
#...#.#.#.....#.#
#.#.#.#.#.#####.#
#.#...#.#.#.....#
#.#.#####.#.###.#
#.#.#.......#...#
#.#.###.#####.###
#.#.#...#.....#.#
#.#.#.#####.###.#
#.#.#.........#.#
#.#.#.#########.#
#S#.............#
#################

141
16/input.txt Normal file
View File

@@ -0,0 +1,141 @@
#############################################################################################################################################
#.#.....#.........#...#.......#.......#.......#.................#...#...#.........#...#.........#.....#.....#.......#.......#...#.......#..E#
#.#.###.#.###.#####.#.#.#####.#.#.###.#.###.###.#####.#.#######.#.###.#.#.###.#.#.#.#.#.#####.#.#.###.#.#.###.#.#####.#.###.###.#.###.#.#.#.#
#.....#.#...#.......................#...#...#.....#...#.#.....#.......#...#...#.#...#...........#...#...#.....#.#.....#...#.....#...#.#.....#
#.#####.###.#.#.#####.#####.###.###.#########.#####.#####.###.#.#.#.#######.###.#####.#.###.#.#####.#######.###.#.#######.#######.###.#####.#
#.#...#.#...#...#...#.....#.#.#...#...........#...#.#.....#...#.#.#...#.......#.#.....#...#.#...#...#...#.....#...#.#...#.........#...#.....#
#.#.#.#.#.###.#.###.###.###.#.#.#.#############.#.#.#.#####.###.#.###.#.#####.#.#########.#.###.#.###.#.#.###.#####.#.#.###########.###.#.#.#
#...#...#.....#...#...#.....#...#.....#.....#...#.#.#.#...#...#.#.#...#.#.....#.............#...#.#.#.#...#.......#...#...#.........#...#...#
###.###.#####.#.#.#.#.#########.###.#.###.#.#.###.#.#.#.#####.#.#.#.###.#.###.###############.#.#.#.#.#####.#####.###.#.###.###########.#####
#...#...#...#...#...#.#.#...........#.......#.#.....#.#.....#.#...#.#...#.#.....#...........................#.......#.#...#...#.......#.....#
#.###.###.#.#.#.#####.#.#.###.#.#########.#.#.#######.#####.#.#.#.#.#.###.#####.###.#######.#####.#.###.#.#########.###.#.###.#.#####.#####.#
#.#...#...#.........#.#...#...#.#.......#...#.......#.#.....#...#.#.#.#.#.........................#.#...#.......#.#...#.#...#.#...#.#...#...#
#.#.#######.#.#.#####.#####.###.#.#.#####.#######.#.#.#.###.###.###.#.#.###.#.###.#.#.###.#.#.#####.#.#########.#.###.#.#.###.###.#.###.###.#
#.#.......#...#.....#.....#.#.....#.#.....#...#.#...#.#.#...#...#...#.....#.#.......#.#.....#...#.....#...................#...#...#...#...#.#
#.#######.#####.###.#####.#.###.###.#.###.#.#.#.#.###.#.#.###.###.###.#####.#.#######.#.#######.#.#####.#########.#.#.###.#.###.###.#.###.#.#
#.#...#...#...#.#.#.....#.#...#...#.........#...#...#...#...#.....#...#.....#.#...#...#.#.....#.#.....#.........#.#.#.#...#.........#.#...#.#
#.#.###.###.#.#.#.###.#.#.###.###.#########.###.###.#######.#######.#.#.#######.#.#.###.#.#.###.#####.#########.#.#.#.#.###############.###.#
#.#.........#.#...#...#...#...#.....#.......#...#.#.......#.#...#.....#...#.....#...#...#.#.....#...#...#.....#.#.....#.................#...#
#.###########.#####.#.###.#.#######.#.#######.###.#######.#.###.#.#######.#.#########.###.#######.#####.#.###.#.#.#######.#.#.#########.#####
#.#...#.....#...#...#.#...#.....#...#.#.....#.#.....#...#...#...#.#.......#.#.......#...#...#.#.........#...#...#...#.....#.#...#.#.....#...#
#.#.#.#####.###.#.###.#.#######.#.###.###.###.###.#.###.#.###.###.#.#.#.###.#.#####.#######.#.#.#####.###.#.#######.#.#.#.#####.#.#.#####.#.#
#...#.#.....#.#.#...#.#.#.......#.#.....#...#.....#.#.......#.#...#.#...#...#...#.#...#.....#...#...#.#...#.....#...#.#.#.......#...#...#.#.#
#####.#.###.#.#.#.#.#.#.#.#######.###.#.#.#.#######.#.#####.#.#.###.#.###.#.###.#.###.#.#########.#.###.###.#####.###.#.###.#####.###.###.#.#
#...............#.#.#.#...#.....#.....#.#.#...#...#.#...#.#.....#...#...#.#.#.......#.#...#.......#.....#.....#...#...#...#.#.......#...#.#.#
#.#.#.#.#.###.#.#.#.#####.#.#.#.###.###.#.###.#.#.#.###.#.#.#####.#######.###.#######.#.#.#.###############.#.#.#########.#.#.#####.###.#.#.#
#.......#.#.#.#.#.....#...#.#.#...#.#...#...#.#.#.#.....#.#.......#.....#...#...#...#.#...#.#.#.....#.......#.#.#.....#...#.#.#...#.....#.#.#
#.#######.#.#.#.###.#.#.#.#.#.#####.#.#####.#.#.#.#######.#####.#.#.###.###.#.###.#.#.#.###.#.#.#.#.###.###.#.#.###.#.#.###.#.#.#.#####.#.#.#
#...#.....#...#...#.....#...#.......#...#...#...#...#...#.......#...#...#.#...#...#...#.#...#...#.#.....#...#.#.#...#...#...#...#.....#.#.#.#
#.#.###.#######.#.#.#.#.###############.#.#######.#.#.###.###########.#.#.#####.#####.#.###.#.###.#.#######.#.#.#.#####.#.#.#.#######.###.#.#
#.#...#...#...........#...#.#...........#.....#...#.#.#...#...#.........#.#.....#.#...#.....#...#...#.....#...#.#.#.....#...............#.#.#
#####.#.#.#.#############.#.#.#####.#.###.#####.###.#.#.###.###.#.#####.#.#.#####.#.#############.#.#.###.#####.#.#####.#######.#######.#.#.#
#.....#.#.#...#...........#...#...#...#...#.....#.....#...#.....#.#.......#.....#.#...#...#.....#.#.#...#.#...#.#.#...........#.......#...#.#
#.#####.#.###.#.###############.#.#.#######.#.###########.#.#####.#.###########.#.###.#.#.###.#.#.#####.#.#.#.#.#.#.#.#.#####.#.#####.#####.#
#.......#...#.#...#.....#.......#...#.......#.#...........#.#...#.#...#.........#...#...#.....#...#...#.#.#.#.#.#...#.#.......#...#.....#.#.#
#.#.###.#.###.###.###.#.#.#############.#####.#.#.###########.#.#.#.###.#########.###.#############.#.#.#.#.#.#.#.###.###########.#.###.#.#.#
#.#.....#.....#...#...#.#.....#...#.....#...#.#.....#.........#.#.#.#...#...#...#.....#...#...#...#.#...#...#...#...#.......#.....#.#.....#.#
#.###########.#.###.###.###.#.#.#.#.#.#####.#.#####.#.#####.###.#.#.#.###.#.#.#.#######.#.#.#.#.#.#.###############.#######.#.#####.#####.#.#
#...........#.#.....#.....#.#.#.#.#.#.#...#.......#.#.#...#.#...#.#.#.....#...#.#...#...#...#...#...#.#.............#.....#...#...#...#...#.#
#.#########.#########.###.#.#.#.###.#.#.#.#.#######.#.###.#.#.###.#.###########.#.#.#.###############.#.###############.#.#######.###.#.###.#
#.#.......#.#.........#...#.#.#.....#.#.#...#...#...#...#.#.#...#.#...#.#.....#...#...#...#.......#.....#.........#.....#.#.........#.#.....#
#.#.#####.#.#.###.###.#.#####.#.###.#.#.#.#.#.#.#.#####.#.#.###.#.###.#.#.###.#########.#.#.#####.#.#####.#######.#.#.###.#.#####.###.###.#.#
#.........#...#.#.#...#.#.....#.......#.#.#.#.#.#.....#...#.....#.#.#.#.#.#.........#...#...#...#...#.....#...#...#.#...#...#...#.#...#...#.#
###.#######.###.#.#.###.#.#####.#######.#.###.#.#####.#######.#.#.#.#.#.#.#.#######.#.#.###.###.#####.#######.#.###.###.#.###.#.###.###.###.#
#...#.....#...#.#.#.#...#...#.#.........#.#...#.....#...#.....#.#.#.#.#...#.#.....#.#.#...#.....#.#...#.....#...#.....#.#.#...#.....#...#.#.#
#.###.###.###.#.#.#.#.#####.#.#.#######.#.#.#.#.#######.#.#####.#.#.#.#####.###.#.#.#.###.#####.#.#.#.#.###.#.###.###.#.#.#.#######.#.###.#.#
#...#.#.#...#...#.#.#.#.....#...#.....#.#.....#.......#.#.#...#...#.#.......#...#.#...#.#.....#.#...#...#.#.........#.#.#.#.#.#.............#
###.#.#.###.###.#.###.#.#####.###.###.#.#########.#.#.#.#.#.#.#####.#########.###.#####.#####.#.#####.###.#.#######.###.#.#.#.#.#.#.#.###.#.#
#...#.#.#...#.#.#.......#...#.#.......#...#.....#...#.#...#.#.................#...........#...#.#...#.#...#...#...#.....#.#.#.......#...#...#
#####.#.#.###.#.#########.#.#.#.###.#######.###.#.###.#####.#########.#################.###.###.#.#.#.###.###.#.#.#########.#.###.#.###.###.#
#.......#...#...#.........#.#.#.#.....#.....#...#...#.......#.........#...#.....#...#...#...#...#.#.#.....#...#.#...........#.#.#.#...#...#.#
#.#########.#.###.#########.#.#.#####.#.#####.###############.#######.#.#.#.###.###.#.###.###.###.#.#####.#.###.###.#########.#.#.###.###.###
#.#...#.....#...#...#.#.....#.#...#.#...#.............#.....#.....#...#.#.#...#...#.#...#...#.....#...#...#.#...#...#...#...#...#.#...#.#...#
#.#.#.#.#####.#.###.#.#.#####.###.#.#####.###########.#.###.#####.#####.#.###.###.#.#.#####.#########.#.###.#.###.###.#.#.#####.#.#.###.###.#
#.#.#.#.........#.....#.#.....#...#.....#.#.#.......#...#.#.#...#.......#...#.#...#...#...#.......#.......#.#.#...#...#.#.......#.......#.#.#
#.###.###.###.#.#.###.#.###.###.#.#####.#.#.#.#.###.#####.#.#.#.###.#####.###.#.#####.#.#.#######.###.#####.#.#.###.###.###############.#.#.#
#...#.#.......#.#...#.....#.#...#.#...#.....#.#...#.....#.#...#...#...#...#...#.....#...#.......#...#.......#.#.#...#.....#...........#...#.#
###.#.#.#.###.#.###.#####.###.#####.#.#######.###.#####.#.#######.#####.###.#.#####.###.#.#####.###.#######.#.###.#######.#.#.#######.#####.#
#.#.#.#...#...#.#.#...#.....#.#.....#.#...#...#.......#.#.......#.....#.....#.....#.....#...#.....#...#.....#...#.......#.....#...#.#.....#.#
#.#.#.###.#.#.#.#.###.###.#.#.#.#####.#.#.#.###.###.###.#.#####.#####.#.#####.#.#.###.###.#.#.###.#.#.#.###.###.#####.#.#.#####.#.#.#####.#.#
#...................#.....#...#.....#...#.....#.#...#...#.#...#.....#.#...#...#.#.#...#...#...#.....#...#...........#.#.#.#.....#...........#
#.###.#.#.###.#####.#####.#.#######.#########.#.#####.###.#.#.#####.#.###.#####.#.###.#.#.#########.#####.###########.#.#.#.#####.#.#.#####.#
#.#.#...#.........#...#...#.#.......#.....#.....#.....#...#.#.#...#.....#.......#.#...#.#.#.......#.......#.......#...#.#.#...#.#.#.#.....#.#
#.#.#.#.#.###.###.#####.#####.#######.###.#.###.#.#####.###.#.#.#.#####.#########.#.#.#.###.#####.#.#####.#.#####.#.###.#.###.#.#.#.#####.#.#
#.#...#.......#...#...#.......#.......#.#.#.....#.#.....#...#...#.....#.....#.....#.#.#.....#.....#.#.........#...........#.#.#.#.#.....#...#
#.#.###.#.###.#.###.#.#########.#######.#.#.#####.#######.###########.#####.#####.#.#########.#####.#.#######.###########.#.#.#.#.###.#.###.#
#.#...#.#.....#.....#.........#.#.......#.#.....#.#.....#.......#...#.....#.....#.#.......#...#...#.#.......#...#...#...#.#.#.#.#...#.#.#...#
#.###.#.#.#.#.###.#######.#.###.#.#####.#.#####.#.#.###.#.#.###.#.###.###.#####.#.#.#.###.#.###.#.#########.###.#.#.#.#.#.#.#.#.###.#.###.###
#...#.#.#...........#.....#.#...#.#.#...#.....#.#...#...#.#.#.#.#.#.....#.#...#.#...#...#.#.....#.........#.#...#.#...#.#...#...#.#.#.....#.#
###.#.#.#.###.###.#.#.#######.###.#.#.#.#####.#.#####.#.#.#.#.#.#.#.###.#.#.###.#.#.###.#.#############.###.#.###.#####.#######.#.#.#.#####.#
#.................#.#.....#...#...#.#.......#.#.#.....#.#...#.#.#.#.#.#.#.#...#.#.#...#.....#.....#...#...#.#...#...#...#...#...#.#.#.......#
#.#.###.#.###.#.#########.#.###.#.#.#######.#.###.###########.#.#.#.#.#.#.###.#.#.###.###.#.#.###.#.#.###.#.###.#.###.###.#.#.###.#.#.###.#.#
#.#...#.#.#...#.#.........#.#...#.#.........#.....#...#...#...#.#.#.#.#.#.#...#.#.#.....#.#...#.#...#...#...#.#.#.#...#.......#...#.#.....#.#
#.###.#.#.#.#.#.#.#####.#.#.#.###.###.#.#########.#.#.#.#.#.#.#.#.#.#.###.#.#.#.#.#####.#.#.###.#######.#####.#.#.#.###.#######.#.#.#######.#
#...#.#...#.#.........#...#.#.#.#...#...#.....#...#.#...#...#.....#.#.....#...#.#...#...#...#.....#.....#.....#...#.....#.....#.#.#.#.......#
#.###.#.#.#.###.#####.#.###.#.#.###.###.#.###.#.###.###########.#.#.#.#.###.###.###.#######.#.#####.#####.#.#####.#######.###.#.#.#.#.#.#####
#.#...#...#.#.#...#...#...#.#.....#...#...#...#...#...............#.....#...#...#...........#.#...#...#.#.#...........#.#...#...#.#.#.......#
#.#.#####.#.#.###.#.#####.#.#.#####.#.###########.###.#######.###.#########.#.###############.#.#.###.#.#.#########.#.#.#.#.###.###.###.###.#
#...#.....#.#.....#.....#.#.#.#...#.#.............#...#...#...#.#.#.........#.........#.........#...#.#...........#.#.#.....#...#...#.....#.#
#.#####.#.#.###.#######.###.###.#.###############.#.###.#.#.#.#.#.#.#.###############.###########.###.#.#####.#####.#.#####.#####.###.#.###.#
#.#.....#.#...#...#...#...#.....#.....#.........#.#...#.#...#...#...#.#.............#...#.............#.#...#.....#.#.......#...#.#.#.#...#.#
#.#.#####.#.#.###.#.#.###.###########.#.#######.#####.#.#####.###.#.#.#.###########.###.#.#####.###.#####.#.#.###.#.#########.#.#.#.#.#.#.#.#
#...#...........#.#.#.#.#...........#...#...#.#.......#.#.#.......#.#...#.........#.....#.....#...#...#...#...#.#...#.........#.#.#.#.#.#...#
#####.#.#.#.###.#.#.#.#.#.#.###.###.#####.#.#.#########.#.#.#######.###.#####.###.###########.###.###.#.#######.#.###.#########.#.#.#.#.#####
#.............#...#.#...#...#.#.#...#.....#...#.........#.........#...#.....#...#...#...#...#...#.#.....#.....#.#.#...#.......#...#.#...#...#
#.#.#####.#.###.###.#########.#.#.#####.#######.###.#############.###.###.#.#####.#.#.#.#.#.###.#.#####.#.###.#.#.#.###.#.#######.#.###.###.#
#.#.#.....#.#...#.............#.#.#...#...#.......#.....#.......#.#.#.....#.......#.#.#...#.#...#.#...#.#.....#...#.#...#.#.....#.....#.#...#
#.###.###.#.#.###.#.###.#.#####.#.#.#.###.#.###########.#.#####.#.#.#############.#.#.#####.#.###.#.#.###.#.###.###.#.###.#.###.#.#.###.#.#.#
#...#.#.#.#...#.....#...#.#.....#...#.#...#.#...#.....#.#...#...#...#.....#.......#.....#.#...#...#.#.....#...#...#.#.#...#.#.#...#...#...#.#
###.#.#.#.#.#########.###.#.#########.#.#.#.###.#.###.#.###.#.#####.#.###.#.###.###.###.#.#####.###.#########.#####.#.#####.#.###.###.#.#.#.#
#...#...#.#.#.......#.#.......#.....#.#.#.#...#.#...#.....#.#...#.....#...#...#.....#...#.#.........#.......#.....#.#.#.....#.....#.#...#...#
#.###.###.#.###.###.#.#.#####.#.###.#.#.#.###.#.###.#######.###.#############.#######.###.#.#########.#####.#####.#.#.#.#####.###.#.#.#.#.###
#...#.#...#...#...#...#.#...#.#...#.....#.#.#.#...#.......#...#...........#...#.......#...#.#...#.........#.....#.....#.......#.....#.#.#.#.#
#.#.#.#.#####.###.#####.#.#.#.###########.#.#.###.#######.###.#######.###.#.#########.#.###.#.#.#.#########.#.#######.###.#.#####.#.#.#.#.#.#
#.#...#.....#...#...#.....#.#.......#...#...#...#.......#.....#.......#...#.......#...#.....#.#.#...#.......#.......#.....#.....#...#.....#.#
#.#######.#####.#.#.#######.#######.#.#.#######.#.#####.#############.#.#########.#.#.#####.#.#.###.#.#########.#.###.###.#.###.#.#####.#.#.#
#.#.....#.#...#.#.#.#...#...#.....#...#.#.......#.#.....#.............#.........#.#...#...#...#...#.#...#.......#...#.#...#.#...#.......#...#
#.###.###.#.#.#.#.#.#.#.#####.###.#####.#.#######.#####.#####.#.#.#.#.#######.###.#.###.#.###.#.#.#.###.#.###.#.###.#.#.#.#.#.#########.#.#.#
#...#...#.#.#.#.#.#...#...#...#.#...#...#...#.#...#...#.#.....#...#.#.#.#.....#...#...#.#.......#.#...#.#...#.#.....#.#.#...#.......#.#.....#
###.###.#.#.#.#.#.#######.#.###.#.###.#####.#.#.#.#.#.#.#.#####.###.#.#.#.#.###.###.#.#.#########.###.#.###.#.#.#.###.#####.#######.#.###.#.#
#.#...#.#...#...#.#.....#...........#.....#.....#...#.#.#.#.#...#...#...#.#.#...#...#.......#.....#...#...#.#...#...#.....#.#.#.....#.....#.#
#.#.#.#.#####.###.#####.###########.###.###.#.###.#.#.#.#.#.#.#####.###.#.###.###.###########.#########.#.#.#######.#####.#.#.#.#####.#####.#
#...#.#...#.....#...#.....#.....#.....#.#...#.#.#...#.#.............#...#.....#.#.....#.#.....#.........#.#.#.....#.......#...#.#.....#.....#
#.#.#.#.###.###.###.#.#####.###.#.###.#.#.###.#.#####.#####.###################.#####.#.#.#####.#######.###.#.#.###############.#.###.#.#####
#.#.#.#...#...#.#.....#...#...#...#...#...#.......#...#.....#.#...........#.........#.#.#.#.....#.......#...#.#...............#.#.#...#.#...#
#.#.#.###.###.#.#.#####.#.###.#####.###############.###.###.#.#.#.#####.###.#######.#.#.#.###.#######.###.#########.#########.#.#.#.###.###.#
#.#.#...#.....#...#.....#.....#...#.......#.......#.#.........#.#.........#.#.....#...#.#...#...#...#.#.#.......#...#.......#...#.#...#.#...#
#.#####.#.#####.###.#.#########.#########.#.#####.#.#.#####.#.#.###.#####.#.#.#.#.#####.###.#.#.#.#.#.#.#.#.#.#.#.###.###########.###.#.#.#.#
#.#.....#.#...#...#...#.#...#...........#.#.....#...#...#...#.#...#.....#...#.#.#.......#...#.#...#.#...#.#.#...#...#.#.........#.#.#.#...#.#
#.#.#######.#.###.###.#.#.#.#.#######.#.#.#####.#######.#.###.###.#####.#######.#######.#.###.#####.#.###.#.#.#.###.#.#.#######.#.#.#.#####.#
#...#.......#.#.....#.#...#.#.#.#...#.#.#.....#.....#.#...#...#.#...............#...#...#.#.#...#...#.#.....#.....#.#...#.....#...#.#.....#.#
#.#####.#####.#####.#.#.#.#.#.#.#.#.#.#.#####.#.###.#.#.###.###.#####.#########.#.#.#####.#.#.#.#.###.#.###.#####.#.#.###.#.#.#####.###.###.#
#.......#...#...#...#.#...#.#.#.#.#.#.#...#...#...#.#.....#...#.#...#.......#.....#...#...#.....#...#.#...#.....#.#.#.....#.#.....#...#.#...#
#########.#.###.#####.#.###.#.#.#.#.#.#####.#######.#.###.###.#.#.#.#.#.###.#.###.###.#.###.#######.#.###.#####.#.#.#######.#####.#.#.#.#.###
#...#.....#...#...#...#.#.#.....#.#...#...........#.#...#...#...#.#...#.#...#.#.....#.#.#.#.#.....#.#.....#.....#.#...#...........#.#.#.....#
#.#.#.#####.#.###.#.###.#.#.#####.###.#.#.###.#.#.#.###.#.###.###.#####.###.#.#.#.###.#.#.#.###.#.#.###.#.#.#.###.###.#######.#.#.#.#.#.###.#
#.#.#.#...#.#...#.#.#.#.#...#.....#...#.....#.#.#.#...#.#...#.#...#...#...#.#.#.#...#.#.#...#...#.#...#.#.#...#.#...#.#.......#.....#.#...#.#
#.###.#.###.#####.#.#.#.###.#.#############.#.#.#.###.###.#.#.#.#####.###.#.#.#.###.#.#.#.###.#.#####.#.#.#.#.#.###.#.#.#####.#######.###.#.#
#.....#...#.#...#...#.#.#...#...#...#...#...#...#...#...#.#...#.......#...#...#...#...#.#.#...#.#...#.#.#.#.#.#...#.#...#...#.....#...#...#.#
#.#######.#.#.#.#####.#.#.#.###.#.#.#.#.#.###.#####.###.###########.###.#########.#####.#.#.###.#.#.#.###.###.#.#.#.#.###.#.#####.#####.###.#
#.........#...#.......#.#.#...#...#.#.#...#.....#.....#.....#...#...#...#.......#.......#...#.....#.#...#.....#.#.#.#.#...#.......#...#.....#
#####.#######.###.###.#.#.###.#####.#.#####.###.#####.#####.#.#.#.###.###.#####.#############.#####.#.#.#######.###.#.###.#####.#.#.#.#####.#
#...#.#.....#...#...#.#.#.#...#...#.#.....#...#.....#.......#.#...#...#.......#.#...........#...#.#.#.#.......#.....#...#.....#.#...#.....#.#
#.#.#.#.###.#######.###.#.#####.#.#.#####.#.#######.#######.#.#####.###.#####.###.#####.###.###.#.#.#####.###.#.#######.#####.#.#######.#.#.#
#.#...#.#...#.....#.#...#.......#.#.......#.#.....#.....#...#.#...#.#.....#...#.........#...#...#.#.......#...#.....#.........#...#...#.#.#.#
#.#####.#.###.###.#.#.###########.###########.#.#.#.#.###.###.#.#.#.#####.#.###.#####.#.#.###.###.#.###############.#.#######.#####.#.###.#.#
#.....#.#.#...#.....#...........#.......#.....#...#.#...#...#.#.#.#...#...#.....#...#.#.#...#.#.....#.......#.....#.#.#...#...#...#.#.#...#.#
#####.#.#.###.#.###.###.#.#####.#.#####.###.###.###.#.#.###.#.###.#.#.#.#.#######.#.###.###.#.#.#####.#####.#.#.#.#.###.#.#.###.#.#.#.#.#.#.#
#...#.#.#.....#.#.........................................#.#...#...#...#.....#...#.....#...#.#.#...#.#...#.#.#.#.#...........#.#...#...#.#.#
#.#.#.#.#####.###.#.###.#.###.#.#.#.#########.#.#.#.#.###.#.###.###.###.#####.#.#########.###.#.###.#.#.#.#.#.#.#####.#.#.#####.#########.#.#
#.#...#.#.....#...#.....#.#...#...#.........#.#.....#...#...#...#.....#.....#.#...#.....#.....#.#...#...#.#...#.....#...#.#.....#.......#...#
#.#####.#.#####.###.#.#.#.#########.###.#####.#.#.###.###.###.###.#.#######.#.###.#.#.#########.#.#.###.#.#######.#.#####.#.#####.###.###.###
#.....#.#.....#.....#.#.#...#.....#...#.....#...#.......#.#...#...#.........#.#.#.#.#.........#...#.....#.....#...#...#.#.#...#.....#...#...#
#####.#.###########.#.#.#.#.#.###.###.#####.###.#.###.#.###.#####.#.#.#.#####.#.#.#########.#.#.###.###.#.#.###.#####.#.#.###.#.#######.###.#
#.....#...#.......#.#.#...#.#...#.#...#.#...#...#...#.#.#...#.....#.#.#.....#.#.#.........#.#...#.......#...............#.....#.#...#...#...#
#.#######.#.#.###.#.#.#.#.#.###.#.#.###.#.###.#.#.#.#.#.#.#####.#.#.###.###.#.#.#########.#.###.#.###.#.###.#.###.#.###.#########.#.#.#.#.###
#.#.......#.#...#...#...#.#...#.#.#...#.#.....#...#.#.#.........#.#.......#.#.#...........................#.#...#.#.........#.....#...#.#.#.#
#.#.#######.#.#.#####.#.#.#.#.#.#.###.#.#######.#.#.#.#.###########.###.###.#.#.###.#.#########.#######.#.#.###.#.#.#######.#.#####.#####.#.#
#.#.#.......#.....#...#.#.#.#...#...............#.#.#.............#...#.#...#.#...#.#.#.......#.........#.......#.#.....#.....#.....#...#.#.#
#.#.#.#######.###.#####.#.#.#######.#.#####.###.#.#.#.#.#########.#.#.#.#.###.###.#.#.#.#####.#.#####.#####.###.#.#.###.#############.#.#.#.#
#S#...........#.........#.........#.........#.........#.............#.....#.......#.#.......#.......#...........#.....#...............#.....#
#############################################################################################################################################