#include <bits/stdc++.h>
using namespace std;
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm1(long long a, long long b) { return (a * b) / gcd(a, b); }
struct TrieNode {
  map<char, TrieNode *> children;
  int count = 0;
};
TrieNode *root = new TrieNode();
void insert(string word) {
  TrieNode *current = root;
  for (int i = 0; i < word.size(); i++) {
    char ch = word[i];
    TrieNode *node = current->children[ch];
    if (!node) {
      node = new TrieNode();
      current->children[ch] = node;
    }
    current = node;
    current->count++;
  }
}
void deletion(string word) {
  TrieNode *current = root;
  for (long long i = 0; i < word.size(); i++) {
    char ch = word[i];
    TrieNode *node = current->children[ch], *prev;
    prev = current;
    current = node;
    current->count--;
    if (current->count == 0) {
      prev->children[ch] = NULL;
    }
  }
}
string miXOR(string word) {
  TrieNode *current = root;
  string s, d;
  for (int i = 0; i < word.size(); i++) {
    TrieNode *node;
    if (word[i] == '0') {
      node = current->children['0'];
      if (!node) {
        node = current->children['1'];
        s.push_back('1');
        d.push_back('1');
      } else {
        s.push_back('0');
        d.push_back('0');
      }
    } else {
      node = current->children['1'];
      if (!node) {
        node = current->children['0'];
        s.push_back('1');
        d.push_back('0');
      } else {
        s.push_back('0');
        d.push_back('1');
      }
    }
    current = node;
  }
  deletion(d);
  return s;
}
string bits(long long a) {
  string s;
  while (a != 0) {
    s.push_back((char)(a % 2 + 48));
    a /= 2;
  }
  long long l = s.size();
  for (long long i = 0; i < 32 - l; i++) {
    s.push_back('0');
  }
  reverse((s).begin(), (s).end());
  return s;
}
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> v1(n), v2(n);
  for (long long i = 0; i < n; i++) cin >> v1[i];
  for (long long i = 0; i < n; i++) cin >> v2[i];
  for (long long i = 0; i < n; i++) {
    insert(bits(v2[i]));
  }
  for (long long i = 0; i < n; i++) {
    string s = miXOR(bits(v1[i]));
    long long ans = 0;
    for (long long i = 0; i < 32; i++) {
      ans += (s[i] == '1') ? pow(2, 31 - i) : 0;
    }
    cout << ans << " ";
  }
}
