#include <bits/stdc++.h>
using namespace std;
struct sef {
  int ne, en;
} h[200050];
int n, m, ans, tot, first[100500];
int tag[100050], a[100050], b[100050], d[100050];
inline void setl(int x, int y) {
  h[++tot] = (sef){first[x], y};
  first[x] = tot;
  return;
}
inline void go(int x, int fa, int zu) {
  if (tag[x] == -1)
    tag[x] = tag[zu];
  else if (tag[zu] > -1)
    tag[x] ^= tag[zu];
  if (tag[x] > -1) {
    a[x] ^= tag[x];
  }
  if (a[x] != b[x]) {
    d[++ans] = x;
    if (tag[x] > -1)
      tag[x] ^= a[x] ^ b[x];
    else
      tag[x] = a[x] ^ b[x];
    a[x] = b[x];
  }
  int y;
  for (int i = first[x]; y = h[i].en, i; i = h[i].ne) {
    if (y == fa) continue;
    go(y, x, fa);
  }
}
int main() {
  scanf("%d", &n);
  int x, y;
  for (int i = 1; i < n; ++i) {
    scanf("%d%d", &x, &y);
    setl(x, y);
    setl(y, x);
  }
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = 1; i <= n; ++i) scanf("%d", &b[i]);
  for (int i = 0; i <= n; ++i) tag[i] = -1;
  ans = 0;
  go(1, 0, 0);
  cout << ans << endl;
  for (int i = 1; i <= ans; ++i) printf("%d\n", d[i]);
}
