#include using namespace std; int main(void) { int n; unsigned int a[100000]; int b[32] = {0}; cin >> n; for(int i = 0; i < n; i++) cin >> a[i]; for(int i = 0; i < n; i++) for(int j = 0; j < 32; j++) if((a[i] & (1 << j)) > 0) b[j]++; int m = 0; for(int i = 0; i < 32; i++) if(b[i] == n) m |= 1 << i; unsigned int res = 0; for(int i = 0; i < n; i++) res = max(res, a[i] ^ m); cout << res << endl; return 0; }