def parse_line(line:str) -> list[int]:
    """Take a line of joined directions and turn into a list of directions.
    0 = East, 1 = North-East, ..."""
    line = line.strip()

    directions = {"ne":"1", "nw":"2", "sw":"4", "se":"5", "e":"0", "w":"3"}
    for pattern, direction in directions.items():
        line = line.replace(pattern, direction)
    
    return list(map(int, line))