topological sort(DFS)