# include # include #include # include #include #include #include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include using namespace std; using LL = long long; using ULL = unsigned long long; constexpr long long MOD = 1000000000 + 7; constexpr long long INF = std::numeric_limits::max(); const double PI = acos(-1); #define fir first #define sec second #define debug(x) cerr<<#x<<": "< Pll; typedef pair> Ppll; typedef pair>> Pbll; typedef pair>> Pvll; typedef pair Vec2; struct Tll { LL first, second, third; }; typedef pair Ptll; #define rep(i,rept) for(LL i=0;i=0;i--) LL h, w, n, m, k, s, t, q, sum, last, cnt, ans,a[210000]; struct Edge { LL to, cost; }; string str; bool f; vectorvec[1000]; void YN(bool f) { if (f) cout << "YES" << endl; else cout << "NO" << endl; } void yn(bool f) { if (f) cout << "Yes" << endl; else cout << "No" << endl; } signed main() { cin >> n; rep(i, n) { cin >> a[i]; } rep(i, 100) { cnt = 0; rep(j, n) if (a[j] & (1 << i))cnt++; if (cnt != n&&cnt != 0)ans += 1 << i; } cout << ans << endl; return 0; }