#include using i64 = long long; using std::cout; using std::endl; using std::cin; int n; std::vector> g; std::vector> dp; void dfs(int v = 0, int par = -1, bool f = true) { if(dp[v].count(par)) return; int ret = 0; if(f || par == -1) { for(auto e : g[v]) { if(e == par) continue; dfs(e, v, f); ret += !dp[e][v]; } } else { dfs(v, -1, f); dfs(par, v, f); ret = dp[v][-1] - !dp[par][v]; } dp[v][par] = ret; return; } int main() { scanf("%d", &n); g.resize(n); dp.resize(n); for(int i = 0; i < n - 1; i++) { int a, b; scanf("%d%d", &a, &b); g[a - 1].push_back(b - 1); g[b - 1].push_back(a - 1); } dfs(); std::vector ans; for(int i = 0; i < n; i++) { dfs(i, -1, false); if(!dp[i][-1]) ans.push_back(i + 1); } printf("%d\n", ans.size()); for(auto v : ans) printf("%d\n", v); return 0; }