func_code_string: #include <bits/stdc++.h>   using namespace std;   class Graph {     vector<int>* adjList;     vector<bool> init;     vector<bool> goal;     bool* visited;     int n;     vector<int> operate;       public:     Graph(int n) {       adjList = new vector<int>[n];       visited = new bool[n]();       this->n = n;     }     void initialise(bool value) { init.push_back(value); }     void goals(bool value) { goal.push_back(value); }     void edge(int u, int v) {       adjList[u].push_back(v);       adjList[v].push_back(u);     }     void print() {       for (int j = 0; j < operate.size(); ++j) {         cout << operate[j] << endl;       }     }     int achieveGoal(int root, int op1, int op2) {       int total = 0;       visited[root] = true;       int operations = op1;       if (operations & 1 == 1) {         init[root] = !init[root];       }       if (init[root] != goal[root]) {         init[root] = !init[root];         ++operations;         total += 1;         operate.push_back(root + 1);       }       for (int i = 0; i < adjList[root].size(); ++i) {         if (!visited[adjList[root][i]])           total += achieveGoal(adjList[root][i], op2, operations);       }       return total;     }   };   int main() {     int n, u, v;     cin >> n;     Graph g(n);     for (int i = 1; i < n; ++i) {       cin >> u >> v;       g.edge(u - 1, v - 1);     }     for (int i = 0; i < n; ++i) {       cin >> u;       g.initialise(u);     }     for (int i = 0; i < n; ++i) {       cin >> v;       g.goals(v);     }     cout << g.achieveGoal(0, 0, 0) << endl;     g.print();   }   