PROGRAMMING:Graph depth first traversal
Write a program for a given digraph (not necessarily connected) depth first traversal, the graph contains n vertices, numbered 0 to n-1. This problem is limited in the process of depth first traversal. If there are multiple vertices to be visited at the same time, the one with the smallest number is preferred to visit, and vertex 0 is the starting point of traversal.
###Input format:
Enter two integers n and E in the first line to represent the number of vertices and edges of the graph, where n does not exceed 20000 and E does not exceed 50. Next, line e represents the information of each edge, and each line contains two integers a and B, representing the endpoint number of the edge, but the edges are not arranged in the order of endpoint number.
###Output format:
The output is a row of integers with a space after each integer, that is, the depth first traversal node sequence of the digraph.
###Input sample 1:
```in
3 3
0 1
1 2
0 2
```
###Output sample 1:
```out
0 1 2
```
###Input sample 2:
```in
4 4
0 2
0 1
1 2
3 0
```
###Output sample 2:
```out
0 1 2 3
```
answer:If there is no answer, please comment
###Input format:
Enter two integers n and E in the first line to represent the number of vertices and edges of the graph, where n does not exceed 20000 and E does not exceed 50. Next, line e represents the information of each edge, and each line contains two integers a and B, representing the endpoint number of the edge, but the edges are not arranged in the order of endpoint number.
###Output format:
The output is a row of integers with a space after each integer, that is, the depth first traversal node sequence of the digraph.
###Input sample 1:
```in
3 3
0 1
1 2
0 2
```
###Output sample 1:
```out
0 1 2
```
###Input sample 2:
```in
4 4
0 2
0 1
1 2
3 0
```
###Output sample 2:
```out
0 1 2 3
```
answer:If there is no answer, please comment