#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long infinity = 1000000000000000000;
const int inf = 1e9 + 5;
bool do_debug = false;
template <typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
  for (auto element : v) {
    os << element << " ";
  }
  return os;
}
template <typename T, typename S>
ostream& operator<<(ostream& os, pair<T, S>& p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, set<T>& v) {
  if (v.size() == 0) {
    os << "empty set\n";
    return os;
  }
  auto endit = v.end();
  endit--;
  os << "[";
  for (auto it = v.begin(); it != v.end(); it++) {
    os << *it;
    if (it != endit) {
      os << ", ";
    }
  }
  os << "]";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, multiset<T>& v) {
  if (v.size() == 0) {
    os << "empty multiset\n";
    return os;
  }
  auto endit = v.end();
  endit--;
  os << "[";
  for (auto it = v.begin(); it != v.end(); it++) {
    os << *it;
    if (it != endit) {
      os << ", ";
    }
  }
  os << "]";
  return os;
}
template <typename T, typename S>
ostream& operator<<(ostream& os, map<T, S>& v) {
  if (v.size() == 0) {
    os << "empty map\n";
    return os;
  }
  auto endit = v.end();
  endit--;
  os << "{";
  for (auto it = v.begin(); it != v.end(); it++) {
    os << "(" << (*it).first << " : " << (*it).second << ")";
    if (it != endit) {
      os << ", ";
    }
  }
  os << "}";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, vector<vector<T>>& v) {
  for (auto& subv : v) {
    for (auto& e : subv) {
      os << e << " ";
    }
    os << "\n";
  }
  return os;
}
struct node {
  int cnt[2] = {0, 0};
  int next[2] = {-1, -1};
};
int len;
vector<int> enc;
vector<int> key;
vector<int> ans;
vector<node> trie(1);
int find(int num) {
  int v = 0;
  int rv = 0;
  for (int i = 31 - 1; i >= 0; i--) {
    int e = (num & (1 << i)) ? 1 : 0;
    if (!trie[v].cnt[e]) {
      e = !e;
    }
    if (e) rv |= (1 << i);
    trie[v].cnt[e]--;
    v = trie[v].next[e];
  }
  return rv;
}
void add(int num) {
  int v = 0;
  for (int i = 31 - 1; i >= 0; i--) {
    int e = (num & (1 << i)) ? 1 : 0;
    if (trie[v].next[e] == -1) {
      trie[v].next[e] = trie.size();
      trie.emplace_back();
    } else {
    }
    trie[v].cnt[e]++;
    v = trie[v].next[e];
  }
}
void solve() {
  cin >> len;
  enc.resize(len);
  key.resize(len);
  ans.resize(len);
  for (int i = 0; i < len; i++) cin >> enc[i];
  ;
  for (int i = 0; i < len; i++) cin >> key[i];
  ;
  for (int i = 0; i < len; i++) {
    add(key[i]);
  }
  for (int i = 0; i < len; i++) {
    ans[i] = enc[i] ^ find(enc[i]);
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int q = 1;
  while (q-- > 0) {
    solve();
  }
  return 0;
}
