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