def METHOD_NAME(node_to_pages, outpath):
    with open(outpath, 'w') as outfile:
        writer = csv.writer(outfile)
        writer.writerow(['ott', 'eol'])
        for node in sorted(node_to_pages.keys(), key=lambda node:int(node.id)):
            writer.writerow([node.id, node_to_pages[node][0]])