// see https://github.com/LumaKernel/vimfiles/tree/master/snippets/cp-cpp/temp.snip
/// --- .lumrc Template {{{ ///
#if 0
#define assert(...)
#endif
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using P = tuple<ll, ll>;
using P3 = tuple<ll, ll, ll>;
using VI = vector<int>;
using VL = vector<ll>;
using VVI = vector<VI>;
using VVL = vector<VL>;
using VP = vector<P>;
using VVP = vector<VP>;
using VP = vector<P>;
using VS = vector<string>;

#define omajinai ios::sync_with_stdio(false);cin.tie(0)

#define FOR(i,a,b) for(int i=int(a);i<int(b);++i)
#define FORI(i,a,b) for(int i=int(a);i<=int(b);++i)
#define REP(i,n) FOR(i,0,n)
#define REPI(i,n) FORI(i,0,n)
#define RFOR(i,a,b) for(int i=int(b)-1;i>=int(a);--i)
#define RFORI(i,a,b) for(int i=int(b);i>=int(a);--i)
#define RREP(i,n) RFOR(i,0,n)
#define RREPI(i,n) RFORI(i,0,n)

#define ALL(a) (a).begin(),(a).end()
#define UNIQUE(a) (a).erase(unique(ALL(a)),(a).end())
#define PB push_back
#define EACH(i,c) REP(i,(c).size())
#define REACH(i,c) RREP(i,(c).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(ALL(c))

#define BR cout<<"\n";

#ifdef DEBUG
#define dump(...) cerr<<"["<<__LINE__<< "] "<<#__VA_ARGS__<<" = "<<make_tuple(__VA_ARGS__)<<"\n";
#else
#define dump(...)
#endif

#define YES(x) cout<<((x)?"OK":"NG")<<"\n";
#define Yes(x) cout<<((x)?"Yes":"No")<<"\n";
#define yes(x) cout<<((x)?"yes":"no")<<"\n";

inline int omajinai_int_in(){omajinai;int n;cin>>n;return n;}
inline ll omajinai_ll_in(){omajinai;ll n;cin>>n;return n;}
inline string omajinai_string_in(){omajinai;string n;cin>>n;return n;}
inline int int_in(){int n;cin>>n;return n;}
inline ll ll_in(){ll n;cin>>n;return n;}
inline string string_in(){string n;cin>>n;return n;}
#define oini omajinai_int_in()
#define oinl omajinai_ll_in()
#define oins omajinai_string_in()
#define ini int_in()
#define inl ll_in()
#define ins string_in()

#define isInside(y,x) (0<=(y)&&(y)<h&&0<=(x)&&(x)<w)

#define fi(x) (get<0>(x))
#define se(x) (get<1>(x))
#define th(x) (get<2>(x))
#define fo(x) (get<3>(x))
#define fif(x) (get<4>(x))

template <typename T> ostream &operator<<(ostream &o, const vector<T> &v) { o << '{'; EACH(i, v) o << v[i] << (i != v.size()-1 ? ", " : ""); o << "}";  return o; }

template<int n, class...T> typename enable_if<(n>=sizeof...(T))>::type _ot(ostream &, tuple<T...> const &){}
template<int n, class...T> typename enable_if<(n< sizeof...(T))>::type _ot(ostream & os, tuple<T...> const & t){ os << (n==0?"":", ") << get<n>(t); _ot<n+1>(os, t); }
template<class...T> ostream & operator<<(ostream & os, tuple<T...> const & t){ _ot<0>(os, t); return os; }

template <typename T> inline void smax(T &a, T b) { a = a > b ? a : b; }
template <typename T> inline void smin(T &a, T b) { a = a < b ? a : b; }

template<typename T> int log2max(T x) {
  int res = 0;
  ll tmp = 1;
  while(tmp < x) tmp <<= 1, res++;
  return res;
}

constexpr double PI = acos(-1);

/// }}}--- ///


constexpr int INF = 1e9+1;
constexpr ll LINF = 1e18+1;
constexpr int MOD = 1e9+7;

/// --- Lowlink Library {{{ ///

// undirected graph
// count edges
// construct : (int size)
// do : calc()
struct Lowlink {
  struct Edge {
    int to, idx;
    Edge(int to, int idx): to(to), idx(idx) {}
  };
  int size;
  int edgeSize = 0;
  vector< vector< Edge > > g;
  VI ord, low;

