An undirected graph is given. Vertices are numbered from . Run depth first search from the given vertex . Print the timestamps d_v and f_v for each vertex in increasing order of vertices.
The first line contains the number of vertices n~(n \le 100) and the number of edges of the undirected graph. Each of the next lines contains two vertices and , denoting an undirected edge of the graph. The last line contains the starting vertex .
Run . Print the timestamps d_v and f_v for each vertex v~(v = 1, 2, ..., n). The timestamps for each vertex must be printed in a separate line, in the order of increasing vertex number.

Example 1
Example 2