#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
const int MAXE = MAXN << 1;
int N, i, j;
int head[MAXN], e[MAXE], enxt[MAXE], ec;
int t[MAXN];
void regi(int u, int v) {
  ec++;
  e[ec] = v;
  enxt[ec] = head[u];
  head[u] = ec;
}
int K[MAXN];
void dfs(int cur, int fid, int cnt, int mask) {
  if (t[cur] ^ mask) {
    K[++K[0]] = cur;
    cnt ^= 1;
    mask ^= 1;
  }
  for (int E = head[cur]; E; E = enxt[E])
    if (e[E] != fid) dfs(e[E], cur, cnt, mask ^ cnt);
}
int main() {
  scanf("%d", &N);
  for (i = 1; i <= N; i++) head[i] = 0;
  ec = 0;
  for (i = 2; i <= N; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    regi(u, v);
    regi(v, u);
  }
  for (i = 1; i <= N; i++) scanf("%d", &t[i]);
  for (i = 1; i <= N; i++) {
    scanf("%d", &j);
    t[i] ^= j;
  }
  K[0] = 0;
  dfs(1, 0, 0, 0);
  sort(K + 1, K + K[0] + 1);
  for (i = 0; i <= K[0]; i++) printf("%d\n", K[i]);
}
