# Acceptance of input



import sys



f_i = sys.stdin



V, E = map(int, f_i.readline().split())



adj_sets = [set() for i in range(V)]



for l_i in f_i:

    s, t = map(int, l_i.split())

    adj_sets[s].add(t)

    adj_sets[t].add(s)





# dfs traverse



prenum = [0] * V

parent = [0] * V

lowest = [V] * V



import collections



path = collections.deque()

path.append(0)



cnt = 0



while path:

    u = path[-1]

    adj_v = adj_sets[u].copy()

    v_candidate = adj_v.difference(path)

    if v_candidate:

        v = v_candidate.pop()

        cnt += 1

        prenum[v] = cnt

        parent[v] = u

        path.append(v)

        adj_sets[u].remove(v)

        adj_sets[v].remove(u)

    else:

        l = min(prenum[u], lowest[u])

        for v in adj_v:

            l = min(l, prenum[v])

            adj_sets[u].remove(v)

            adj_sets[v].remove(u)

        lowest[u] = l

        p = parent[u]

        lowest[p] = min(l, lowest[p])

        path.pop()





# output



ans = set()



for u in range(1, V):

    p = parent[u]

    if prenum[p] <= lowest[u]:

        ans.add(p)



if parent.count(0) >= 3:

    ans.add(0)

else:

    ans.discard(0)



ans = list(ans)

ans.sort()



if ans:

    print(*ans, sep = '\n')

# Acceptance of input



import sys



f_i = sys.stdin



V, E = map(int, f_i.readline().split())



adj = [[] for i in range(V)]



for l_i in f_i:

    s, t = map(int, l_i.split())

    adj[s].append(t)

    adj[t].append(s)





# dfs traverse



prenum = [1] + [None] * (V - 1)

parent = [0] * V

lowest = [V] * V



import collections



path = collections.deque()

path.append(0)



cnt = 1



while path:

    u = path[-1]

    adj_v = adj[u]

    for v in adj_v:

        if not prenum[v]:

            parent[v] = u

            path.append(v)

            cnt += 1

            prenum[v] = cnt

            adj[u].remove(v)

            adj[v].remove(u)

            break

    if u == path[-1]:

        for v in adj_v:

            lowest[u] = min(lowest[u], prenum[v])

            adj[u].remove(v)

            adj[v].remove(u)

        p = parent[u]

        lowest[p] = min(lowest[u], lowest[p])

        path.pop()





# output



ans = set()



for u in range(1, V):

    p = parent[u]

    if prenum[p] <= lowest[u]:

        ans.add(p)



if parent.count(0) >= 3:

    ans.add(0)

else:

    ans.discard(0)



ans = list(ans)

ans.sort()



if ans:

    print(*ans, sep = '\n')

# Acceptance of input
import sys

f_i = sys.stdin
V, E = map(int, f_i.readline().split())
adj_sets = [set() for i in range(V)]
for l_i in f_i:
    s, t = map(int, l_i.split())
    adj_sets[s].add(t)
    adj_sets[t].add(s)
# dfs traverse
prenum = [0] * V
parent = [0] * V
lowest = [V] * V
import collections

path = collections.deque()
path.append(0)
cnt = 0
while path:
    u = path[-1]
    adj_v = adj_sets[u].copy()
    v_candidate = adj_v.difference(path)
    if v_candidate:
        v = v_candidate.pop()
        cnt += 1
        prenum[v] = cnt
        parent[v] = u
        path.append(v)
        adj_sets[u].remove(v)
        adj_sets[v].remove(u)
    else:
        l = min(prenum[u], lowest[u])
        for v in adj_v:
            l = min(l, prenum[v])
            adj_sets[u].remove(v)
            adj_sets[v].remove(u)
        lowest[u] = l
        p = parent[u]
        lowest[p] = min(l, lowest[p])
        path.pop()
# output
ans = set()
for u in range(1, V):
    p = parent[u]
    if prenum[p] <= lowest[u]:
        ans.add(p)
if parent.count(0) >= 3:
    ans.add(0)
else:
    ans.discard(0)
ans = list(ans)
ans.sort()
if ans:
    print(*ans, sep="\n")

# Acceptance of input
import sys

f_i = sys.stdin
V, E = map(int, f_i.readline().split())
adj = [[] for i in range(V)]
for l_i in f_i:
    s, t = map(int, l_i.split())
    adj[s].append(t)
    adj[t].append(s)
# dfs traverse
prenum = [1] + [None] * (V - 1)
parent = [0] * V
lowest = [V] * V
import collections

path = collections.deque()
path.append(0)
cnt = 1
while path:
    u = path[-1]
    adj_v = adj[u]
    for v in adj_v:
        if not prenum[v]:
            parent[v] = u
            path.append(v)
            cnt += 1
            prenum[v] = cnt
            adj[u].remove(v)
            adj[v].remove(u)
            break
    if u == path[-1]:
        for v in adj_v:
            lowest[u] = min(lowest[u], prenum[v])
            adj[u].remove(v)
            adj[v].remove(u)
        p = parent[u]
        lowest[p] = min(lowest[u], lowest[p])
        path.pop()
# output
ans = set()
for u in range(1, V):
    p = parent[u]
    if prenum[p] <= lowest[u]:
        ans.add(p)
if parent.count(0) >= 3:
    ans.add(0)
else:
    ans.discard(0)
ans = list(ans)
ans.sort()
if ans:
    print(*ans, sep="\n")

-adj_sets = [set() for i in range(V)] +adj = [[] for i in range(V)] -    adj_sets[s].add(t) -    adj_sets[t].add(s) +    adj[s].append(t) +    adj[t].append(s) -prenum = [0] * V +prenum = [1] + [None] * (V - 1) -cnt = 0 +cnt = 1 -    adj_v = adj_sets[u].copy() -    v_candidate = adj_v.difference(path) -    if v_candidate: -        v = v_candidate.pop() -        cnt += 1 -        prenum[v] = cnt -        parent[v] = u -        path.append(v) -        adj_sets[u].remove(v) -        adj_sets[v].remove(u) -    else: -        l = min(prenum[u], lowest[u]) +    adj_v = adj[u] +    for v in adj_v: +        if not prenum[v]: +            parent[v] = u +            path.append(v) +            cnt += 1 +            prenum[v] = cnt +            adj[u].remove(v) +            adj[v].remove(u) +            break +    if u == path[-1]: -            l = min(l, prenum[v]) -            adj_sets[u].remove(v) -            adj_sets[v].remove(u) -        lowest[u] = l +            lowest[u] = min(lowest[u], prenum[v]) +            adj[u].remove(v) +            adj[v].remove(u) -        lowest[p] = min(l, lowest[p]) +        lowest[p] = min(lowest[u], lowest[p])