import std;
void main () {
	int n;
	while (readf !(" %s") (n) > 0) {
		readln;
		auto a = readln.splitter.map !(to !(int)).array;
		auto s = a.fold !(q{a ^ b});
		a[] = s ^ a[];
		writefln !("%(%s %)") (a);
	}
}

