#!/usr/bin/env python3 import sys from heapq import heappop, heappush from math import lcm def parse(inp): blizzards = {} DELTA = (1, 0), (-1, 0), (0, 1), (0, -1) for y, line in enumerate(inp): for x, cell in enumerate(line.rstrip()): if cell not in '#.': d = DELTA['>