def write_file(filename: str, file_contents: str) -> str:
    """Write file_contents to file filename, and return its name (filename)"""
    with open(filename, mode="w", encoding="utf8") as f:
        f.write(file_contents)
    return filename