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 parents[v] is None and child > 1: aps[v] = True

            if parents[v] is not None and est[i] >= dts[v]: aps[v] = True



        elif parents[v] != i:

            est[v] = min(est[v], dts[i])





nv, ne = list(map(int, input().split(' ')))

adj = [[] for _ in range(nv)]

est = [float('inf')] * nv

parents = [None] * nv

aps = [False] * nv

dts = [0] * nv



for _ in range(ne):

    s, t = list(map(int, input().split(' ')))

    adj[s].append(t)

    adj[t].append(s)



dfs(0, 0)



for i in range(nv):

    if aps[i]:

        print(i)
from sys import stdin

import sys

from math import isinf

INF = float("inf")

sys.setrecursionlimit(100000)

def dfs(v, tm):

    dts[v] = est[v] = tm + 1

    child = 0

    for i in adj[v]:

        if isinf(est[i]):

            child += 1

            parents[i] = v

            dfs(i, tm + 1)

            est[v] = min(est[v], est[i])

            if parents[v] is None and child > 1: aps[v] = True

            if parents[v] is not None and est[i] >= dts[v]: aps[v] = True

        elif parents[v] != i:

            est[v] = min(est[v], dts[i])

n, m = list(map(int, stdin.readline().split()))

adj = [[] for _ in range(n)]

est = [float('inf')] * n

parents = [None] * n

aps = [False] * n

dts = [0] * n

for _ in range(m):

    s, t = list(map(int, stdin.readline().split()))

    adj[s].append(t)

    adj[t].append(s)

dfs(0, 0)

for i in range(n):

    if aps[i]:

        print(i)
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 parents[v] is None and child > 1:
                aps[v] = True
            if parents[v] is not None and est[i] >= dts[v]:
                aps[v] = True
        elif parents[v] != i:
            est[v] = min(est[v], dts[i])


nv, ne = list(map(int, input().split(" ")))
adj = [[] for _ in range(nv)]
est = [float("inf")] * nv
parents = [None] * nv
aps = [False] * nv
dts = [0] * nv
for _ in range(ne):
    s, t = list(map(int, input().split(" ")))
    adj[s].append(t)
    adj[t].append(s)
dfs(0, 0)
for i in range(nv):
    if aps[i]:
        print(i)

from sys import stdin
import sys
from math import isinf

INF = float("inf")
sys.setrecursionlimit(100000)


def dfs(v, tm):
    dts[v] = est[v] = tm + 1
    child = 0
    for i in adj[v]:
        if isinf(est[i]):
            child += 1
            parents[i] = v
            dfs(i, tm + 1)
            est[v] = min(est[v], est[i])
            if parents[v] is None and child > 1:
                aps[v] = True
            if parents[v] is not None and est[i] >= dts[v]:
                aps[v] = True
        elif parents[v] != i:
            est[v] = min(est[v], dts[i])


n, m = list(map(int, stdin.readline().split()))
adj = [[] for _ in range(n)]
est = [float("inf")] * n
parents = [None] * n
aps = [False] * n
dts = [0] * n
for _ in range(m):
    s, t = list(map(int, stdin.readline().split()))
    adj[s].append(t)
    adj[t].append(s)
dfs(0, 0)
for i in range(n):
    if aps[i]:
        print(i)

+from sys import stdin +from math import isinf +INF = float("inf") -        if est[i] == float("inf"): +        if isinf(est[i]): -nv, ne = list(map(int, input().split(" "))) -adj = [[] for _ in range(nv)] -est = [float("inf")] * nv -parents = [None] * nv -aps = [False] * nv -dts = [0] * nv -for _ in range(ne): -    s, t = list(map(int, input().split(" "))) +n, m = list(map(int, stdin.readline().split())) +adj = [[] for _ in range(n)] +est = [float("inf")] * n +parents = [None] * n +aps = [False] * n +dts = [0] * n +for _ in range(m): +    s, t = list(map(int, stdin.readline().split())) -for i in range(nv): +for i in range(n):