#include<iostream>using namespace std;int main(){ int n,x,y; while(cin>>n,n) { cin>>x; while(--n) { cin>>y; x=x^y; } cout<<x<<" "; } return 0;}