output_description: A list of _bridges_ of the graph ordered by name. For each bridge, names of
  its end-ponints, source and target (source < target), should be printed
  separated by a space. The sources should be printed ascending order, then the
  target should also be printed ascending order for the same source.
input_description: |V| |E|
      s0 t0
      s1 t1
      :
      s|E|-1 t|E|-1
      
  
  , where |V| is the number of nodes and |E| is the number of edges in the
  graph. The graph nodes are named with the numbers 0, 1,..., |V|-1
  respectively.
  
  si and ti represent source and target nodes of i-th edge (undirected).
attempt: import sys
  
  sys.setrecursionlimit(100000)
  
  
  def dfs(v, tm):
      dts[v] = est[v] = tm + 1
      child = 0
  
      for i in adj[v]:
          if est[i] == float("inf"):
              child += 1
              parents[i] = v
              dfs(i, tm + 1)
              est[v] = min(est[v], est[i])
  
              if est[i] > dts[v]:
                  bridges.append((v, i))
  
          elif parents[v] != i:
              est[v] = min(est[v], dts[i])
  
  
  nv, ne = map(int, input().split(" "))
  adj = [[] for _ in range(nv)]
  est = [float("inf")] * nv
  parents = [None] * nv
  dts = [0] * nv
  bridges = []
  
  for _ in range(ne):
      s, t = map(int, input().split(" "))
      adj[s].append(t)
      adj[t].append(s)
  
  dfs(0, 0)
  bridges.sort(key=lambda tup: (tup[0], tup[1]))
  [print(str(bridge[0]) + " " + str(bridge[1])) for bridge in bridges]
  
problem_description: Bridges
  
  Find bridges of an undirected graph G(V, E).
  
  A bridge (also known as a cut-edge) is an edge whose deletion increase the
  number of connected components.
samples: [{"input": "4 4\n    0 1\n    0 2\n    1 2\n    2 3", "output": "2 3"}, {"input": "5 4\n    0 1\n    1 2\n    2 3\n    3 4", "output": "0 1\n    1 2\n    2 3\n    3 4"}]