  VI used;
  VI isBridge, isArticulation;
  Lowlink(int n): size(n), g(n), ord(n), low(n) {}

  void addEdge(int a, int b) {
    g[a].emplace_back(b, edgeSize);
    g[b].emplace_back(a, edgeSize);
    edgeSize++;
  }

  void calc() {
    used.assign(size, 0);
    isBridge.assign(edgeSize, 0);
    isArticulation.assign(size, 0);

    int k = 0;
    dfs(0, -1, k);
  }

  // p just means "just before"
  private :
  void dfs(int i, int p, int &k) {
    used[i] = 1;
    ord[i]=low[i]=k++;
    isArticulation[i] = 0;
    int DFSTreeDegree = 0;
    for(Edge edge : g[i]) {
      int j = edge.to;
      int idx = edge.idx;
      if(used[j]) {
        if(j != p) {
          // back edge
          smin(low[i], ord[j]);
        }
      } else {
        // on dfs-tree
        DFSTreeDegree++;
        dfs(j, i, k);
        smin(low[i], low[j]);
        isBridge[idx] = ord[i] < low[j];
        if(p != -1 && ord[i] <= low[j]) {
          isArticulation[i] = 1;
        }
      }
    }
    if(p == -1 && DFSTreeDegree > 1) {
      isArticulation[i] = 1;
    }
  }
};

/// }}}--- ///

// !! require Lowlink !!
/// --- 2-Edge Connected Component Decomposition Libary {{{ ///

// undirected graph
struct TwoEdge {
  Lowlink lowlink;
  VI comp;

  TwoEdge(Lowlink lowlink): lowlink(lowlink){
    decomposite();
  }

  VVI tree;
  VI used;

  private:
  void decomposite() {
    int size = lowlink.size;

    tree.resize(size);

    used.assign(size, 0);
    comp.assign(size, -1);

    int gid = 0;
    REP(i, size) if(!used[i]) dfs(i, gid++);

    tree.resize(gid);
  }

  void dfs(int i, int gid) {
    used[i] = 1;
    comp[i] = gid;
    for(auto edge : lowlink.g[i]) {
      int j = edge.to;
      int idx = edge.idx;
      if(lowlink.isBridge[idx]) {
        if(used[j]) {
          tree[gid].PB(comp[j]);
          tree[comp[j]].PB(gid);
        }
      }else if(!used[j]){
        dfs(j, gid);
      }
    }
  }
};

/// }}}--- ///

/// --- Doubilng Parent Library {{{ ///

// tree
struct DoublingParent {
  int size, logSize;
  VVI tree;
  VI depth; // 0-indexed
  VVI par; // for doubling
  DoublingParent(VVI tree): size(tree.size()), tree(tree) {
    calc();
  }

  private:
  void calc() {
    // calc log_2 size
    logSize = log2max(size);
    if(logSize == 0) logSize++;

    depth.assign(size, 0);
    par.assign(size, VI(logSize, -1));
    dfs(0);

    FOR(k, 1, logSize) {
      REP(i, size) {
        int p = par[i][k-1];
        if(p == -1) {
          par[i][k] = -1;
          continue;
        }
        par[i][k] = par[p][k-1];
      }
    }
  }

  void dfs(int i, int p = -1, int d = 0) {
    depth[i] = d;
    par[i][0] = p;
    for(int j: tree[i]) if(j != p) {
      dfs(j, i, d+1);
    }
  }

  public:
  int LCA(int a, int b) {
    if(depth[a] < depth[b]) swap(a,b);
    RREP(k, logSize) {
      int na = par[a][k];
      if(na == -1) continue;
      if(depth[na] < depth[b]) continue;
      a = na;
    }
    if(a==b) return a;
    RREP(k, logSize) {
      int na = par[a][k];
      int nb = par[b][k];
      if(na==nb) continue;
      a=na;b=nb;
    }
    return par[a][0];
  }
};

/// }}}--- ///

int main() {
  int n=ini, m=ini;
  Lowlink lowlink(n);
  REP(i, m) {
    int x=ini, y=ini;
    lowlink.addEdge(x, y);
  }
  lowlink.calc();
  REP(i, n) {
    if(lowlink.isArticulation[i])
      cout << i << endl;
  }
}

//



Measured memory_bytes: 5208