#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int n,f[1200],len,ff;
bool bj=false;
long long k[1200];
void hehe(long long j,long long pp)
{
long long ww=pp;
f[++len]=j;
ww^=k[j];
if(ww==0) {bj=true;for(int i=1;i<=len;i++)
printf("%d ",f[i]);
}
for(long long l=j+1;j<=n;j++)
{if(bj)return;
hehe(l,ww);
}
return;}
int main()
{
freopen("asm_contribute.in","r",stdin);
freopen("asm_contribute.out","w",stdout);
scanf("%d",&n);
for(int i=1;i<=n;i++)
scanf("%lld",&k[i]);
for(long long i=1;i<=n;i++)
if(!bj){ len=0;hehe(i,0);}
return 0;
}