from pathlib import Path


def read_commands(path: Path) -> list[tuple[str, int]]:
    """Read sub commands from a file."""
    commands = []
    with open(path, "r") as file:
        for line in file.readlines():
            command, amount = line.split()
            commands.append((command, int(amount)))
    return commands