#include #include using namespace std; using namespace atcoder; typedef long long ll; typedef long double ld; typedef vector vi; typedef vector vvi; typedef vector vl; typedef vector vvl; typedef vector vd; typedef vector vvd; typedef vector vc; typedef vector vvc; typedef vector vs; typedef vector vvs; typedef vector vb; typedef vector vvb; typedef pair pii; typedef pair pll; typedef modint998244353 mint; // atcoder typedef vector vm; // atcoder typedef vector vvm; // atcoder template using pqmax = priority_queue, less>; // 昇順 template using pqmin = priority_queue, greater>; // 降順 #define overload4(_1,_2,_3,_4,name,...) name #define REP1(n) for(ll i=0;in-1, 2: i,0->n-1, 3: i,a->b-1, 4: i,a->b-1,c #define REP(...) overload4(__VA_ARGS__, REP4, REP3, REP2, REP1)(__VA_ARGS__) #define RREP1(n) for(ll i=n;i>0;i--) #define RREP2(i,n) for(ll i=n;i>0;i--) #define RREP3(i,a,b) for(ll i=a;i>b;i--) #define RREP4(i,a,b,c) for(ll i=a;i>b;i-=c) // 1: n->1, 2: i,n->1, 3: i,a->b+1, 4: i,a->b+1,c #define RREP(...) overload4(__VA_ARGS__, RREP4, RREP3, RREP2, RREP1)(__VA_ARGS__) #define REPA(i, a) for(auto&&i:a) #define ALL(x) x.begin(), x.end() #define SZ(x) (int)x.size() templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (bconstexpr auto min(T... a){ return min(initializer_list>{a...}); } templateconstexpr auto max(T... a){ return max(initializer_list>{a...}); } templatevoid input(T&... a){ (cin >> ... >> a); } void print(){ cout << '\n'; } templatevoid print(const T& a, const Ts&... b){ cout << a; (cout << ... << (cout << ' ', b)); cout << '\n'; } constexpr int MOD = 998244353; constexpr int inf = 1001001001; constexpr ll INF = 1001001001001001001; int main(){ cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(20); bitset<4000001> bs; bs[0] = 1; int N; cin >> N; REP(N){ int a; cin >> a; bs ^= (bs << a); } int ans = 0; REP(i, 4000001){ if (bs[i]){ ans ^= i; } } cout << ans << endl; return 0; }