def topologicalSort(self):
    visited = ([False] * self.V)
    stack = []
    for v in range(self.V):
        if (visited[v] == False):
            self.topologicalSortUtil(v, visited, stack)
    return stack[::(- 1)]
def topologicalSort(self):
    visited = ([False] * self.V)
    stack = []
    for v in range(self.V):
        if (visited[v] == False):
            self.topologicalSortUtil(v, visited, stack)
    return stack[::(- 1)]