#include <iostream>
#include <map>
#include <vector>
#include <string>

using namespace std;


string stbin(int x){
    string S(30,'x');
    if(x>= 536870912 ){ S[ 0 ]='1'; x-= 536870912 ;}else{ S[ 0 ]='0';}
    if(x>= 268435456 ){ S[ 1 ]='1'; x-= 268435456 ;}else{ S[ 1 ]='0';}
    if(x>= 134217728 ){ S[ 2 ]='1'; x-= 134217728 ;}else{ S[ 2 ]='0';}
    if(x>= 67108864 ){ S[ 3 ]='1'; x-= 67108864 ;}else{ S[ 3 ]='0';}
    if(x>= 33554432 ){ S[ 4 ]='1'; x-= 33554432 ;}else{ S[ 4 ]='0';}
    if(x>= 16777216 ){ S[ 5 ]='1'; x-= 16777216 ;}else{ S[ 5 ]='0';}
    if(x>= 8388608 ){ S[ 6 ]='1'; x-= 8388608 ;}else{ S[ 6 ]='0';}
    if(x>= 4194304 ){ S[ 7 ]='1'; x-= 4194304 ;}else{ S[ 7 ]='0';}
    if(x>= 2097152 ){ S[ 8 ]='1'; x-= 2097152 ;}else{ S[ 8 ]='0';}
    if(x>= 1048576 ){ S[ 9 ]='1'; x-= 1048576 ;}else{ S[ 9 ]='0';}
    if(x>= 524288 ){ S[ 10 ]='1'; x-= 524288 ;}else{ S[ 10 ]='0';}
    if(x>= 262144 ){ S[ 11 ]='1'; x-= 262144 ;}else{ S[ 11 ]='0';}
    if(x>= 131072 ){ S[ 12 ]='1'; x-= 131072 ;}else{ S[ 12 ]='0';}
    if(x>= 65536 ){ S[ 13 ]='1'; x-= 65536 ;}else{ S[ 13 ]='0';}
    if(x>= 32768 ){ S[ 14 ]='1'; x-= 32768 ;}else{ S[ 14 ]='0';}
    if(x>= 16384 ){ S[ 15 ]='1'; x-= 16384 ;}else{ S[ 15 ]='0';}
    if(x>= 8192 ){ S[ 16 ]='1'; x-= 8192 ;}else{ S[ 16 ]='0';}
    if(x>= 4096 ){ S[ 17 ]='1'; x-= 4096 ;}else{ S[ 17 ]='0';}
    if(x>= 2048 ){ S[ 18 ]='1'; x-= 2048 ;}else{ S[ 18 ]='0';}
    if(x>= 1024 ){ S[ 19 ]='1'; x-= 1024 ;}else{ S[ 19 ]='0';}
    if(x>= 512 ){ S[ 20 ]='1'; x-= 512 ;}else{ S[ 20 ]='0';}
    if(x>= 256 ){ S[ 21 ]='1'; x-= 256 ;}else{ S[ 21 ]='0';}
    if(x>= 128 ){ S[ 22 ]='1'; x-= 128 ;}else{ S[ 22 ]='0';}
    if(x>= 64 ){ S[ 23 ]='1'; x-= 64 ;}else{ S[ 23 ]='0';}
    if(x>= 32 ){ S[ 24 ]='1'; x-= 32 ;}else{ S[ 24 ]='0';}
    if(x>= 16 ){ S[ 25 ]='1'; x-= 16 ;}else{ S[ 25 ]='0';}
    if(x>= 8 ){ S[ 26 ]='1'; x-= 8 ;}else{ S[ 26 ]='0';}
    if(x>= 4 ){ S[ 27 ]='1'; x-= 4 ;}else{ S[ 27 ]='0';}
    if(x>= 2 ){ S[ 28 ]='1'; x-= 2 ;}else{ S[ 28 ]='0';}
    if(x>= 1 ){ S[ 29 ]='1'; x-= 1 ;}else{ S[ 29 ]='0';}
    return S;
}


string myxor(string s1, string s2){
    string S(30,'x');
    for(int i=0;i<30;i++){
        if( s1[i]==s2[i] )  S[i] = '0';
        else                S[i] = '1';
    }
    return S;
}

int st2int(string S){
    int n=0;
    if(S[ 0 ]=='1') n += 536870912 ;
    if(S[ 1 ]=='1') n += 268435456 ;
    if(S[ 2 ]=='1') n += 134217728 ;
    if(S[ 3 ]=='1') n += 67108864 ;
    if(S[ 4 ]=='1') n += 33554432 ;
    if(S[ 5 ]=='1') n += 16777216 ;
    if(S[ 6 ]=='1') n += 8388608 ;
    if(S[ 7 ]=='1') n += 4194304 ;
    if(S[ 8 ]=='1') n += 2097152 ;
    if(S[ 9 ]=='1') n += 1048576 ;
    if(S[ 10 ]=='1') n += 524288 ;
    if(S[ 11 ]=='1') n += 262144 ;
    if(S[ 12 ]=='1') n += 131072 ;
    if(S[ 13 ]=='1') n += 65536 ;
    if(S[ 14 ]=='1') n += 32768 ;
    if(S[ 15 ]=='1') n += 16384 ;
    if(S[ 16 ]=='1') n += 8192 ;
    if(S[ 17 ]=='1') n += 4096 ;
    if(S[ 18 ]=='1') n += 2048 ;
    if(S[ 19 ]=='1') n += 1024 ;
    if(S[ 20 ]=='1') n += 512 ;
    if(S[ 21 ]=='1') n += 256 ;
    if(S[ 22 ]=='1') n += 128 ;
    if(S[ 23 ]=='1') n += 64 ;
    if(S[ 24 ]=='1') n += 32 ;
    if(S[ 25 ]=='1') n += 16 ;
    if(S[ 26 ]=='1') n += 8 ;
    if(S[ 27 ]=='1') n += 4 ;
    if(S[ 28 ]=='1') n += 2 ;
    if(S[ 29 ]=='1') n += 1 ;
    return n;
}


int main(){
    int N;
    cin >> N;

    vector<int> a(N,0);
    vector<string> s(N,"");
    for(int i=0;i<N;i++){
        cin >> a[i];
        s[i] = stbin(a[i]);
        //cout << st2int( myxor( stbin(14), s[i] )) << endl;
    }

    string allx = s[0];
    for(int i=1;i<N;i++){
        allx = myxor(allx, s[i]);
    }

    for(int i=0;i<N;i++){
        cout << st2int( myxor(allx,s[i]) ) << " ";
    }
    cout << endl;

    //cout << stbin(1000000000) << endl;
    //print(1000000000); // 二進数30桁
    
    return 0;
}

Measured memory_bytes: 19532