unittest
{
	assert( [ "4", "20 11 9 24" ].solve == "26 5 7 22" );
}



import std.conv;
import std.range;
import std.stdio;

void main()
{
	stdin.byLineCopy.solve.writeln;
}

auto solve( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.to!( long );
	input.popFront;
	auto as = input.front.split.to!( long[] );
	
	auto anss = new long[ as.length ];
	foreach( a; as[ 1 .. $ ] )
	{
		anss[ 0 ] ^= a;
	}
	foreach( i; 1L .. anss.length.signed )
	{
		anss[ i ] = anss[ i - 1 ] ^ as[ i - 1 ] ^ as[ i ];
	}
	return anss.to!( string[] ).join( " " );
}
