#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     long long b[n], c[n];     for (int i = 0; i < n; i++) cin >> b[i];     for (int i = 0; i < n; i++) cin >> c[i];     long long d[n], a[n], sum = 0;     for (int i = 0; i < n; i++) {       d[i] = b[i] + c[i];       sum += d[i];     }     sum /= (2 * n);     bool flag = true;     long long k[64];     for (int j = 0; j < 63; j++) k[j] = 0;     for (int i = 0; i < n; i++) {       a[i] = (d[i] - sum) / n;       if (a[i] < 0) {         flag = false;         break;       }       for (int j = 0; j < 63; j++)         if (a[i] & (1LL << j)) k[j]++;     }     for (int i = 0; i < n && flag; i++) {       long long num1 = 0, num2 = 0;       for (int j = 0; j < 63; j++) {         long long tmp = 1LL << j;         if (a[i] & tmp) {           num1 += k[j] << j;           num2 += n << j;         } else {           num2 += k[j] << j;         }       }       if (num1 != b[i] || num2 != c[i]) {         flag = false;         break;       }     }     if (flag) {       for (int i = 0; i < n; i++) cout << a[i] <<    ;       cout << endl;     } else       cout <<  -1 n ;     return 0;   }   