#include <bits/stdc++.h>
using namespace std;
struct mass {
  int num, cnt;
} ans[200009];
vector<vector<pair<int, int> > > g(200009);
int n, x, y, ans1;
bool used[200009];
bool comp(mass b, mass c) {
  if (b.cnt == c.cnt)
    return b.num < c.num;
  else
    return b.cnt < c.cnt;
}
void dfs(int v) {
  used[v] = true;
  for (int i = 0; i < g[v].size(); i++)
    if (!used[g[v][i].first]) {
      ans1 += g[v][i].second;
      dfs(g[v][i].first);
      used[g[v][i].first] = false;
    }
}
void dfs2(int v) {
  for (int i = 0; i < g[v].size(); i++)
    if (ans[g[v][i].first].cnt == 0) {
      ans[g[v][i].first].cnt = ans[v].cnt - 2 * g[v][i].second + 1;
      dfs2(g[v][i].first);
    }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    ans[i + 1].num = i + 1;
    scanf("%d %d", &x, &y);
    g[x].push_back(make_pair(y, 0));
    g[y].push_back(make_pair(x, 1));
  }
  if (g[n].size() == n - 1 && g[n][0].second == 0) {
    cout << 0 << ' ' << n;
    return 0;
  }
  ans[n].num = n;
  dfs(1);
  ans[1].cnt = ans1;
  dfs2(1);
  sort(ans, ans + n + 1, comp);
  printf("%d ", ans[1].cnt);
  for (int i = 1; i <= n; i++)
    if (ans[i].cnt == ans[1].cnt) printf("%d ", ans[i].num);
  return 0;
}
