def reverseGraph(graph):
    v_unsorted = list(graph.graph.keys())
    v_sorted = sorted(v_unsorted, reverse=True)
    graph_rev = Graph()
    for v in v_unsorted:
        for u in graph.graph[v]:
            graph_rev.addEdge(u, v)
    return (graph_rev, v_sorted)
def reverseGraph(graph):
    v_unsorted = list(graph.graph.keys())
    v_sorted = sorted(v_unsorted, reverse=True)
    graph_rev = Graph()
    for v in v_unsorted:
        for u in graph.graph[v]:
            graph_rev.addEdge(u, v)
    return (graph_rev, v_sorted)