def topologicalSort(self):
    visited = ([False] * self.v)
    stack = []
    for x in range(self.v):
        if (not visited[x]):
            self.topologicalSortUtil(x, visited, stack)
    print(('stack = ' + str(stack)))
    return stack[::(- 1)]
def topologicalSort(self):
    visited = ([False] * self.v)
    stack = []
    for x in range(self.v):
        if (not visited[x]):
            self.topologicalSortUtil(x, visited, stack)
    print(('stack = ' + str(stack)))
    return stack[::(- 1)]