#include <bits/stdc++.h>
using namespace std;
using namespace std;
unordered_map<unsigned int, unsigned int> nums;
vector<bool> dec(unsigned int n) {
  vector<bool> num(31);
  for (int i = 30; i >= 0; --i) {
    num[i] = (n & 1);
    n >>= 1;
  }
  return num;
}
void add(unsigned int n) {
  auto mydec = dec(n);
  unsigned int ptr = 1;
  for (int i = 0; i < 31; ++i) {
    ptr = ptr * 2 + mydec[i];
    ++nums[ptr];
  }
}
void grab(unsigned int n) {
  auto mydec = dec(n);
  unsigned int ptr = 1, ans = 0;
  for (int i = 0; i < 31; ++i) {
    if (nums.count(ptr * 2 + mydec[i]))
      ptr = ptr * 2 + mydec[i];
    else
      ptr = ptr * 2 + !mydec[i];
    --nums[ptr];
    if (nums[ptr] == 0) nums.erase(ptr);
    ans = ans * 2 + (ptr & 1);
  }
  cout << (ans ^ n) << ' ';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<unsigned int> a(n), p(n);
  for (int i = 0; i < a.size(); ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < n; ++i) {
    cin >> p[i];
  }
  for (int i = 0; i < p.size(); ++i) {
    cin >> p[i];
  }
  for (int i = 0; i < p.size(); ++i) {
    add(p[i]);
  }
  for (int i = 0; i < a.size(); ++i) {
    grab(a[i]);
  }
  return 0;
}
