/*
Mangal bhavan amangal haari
Drabahu su Dasharath achar Bihari
Raam Siya Raam Siya Raam jai jai Raam
Raam Siya Raam Siya Raam jai jai Raam
Ho hoi hai wohi jo Raam rachi raakha
Ko kari tarak badhave saakha
Raam Siya Raam Siya Raam jai jai Raam
Ho dheeraj dharam mitra aru naari
Aapad kaal parakhiye chaari
Ho jehike jehi par satya sanehu
So tehi milay na kachhu sandehu
Ho jaaki rahi bhawana jaisi
Prabhu murati dekhi tin taisi
Ho Raghukul reet sada chali aayi
Praan jaaye par vachan na jaayi
Raam Siya Raam Siya Raam jai jai Raam, Raam
Raam Siya Raam Siya Raam jai jai Raam
Ho hari anant hari katha ananta
Kahahi sunahi bahuvidhi sab santa
Raam Siya Raam Siya Raam jai jai Raam, Raam
Raam Siya Raam Siya Raam jai jai Raam
Raam Siya Raam Siya Raam jai jai Raam
*/


#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()
//auto->.
//map<int,int>::iterator i
vector<int> sieve(int n) 
{ 

    vector<bool> prime(n+1,true); 
       
    prime[0] = false; 
    prime[1] = false; 
    int m = sqrt(n); 
   vector<int> ans;

    for (int p=2; p<=m; p++) 
    { 
    
        if (prime[p]) 
        { 
         
            for (int i=p*2; i<=n; i += p) 
            prime[i] = false; 
        } 
    }  
    //vector<int> ans; 
    for (int i=0;i<n;i++) 
        if (prime[i]) 
            ans.push_back(i); 
    return ans; 
}

int gcd(int a,int b)
{
	if(b==0) return a;
	return gcd(b,a%b);
}
int mod = 1e9 + 7;
int power(int a , ll b)
{
	int res = 1;
	while(b)
	{
		if(b & 1)
			res = 1LL * res * a ;//% mod;
		a = 1LL * a * a ;//% mod;
		b >>= 1;
	}
	return res;
}
bool sortbysec(const pair<int,int> &a, 
              const pair<int,int> &b) 
{ 
    return (a.second < b.second); 
}
ll min(int a,ll b)
{
	if(a>b)
	return b;
	return a;
}
ll max(int a,ll b)
{
	if(a>b)
	return a;
	return b;
}
ll myXOR(ll x, ll y) 
{ 
   return (x | y) & (~x | ~y); 
}
int conti(int x)
{
	if(x<1)
	return 0;
	if(x%4==0)
	return x;
	if(x%4==1)
	return 1;
	if(x%4==2)
	return x+1;
	if(x%4==3)
	return 0;
}
 
bool ispfsq(long double x) 
{   
  // Find floating point value of  
  // square root of x. 
  long double sr = sqrt(x); 
  
  // If square root is an integer 
  return ((sr - floor(sr)) == 0); 
}
#define PI 3.141592653589793

int n,m,t=-1,s;
stack<int> ss;
vector<int > adj[100005];
bool visited[100005];
int dep[100005];
void solve()
{
	
ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
int n,d;
cin>>n;
d=0;
int arr[n];
for(int i=0;i<n;i++)
cin>>arr[i];
vector<int > v[n];
for(int i=0;i<n;i++)
{
    d^=arr[i];
	int x=arr[i];
	while(x)
	{
		v[i].pb(x%2);
		x/=2;
	}
	while(v[i].size()<=35)
	{
		v[i].pb(0);
	}
}
vector<int > f;

while(d)
{
	f.pb(d%2);
	d/=2;
}
while(f.size()<=35)
{
	f.pb(0);
}
for(int i=0;i<n;i++)
{
	vector<int > sa;
	for(int j=0;j<v[i].size();j++)
	{
		if(v[i][j]!=f[j])
		{
			sa.pb(1);
		}
		else
		{
		sa.pb(0);
		}
	}
	ll ans=0,t=1;
	for(int i=0;i<sa.size();i++)
	{
		ans+=t*sa[i];
		t*=2;
	}
	cout<<ans<<" ";
}

}


/*
void dfs(int node,vector<int > adj[],bool visited[],int dep[],int par[])
{
	cout<<node<<" ";
	if(visited[node]==true)
	return  ;
	visited[node]=true;
	dep[node]=dep[par[node]]+1;
	
	
		for(int i=0;i<adj[node].size();i++)
		{
			if(visited[adj[node][i]]==false)
			{
			par[adj[node][i]]=node;
			dfs(adj[node][i],adj,visited,dep,par);
		    }
		  //  else if(abs(dep[node]-dep[i])<=k-1)
		    // {
		     //	st=i;
		     //	en=node;
			 //}
		 }
		    
		
		
	
	
}*/

int main()
{
	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	//func();
int mul=0;
if(mul==1)
{
 int t;
 
    cin>>t;
   while(t--)
    {
		solve();
	cout<<"\n";
    }
}
else
{
	solve();
}
}

Measured memory_bytes: 64596