#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
int a[N],ans=0;
int b[N],n,c[N];
stack<int>st;
int main()
{
cin>>n;
for(int i=1;i<=n;i++)
cin>>a[i];
a[0]=1e9;
st.push(0);
for(int j=1;j<=n;j++)
{
for(int k=1;k<=j;k++)
c[k]=a[k];
for(int i=j;i>=1;i--)
{
while(c[st.top()]<=c[i])
st.pop();
b[i]=st.top();
st.push(i);
}
for(int k=1;k<=j;k++)
ans^=b[k];
cout<<ans<<'\n';
}
return 0;
}