#include <bits/stdc++.h>
using namespace std;
vector<int> v[200010];
map<pair<int, int>, bool> m;
bool viz[200010];
pair<int, int> pas[200010];
int cnt = 0;
void dfs(int nod) {
  viz[nod] = 1;
  for (int i = 0; i < v[nod].size(); i++) {
    if (!viz[v[nod][i]]) {
      if (!m[{nod, v[nod][i]}]) {
        cnt++;
        pas[v[nod][i]].second = pas[nod].second + 1;
      } else
        pas[v[nod][i]].second = pas[nod].second;
      pas[v[nod][i]].first = pas[nod].first + 1;
      viz[nod] = 1;
      dfs(v[nod][i]);
    }
  }
}
int main() {
  int n, a, b;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
    m[{a, b}] = 1;
  }
  dfs(1);
  int mi = 100000000;
  for (int i = 1; i <= n; i++)
    mi = min(mi, cnt - 2 * pas[i].second + pas[i].first);
  cout << mi << "\n";
  for (int i = 1; i <= n; i++)
    if (mi == cnt - 2 * pas[i].second + pas[i].first) cout << i << " ";
  return 0;
}
