def parse_command(line):
    """Parses a single line of the input file into a (horizontal, depth) tuple,
    signifying the submarine's movement."""
    direction, distance = line.split()
    distance = int(distance)
    match direction:
        case "up":
            return (0, -distance)
        case "down":
            return (0, distance)
        case "forward":
            return (distance, 0)
        case _:
            raise ValueError(f"Unknown command: {direction}")