#include using namespace std; const int mxN = 4e6 +5; int main(){ int n; cin >> n; bitset dp; dp[0] = 1; for(int i = 0, a;i < n;i++){ cin >> a; dp ^= (dp << a); } int ans = 0; for(int i = 0;i < mxN;i++) if(dp[i]) ans ^= i; cout << ans << "\n"; return 0; }