#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

const int INF = ~(1 << 31);

//articulation_point
vector< vector< int > > edge;
vector< int > dfs, lw;
vector< int > ap;
int v, e, s, t, cnt;
int root = 0;

int rec(int v){
	
	dfs[v] = cnt;
	++cnt;
	
	int lmin = INF;
	int lmax = 0;
	int count = 0;
	
	for(vector< int >::iterator it = edge[v].begin(); it != edge[v].end(); ++it){
		if(dfs[*it] == 0){
			int l = rec(*it);
			lmin = min(lmin, l);
			lmax = max(lmax, l);
			++count;
		}
	}
	
	if(v == root){
		if(count >= 2) ap.push_back(root);
	}else if(lmax >= dfs[v]) ap.push_back(v);
	
	for(vector< int >::iterator it = edge[v].begin(); it != edge[v].end(); ++it){
		lmin = min(lmin, dfs[*it]);
	}
	
	lmin = min(lmin, dfs[v]);
	lw[v] = lmin;
	
	return lw[v];
}

int main(){
	
	cin >> v >> e;
	edge.resize(v);
	dfs.resize(v);
	lw.resize(v);
	ap.clear();
	
	for(int i = 0; i < e; ++i){
		cin >> s >> t;
		edge[s].push_back(t);
		edge[t].push_back(s);
	}
	
	cnt = 1;
	
	rec(root);
	
	sort(ap.begin(), ap.end());
	
	for(vector< int >::iterator it = ap.begin(); it != ap.end(); ++it){
		cout << *it << endl;
	}
	
	return 0;
}