output_description: A list of _articulation points_ of the graph G ordered by name.
input_description: |V| |E|
      s0 t0
      s1 t1
      :
      s|E|-1 t|E|-1
      
  
  , where |V| is the number of vertices and |E| is the number of edges in the
  graph. The graph vertices are named with the numbers 0, 1,..., |V|-1
  respectively.
  
  si and ti represent source and target verticess of i-th edge (undirected).
attempt: from sys import stdin
  
  n, m = map(int, stdin.readline().split())
  edges = [set() for _ in range(n)]
  for _ in [0] * m:
      s, t = map(int, stdin.readline().split())
      edges[s].add(t)
      edges[t].add(s)
  prenum = [None] * n
  parent = [None] * n
  lowest = [None] * n
  counter = 0
  
  
  def dfs(cur, prev):
      global counter
      prenum[cur] = lowest[cur] = counter
      counter += 1
      for edge in edges[cur]:
          if prenum[edge] is not None:
              if edge != prev:
                  lowest[cur] = min(lowest[cur], prenum[edge])
              continue
          parent[edge] = cur
          dfs(edge, cur)
          lowest[cur] = min(lowest[cur], lowest[edge])
  
  
  dfs(0, 1)
  ap = [False] * n
  r = 0
  for _ in filter(lambda x: x == 0, parent):
      r += 1
      if r > 1:
          ap[0] = True
          break
  for i in range(1, n):
      p = parent[i]
      if p and prenum[p] <= lowest[i]:
          ap[p] = True
  for i, e in enumerate(ap):
      if e:
          print(i)
  
problem_description: Articulation Points
  
  Find articulation points of a given undirected graph G(V, E).
  
  A vertex in an undirected graph is an articulation point (or cut vertex) iff
  removing it disconnects the graph.
samples: [{"input": "4 4\n    0 1\n    0 2\n    1 2\n    2 3", "output": "2"}, {"input": "5 4\n    0 1\n    1 2\n    2 3\n    3 4", "output": "1\n    2\n    3"}]