#include <bits/stdc++.h>
using namespace std;
const int M = 300000 + 5;
int i, k, sum, key, a[M], power[31], f[10000000 + 5][5], b[M], c[M];
void build(int x, int y) {
  if (y == -1) {
    f[x][2] = i;
    f[x][3]++;
    f[x][4]++;
    return;
  }
  key = b[i] / power[y];
  b[i] %= power[y];
  if (!f[x][key]) {
    sum++;
    f[x][key] = sum;
  }
  f[x][key + 2]++;
  build(f[x][key], y - 1);
}
int find(int x, int y) {
  if (y == -1) {
    return f[x][2];
  }
  key = k / power[y];
  k %= power[y];
  if (f[x][key + 2]) {
    f[x][key + 2]--;
    return find(f[x][key], y - 1);
  } else {
    f[x][(key ^ 1) + 2]--;
    return find(f[x][key ^ 1], y - 1);
  }
}
int main() {
  int n, m;
  scanf("%d", &n);
  power[0] = 1;
  for (i = 1; i <= 30; i++) power[i] = power[i - 1] << 1;
  sum = 1;
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (i = 1; i <= n; i++) {
    scanf("%d", &b[i]);
    c[i] = b[i];
    build(1, 30);
  }
  for (i = 1; i <= n; i++) {
    k = a[i];
    printf("%d ", a[i] ^ c[find(1, 30)]);
  }
  return 0;
}
