#include "bits/stdc++.h"
using namespace std;
#define rep(i,N) for(int i=0;i<(int)N;++i)
#define rep1(i,N) for(int i=1;i<=(int)N;++i)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define SZ(x) (int)x.size()
#define e_b emplace_back
using ll = long long;
const ll LINF=1LL<<60;
const int INF=1<<30;

int V,E;
vector<vector<int>> G;

struct LowLink{
	const vector<vector<int>> &G;
	vector<int> ord,low,used;
	vector<pair<int,int>> bridge;
	vector<int> articulation;
	
	LowLink(vector<vector<int>> &g):G(g),ord(g.size()),low(g.size()),used(g.size()){}
	
	void dfs(int u,int par,int &k){
		ord[u]=low[u]=k++;
		used[u]=true;
		bool is_articulation=false;
		int cnt=0;
		for(auto &v:G[u]){
			if(!used[v]){
				cnt++;
				dfs(v,u,k);
				low[u]=min(low[u],low[v]);
				if(ord[u]<low[v]){
					bridge.e_b(u,v);
				}
				if(par!=-1&&ord[u]<=low[v]) is_articulation=true;
			}else if(v!=par){
				//back edge
				low[u]=min(low[u],ord[v]);
			}
		}
		if(par==-1&&cnt>1) articulation.e_b(u);
		else if(par!=-1&&is_articulation) articulation.e_b(u);
	}
	
	void build(){
		int k=0;
		for(int i=0;i<G.size();++i){
			if(!used[i]) dfs(i,-1,k);
		}
	}
};

int main(){
	cin>>V>>E;
	G.resize(V);
	rep(i,E){
		int s,t;
		cin>>s>>t;
		G[s].e_b(t);
		G[t].e_b(s);
	}
	
	LowLink lowlink(G);
	lowlink.build();
	
	sort(all(lowlink.articulation));
	for(auto &e:lowlink.articulation) cout<<e<<endl;
}
	

