def fill_lines(text: str, width: int) -> str:
    """Add trailing whitespace to each line such that len(line) == width."""
    return '\n'.join(
        line + " " * (width - len(line))
        for line in text.split('\n')
    )