#include <bits/stdc++.h>
using namespace std;
int a[200000], b[200000];
vector<int> v[200000];
vector<int> q;
bool visited[200000];
void dfs(int s, bool b1, bool b2) {
  visited[s] = true;
  if (b1 && a[s] != b[s]) {
  } else if (b1) {
    q.push_back(s);
    b1 = 0;
  } else if (a[s] != b[s]) {
    q.push_back(s);
    b1 = 1;
  }
  for (int i = 0; i < v[s].size(); i++) {
    if (!visited[v[s][i]]) dfs(v[s][i], b2, b1);
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, y;
    cin >> u >> y;
    v[u].push_back(y);
    v[y].push_back(u);
  }
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) cin >> b[i];
  dfs(1, 0, 0);
  cout << q.size() << endl;
  for (int i = 0; i < q.size(); i++) cout << q[i] << endl;
}
