The directed graph is given in the form of an adjacency list. Run a depth-first search on the graph. Print the timestamps d[v] and f[v] for each vertex v in ascending order of vertices.
The first line contains the number of vertices n (1≤n≤100). The next i-th line contains the number of edges adjacent to the i-th vertex and the vertex numbers.
Run a depth-first search on the graph. Print the timestamps d[v] and f[v] for each vertex v (v=1,2,...,n). Print the timestamps for each vertex on a separate line.