class Node
  attr_accessor :pre, :child, :lowest, :visited, :isArticulation
  def initialize
    @pre = nil
    @child = []
    @lowest = nil
    @visited = false
    @isArticulation = false
  end
end

def dfs(v, p, g)
  g[v].visited = true
  g[v].pre = g[v].lowest = $t
  $t += 1
  ct = 0
  isArticulation = false
  g[v].child.each{|i|
    if g[i].visited == false
      ct += 1
      dfs(i, v, g)
      g[v].lowest = [g[v].lowest, g[i].lowest].min
      isArticulation = true if (p > -1 && g[v].pre <= g[i].lowest)
#      $bridge << [v, i] if g[v].pre < g[i].lowest
    elsif i != p
      g[v].lowest = [g[v].lowest, g[i].pre].min
    end
  }

  isArticulation = true if p == -1 && ct > 1
  g[v].isArticulation = isArticulation
end


# def dfs(root, g)
#   stack = []
#   g[root].pre = g[root].lowest = $t
#   g[root].visited = true
# #  g[root].isArticulation = true if g[root].child.size > 1

#   stack << root
#   while stack.size > 0
#     n = stack[-1]
#     j = -1
#     g[n].child.each{|i|
#       if g[i].visited == false
#         j = i
#         $t += 1
#         g[i].pre = g[i].lowest = $t
#         g[i].parent = n
#         g[i].visited = true
#         g[n].child_in_t << i
#         g[n].lowest = g[i].lowest if g[i].lowest < g[n].lowest
#         stack << j
#         break
#       elsif i != g[n].parent
#         g[n].lowest = g[i].pre if g[i].pre < g[n].lowest
#       end
#     }
#     if j == -1
#       stack.pop
#       g[n].child.each{|i|
#         next if i == stack[-1]
#         g[n].lowest = g[i].lowest if g[i].lowest < g[n].lowest
#         g[n].isArticulation = true if n != root && g[n].pre <= g[i].lowest
#       }
#     end
#   end
#   g[root].isArticulation = true if g[root].child_in_t.size > 1
# end
$bridge = []
$t = 1
v, e = gets.split.map(&:to_i)
graph = Array.new(v){Node.new}
e.times{
  s, t = gets.split.map(&:to_i)
  graph[s].child << t
  graph[t].child << s
}

dfs(0, -1, graph)

# v.times{|i|
#   p graph[i]
# }

v.times{|i|
  if graph[i].isArticulation
    puts i
  end
}

# p $bridge