#include #include "atcoder/all" #define debug cout << "OK" << endl; template inline bool chmax(T& a, const T b) { if (a < b) { a = b; return true; } return false; } template inline bool chmin(T& a, const T b) { if (a > b) { a = b; return true; } return false; } inline int Code(char c) { if ('A' <= c and c <= 'Z')return (int)(c - 'A'); if ('a' <= c and c <= 'z')return (int)(c - 'a'); if ('0' <= c and c <= '9')return (int)(c - '0'); assert(false); } using namespace std; using namespace atcoder; using minit = modint1000000007; constexpr int MOD = 1000000007; constexpr int MOD2 = 998244353; constexpr long long INF = (1LL << 63); template ostream& operator << (ostream& st, const vector& v) { for (const T value : v) { st << value << " "; } return st; } template istream& operator >> (istream& st, vector& v) { for (T& value : v) { st >> value; } return st; } long long pow_(const int a, const int b, const int m = INF) { long long res = 1; long long base = a; for (int i = 0; i < 64; i++) { if (b & (1ll << i))res *= base; res %= m; base = base * base; base %= m; } return res; } inline int gcd(const int a, const int b) { return (b == 0 ? a : gcd(b, a % b)); } inline int lcm(const int a, const int b) { return a * b / gcd(a, b); } // class nCk { public: const int m; const int MAXIMUM = 1000000; vector fac, facinv, inv; nCk(int m_); ~nCk(); int com(int n, int k)const; }; nCk::nCk(int m_):m(m_) { fac.resize(MAXIMUM + 3); facinv.resize(MAXIMUM + 3); inv.resize(MAXIMUM + 3); fac[0] = fac[1] = 1; facinv[0] = facinv[1] = 1; inv[1] = 1; for (int i = 2; i < MAXIMUM + 2; i++) { fac[i] = fac[i - 1] * i % m; inv[i] = m - inv[m % i] * (m / i) % m; facinv[i] = facinv[i - 1] * inv[i] % m; } } nCk::~nCk(){} int nCk::com(int n, int k)const { if (n < k)return 0; assert(!(n < 0 || k < 0)); return fac[n] * (facinv[k] * facinv[n - k] % m) % m; } template vector press(const vector& arr) { vector X = arr; sort(X.begin(), X.end()); X.erase(unique(X.begin(), X.end()), X.end()); vector ans(arr.size()); for (int i = 0; i < arr.size(); i++) { ans[i] = lower_bound(X.begin(), X.end(), arr[i]) - X.begin(); } return ans; } // class Solver { public: int T; Solver() :T(1) {} ~Solver(){} void ios()const; void multi(); void solve() const; void sp(int x)const; void ft()const; // // }; void Solver::ios() const { cin.tie(nullptr); ios_base::sync_with_stdio(false); return; } void Solver::multi() { cin >> T; return; } void Solver::sp(const int x)const { cout << fixed << setprecision(x) << endl; return; } void Solver::ft() const { } void Solver::solve() const { int N; cin >> N; vector A(N); cin >> A; int ans = 0; for (int i = 0; i < 34; i++) { vector f; for (const int a : A) { f.push_back((bool)(a & (1ll << i))); } bool base = f[0]; for (const bool flag : f) { if (flag != base) { ans |= (1ll << i); } } } cout << ans << endl; } signed main() { Solver solver; solver.ios(); //solver.ft(); //solver.multi(); //solver.sp(); for (int i = 0; i < solver.T; i++) solver.solve(); return 0; } /* * わらびのコードこーどすぺーす (σ・∀・)σゲッツ!! */