#include<iostream>
#include<vector>
#include<stack>
#include<cstring>
#include<cstdio>
using namespace std;
#define N 100010
vector<int>l[N],g[N];
int n,m,x,y;
int dfn[N],low[N],tc,scc[N],tot;
bool cutPoint[N],bridge[N];
void tarjan(int v,int fa){
dfn[v]=low[v]=++tc;
int child=0;
for(int i=0;i<l[v].size();i++){
int u=l[v][i];
if(!dfn[u]){
tarjan(u,v);
low[v]=min(low[v],low[u]);
if(low[u]>=dfn[v]&&v!=fa)cutPoint[v]=1;
if(v==fa)child++;
}
low[v]=min(low[v],dfn[u]);
}
if(child>=2&&v==fa)cutPoint[v]=1;
}
int main(){
cin>>n>>m;
for(int i=1;i<=m;i++){
cin>>x>>y;
l[x].push_back(y);
l[y].push_back(x);
}
//memset(low,0x7f,sizeof(low));//!!!!!!HERE
for(int i=1;i<=n;i++){
if(!dfn[i])tarjan(i,i);
}
for(int i=1;i<=n;i++){
if(cutPoint[i])tot++;
}
printf("%d\n",tot);
for(int i=1;i<=n;i++){
if(cutPoint[i])printf("%d ",i);
}
}