#include<bits/stdc++.h> usingnamespace std; #define M 200007 #define N 20007 #define INF 0x3f3f3f3f #define mod 99999997 #define ll long long #define db double #define pii pair<int, int> int n, m; typedefstructedge { int from, to, link; } Edge; typedefstructnode { int id; } Node; typedefstructgraph { int head[N]; int node_num = 0; Node p[N]; int edge_num = 0; Edge e[M]; } Graph; Graph g; voidadd_edge(int from, int to){ g.e[++g.edge_num].to = to; g.e[g.edge_num].from = from; g.e[g.edge_num].link = g.head[from]; g.head[from] = g.edge_num; } int cut[N], cnt; int dfn[N], low[N], id; voidtarjan(int step, int root){ low[step] = dfn[step] = ++id; int child = 0; for (int k = g.head[step]; k != -1; k = g.e[k].link) { int v = g.e[k].to; if (!dfn[v]) { tarjan(v, root); low[step] = min(low[step], low[v]); if (low[v] >= dfn[step] && step != root) { cut[step] = 1; } if (step == root) { child++; } } low[step] = min(low[step], dfn[v]); } if (child >= 2 && step == root) { cut[step] = 1; } } intmain(){ ios::sync_with_stdio(false); cout.tie(NULL); memset(g.head, -1, sizeof(g.head)); cin >> n >> m; int u, v; for (int i = 1; i <= m; i++) { cin >> u >> v; add_edge(u, v); add_edge(v, u); } for (int i = 1; i <= n; i++) { if (!dfn[i]) { tarjan(i, i); } } for (int i = 1; i <= n; i++) { if (cut[i]) { cnt++; } } cout << cnt << endl; for (int i = 1; i <= n; i++) { if (cut[i]) { cout << i << " "; } } return0; }