#include #include using namespace std; vector G[100100]; int N,D[100100],V[100100]; void go(int x, int l) { D[x] = 1; for (int y : G[x]) if (y != l){ go(y,x); if (D[y] > 0) D[x] -= D[y]; } } void go2(int x, int l) { for (int y : G[x]) if (y != l){ int v = D[x]; if (D[y] > 0) v += D[y]; if (V[x] > 0) v -= V[x]; V[y] = v; go2(y,x); } } int main() { scanf ("%d",&N); for (int i=1;i ans; for (int i=1;i<=N;i++){ int v = D[i]; if (V[i] > 0) v -= V[i]; if (v > 0) ans.push_back(i); } printf ("%d\n",ans.size()); for (auto x : ans) printf ("%d\n",x); return 0; }