#include <bits/stdc++.h>
using namespace std;
int dp[200500];
vector<int> g[200500];
set<int> ss[200500];
int n;
vector<int> ans;
int currans = 1 << 29;
int curr = 0;
int used[200500];
void solve(int v) {
  for (int i = 0; i < g[v].size(); i++) {
    int to = g[v][i];
    if (dp[to] == -1) {
      if (ss[v].find(to) != ss[v].end()) {
        dp[to] = dp[v] + 1;
      } else
        dp[to] = dp[v] - 1;
      solve(to);
    }
  }
}
void dfs(int v) {
  used[v] = 1;
  for (int i = 0; i < g[v].size(); i++) {
    int to = g[v][i];
    if (used[to] == 0) {
      if (ss[v].find(to) == ss[v].end()) curr++;
      dfs(to);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= 200000; i++) used[i] = 0, dp[i] = -1;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    ss[a].insert(b);
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(1);
  dp[1] = curr;
  solve(1);
  for (int i = 1; i <= n; i++) {
    if (dp[i] < currans) {
      ans.clear();
      ans.push_back(i);
      currans = dp[i];
    } else if (dp[i] == currans) {
      ans.push_back(i);
    }
  }
  cout << currans << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  return 0;
}
