#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using p = pair<int, int>;
const double pi(acos(-1));
const int inf(0x3f3f3f3f);
const int mod(1e9 + 7);
const int maxn(2e4 + 10);
const int maxm(2e5 + 10);
int ecnt, head[maxn];
int tim, dfn[maxn], low[maxn];
int ccnt;
bool cut[maxn];
struct edge {
int to, nxt;
} edges[maxm];
template<typename T = int>
inline const T read()
{
T x = 0, f = 1;
char ch = getchar();
while (ch < '0' || ch > '9') {
if (ch == '-') f = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9') {
x = (x << 3) + (x << 1) + ch - '0';
ch = getchar();
}
return x * f;
}
template<typename T>
inline void write(T x, bool ln)
{
if (x < 0) {
putchar('-');
x = -x;
}
if (x > 9) write(x / 10, false);
putchar(x % 10 + '0');
if (ln) putchar(10);
}
void addEdge(int u, int v)
{
edges[ecnt].to = v;
edges[ecnt].nxt = head[u];
head[u] = ecnt++;
}
void tarjan(int cur, int pre)
{
int child = 0;
dfn[cur] = low[cur] = ++tim;
for (int i = head[cur]; compl i; i = edges[i].nxt) {
int nxt = edges[i].to;
if (not dfn[nxt]) {
++child;
tarjan(nxt, cur);
low[cur] = min(low[cur], low[nxt]);
if (pre not_eq cur and low[nxt] >= dfn[cur] and not cut[cur]) {
++ccnt;
cut[cur] = true;
}
} else if (nxt not_eq pre) {
low[cur] = min(low[cur], dfn[nxt]);
}
}
if (pre == cur and child >= 2) {
++ccnt;
cut[cur] = true;
}
}
int main()
{
#ifdef ONLINE_JUDGE
#else
freopen("input.txt", "r", stdin);
#endif
ios::sync_with_stdio(false);
memset(head, -1, sizeof head);
int n = read(), m = read();
while (m--) {
int u = read(), v = read();
addEdge(u, v);
addEdge(v, u);
}
for (int i = 1; i <= n; ++i) {
if (not dfn[i]) {
tarjan(i, i);
}
}
write(ccnt, true);
for (int i = 1; i <= n; ++i) {
if (cut[i]) {
write(i, false);
putchar(32);
}
}
return 0;
}