stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

#define rep(i, n) for(int i = 0; i < (n); i++)

#define rep1(i, n) for(int i = 1; i <= (n); i++)

#define co(x) cout << (x) << "\n"

#define cosp(x) cout << (x) << " "

#define ce(x) cerr << (x) << "\n"

#define cesp(x) cerr << (x) << " "

#define pb push_back

#define mp make_pair

#define Would

#define you

#define please





int main() {

	cin.tie(0);

	ios::sync_with_stdio(false);





	int N;

	cin >> N;

	ll a[100000];

	ll goukei = 0;

	rep(i, N) {

		cin >> a[i];

		goukei ^= a[i];

	}



	int M = 60;

	bool A[100000][60] = {};

	rep(i, N) {

		rep(j, M) {

			A[i][j] = a[i] >> j & 1;

		}

	}



	int r = 0;

	for (int i = M - 1; i >= 0; i--) {

		if (!(goukei >> i & 1)) {

			for (int j = r; j < N; j++) {

				if (A[j][i]) {

					rep(k, M) swap(A[r][k], A[j][k]);



					for (int j = r + 1; j < N; j++) {

						if (A[j][i]) {

							rep(k, M) A[j][k] ^= A[r][k];

						}

					}

					if (!A[0][i]) {

						rep(k, M) A[0][k] ^= A[r][k];

					}

					r++;

					break;

				}

			}

		}

	}



	ll kotae = 0;

	rep(i, M) {

		if (!(goukei >> i & 1)) {

			if (A[0][i]) {

				kotae += 1ll << (i + 1);

			}

		}

		else {

			kotae += 1ll << i;

		}

	}

	co(kotae);







	Would you please return 0;

}

// Faster C++ solution for the same problem (measured speedup: 7.169941585217568x):
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

#define rep(i, n) for(int i = 0; i < (n); i++)

#define rep1(i, n) for(int i = 1; i <= (n); i++)

#define co(x) cout << (x) << "\n"

#define cosp(x) cout << (x) << " "

#define ce(x) cerr << (x) << "\n"

#define cesp(x) cerr << (x) << " "

#define pb push_back

#define mp make_pair

#define Would

#define you

#define please





int main() {

	cin.tie(0);

	ios::sync_with_stdio(false);





	int N;

	cin >> N;

	ll a[100000];

	ll goukei = 0;

	rep(i, N) {

		cin >> a[i];

		goukei ^= a[i];

	}



	int M = 60;

	int r = 0;

	for (int i = M - 1; i >= 0; i--) {

		if (!(goukei >> i & 1)) {

			for (int j = r; j < N; j++) {

				if (a[j] >> i & 1) {

					swap(a[r], a[j]);

					for (int k = max(j, r + 1); k < N; k++) {

						if (a[k] >> i & 1) {

							a[k] ^= a[r];

						}

					}

					if (!(a[0] >> i & 1)) {

						a[0] ^= a[r];

					}

					r++;

					break;

				}

			}

		}

	}



	co(a[0] + (a[0] ^ goukei));



	Would you please return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

#define rep(i, n) for(int i = 0; i < (n); i++)

#define rep1(i, n) for(int i = 1; i <= (n); i++)

#define co(x) cout << (x) << "\n"

#define cosp(x) cout << (x) << " "

#define ce(x) cerr << (x) << "\n"

#define cesp(x) cerr << (x) << " "

#define pb push_back

#define mp make_pair

#define Would

#define you

#define please





int main() {

	cin.tie(0);

	ios::sync_with_stdio(false);





	int N;

	cin >> N;

	ll a[100000];

	ll goukei = 0;

	rep(i, N) {

		cin >> a[i];

		goukei ^= a[i];

	}



	int M = 60;

	bool A[100000][60] = {};

	rep(i, N) {

		rep(j, M) {

			A[i][j] = a[i] >> j & 1;

		}

	}



	int r = 0;

	for (int i = M - 1; i >= 0; i--) {

		if (!(goukei >> i & 1)) {

			for (int j = r; j < N; j++) {

				if (A[j][i]) {

					rep(k, M) swap(A[r][k], A[j][k]);



					for (int j = r + 1; j < N; j++) {

						if (A[j][i]) {

							rep(k, M) A[j][k] ^= A[r][k];

						}

					}

					if (!A[0][i]) {

						rep(k, M) A[0][k] ^= A[r][k];

					}

					r++;

					break;

				}

			}

		}

	}



	ll kotae = 0;

	rep(i, M) {

		if (!(goukei >> i & 1)) {

			if (A[0][i]) {

				kotae += 1ll << (i + 1);

			}

		}

		else {

			kotae += 1ll << i;

		}

	}

	co(kotae);







	Would you please return 0;

}

// Faster C++ solution for the same problem (measured speedup: 35.025688472661905x):
//#include<bits/stdc++.h>

#include<cstdio>

#include<algorithm>

using namespace std;

typedef long long ll;

#define rep(i, n) for(int i = 0; i < (n); i++)

#define rep1(i, n) for(int i = 1; i <= (n); i++)

#define co(x) cout << (x) << "\n"

#define cosp(x) cout << (x) << " "

#define ce(x) cerr << (x) << "\n"

#define cesp(x) cerr << (x) << " "

#define pb push_back

#define mp make_pair

#define Would

#define you

#define please



const int cm = 1 << 17;

char cn[cm], * ci = cn + cm, ct;

inline char getcha() {

	if (ci - cn == cm) { fread(cn, 1, cm, stdin); ci = cn; }

	return *ci++;

}

inline ll getint() {

	ll A = 0;

	if (ci - cn + 24 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';

	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';

	return A;

}



int main() {

	//cin.tie(0);

	//ios::sync_with_stdio(false);





	int N = getint();

	ll a[100000];

	ll goukei = 0;

	rep(i, N) {

		a[i] = getint();;

		goukei ^= a[i];

	}



	int M = 60;

	int r = 0;

	for (int i = M - 1; i >= 0; i--) {

		if (!(goukei >> i & 1)) {

			for (int j = r; j < N; j++) {

				if (a[j] >> i & 1) {

					swap(a[r], a[j]);

					for (int k = max(j, r + 1); k < N; k++) {

						if (a[k] >> i & 1) {

							a[k] ^= a[r];

						}

					}

					if (!(a[0] >> i & 1)) {

						a[0] ^= a[r];

					}

					r++;

					break;

				}

			}

		}

	}



	printf("%lld", a[0] + (a[0] ^ goukei));



	Would you please return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

#define rep(i, n) for(int i = 0; i < (n); i++)

#define rep1(i, n) for(int i = 1; i <= (n); i++)

#define co(x) cout << (x) << "\n"

#define cosp(x) cout << (x) << " "

#define ce(x) cerr << (x) << "\n"

#define cesp(x) cerr << (x) << " "

#define pb push_back

#define mp make_pair

#define Would

#define you

#define please





int main() {

	cin.tie(0);

	ios::sync_with_stdio(false);





	int N;

	cin >> N;

	ll a[100000];

	ll goukei = 0;

	rep(i, N) {

		cin >> a[i];

		goukei ^= a[i];

	}



	int M = 60;

	int r = 0;

	for (int i = M - 1; i >= 0; i--) {

		if (!(goukei >> i & 1)) {

			for (int j = r; j < N; j++) {

				if (a[j] >> i & 1) {

					swap(a[r], a[j]);



					for (int j = r + 1; j < N; j++) {

						if (a[j] >> i & 1) {

							a[j] ^= a[r];

						}

					}

					if (!(a[0] >> i & 1)) {

						a[0] ^= a[r];

					}

					r++;

					break;

				}

			}

		}

	}



	co(a[0] + (a[0] ^ goukei));



	Would you please return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.884842128766193x):
//#include<bits/stdc++.h>

#include<cstdio>

#include<algorithm>

using namespace std;

typedef long long ll;

#define rep(i, n) for(int i = 0; i < (n); i++)

#define rep1(i, n) for(int i = 1; i <= (n); i++)

#define co(x) cout << (x) << "\n"

#define cosp(x) cout << (x) << " "

#define ce(x) cerr << (x) << "\n"

#define cesp(x) cerr << (x) << " "

#define pb push_back

#define mp make_pair

#define Would

#define you

#define please



const int cm = 1 << 17;

char cn[cm], * ci = cn + cm, ct;

inline char getcha() {

	if (ci - cn == cm) { fread(cn, 1, cm, stdin); ci = cn; }

	return *ci++;

}

inline ll getint() {

	ll A = 0;

	if (ci - cn + 24 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';

	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';

	return A;

}



int main() {

	//cin.tie(0);

	//ios::sync_with_stdio(false);





	int N = getint();

	ll a[100000];

	ll goukei = 0;

	rep(i, N) {

		a[i] = getint();;

		goukei ^= a[i];

	}



	int M = 60;

	int r = 0;

	for (int i = M - 1; i >= 0; i--) {

		if (!(goukei >> i & 1)) {

			for (int j = r; j < N; j++) {

				if (a[j] >> i & 1) {

					swap(a[r], a[j]);

					for (int k = max(j, r + 1); k < N; k++) {

						if (a[k] >> i & 1) {

							a[k] ^= a[r];

						}

					}

					if (!(a[0] >> i & 1)) {

						a[0] ^= a[r];

					}

					r++;

					break;

				}

			}

		}

	}



	printf("%lld", a[0] + (a[0] ^ goukei));



	Would you please return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

#define rep(i, n) for(int i = 0; i < (n); i++)

#define rep1(i, n) for(int i = 1; i <= (n); i++)

#define co(x) cout << (x) << "\n"

#define cosp(x) cout << (x) << " "

#define ce(x) cerr << (x) << "\n"

#define cesp(x) cerr << (x) << " "

#define pb push_back

#define mp make_pair

#define Would

#define you

#define please





int main() {

	cin.tie(0);

	ios::sync_with_stdio(false);





	int N;

	cin >> N;

	ll a[100000];

	ll goukei = 0;

	rep(i, N) {

		cin >> a[i];

		goukei ^= a[i];

	}



	int M = 60;

	int r = 0;

	for (int i = M - 1; i >= 0; i--) {

		if (!(goukei >> i & 1)) {

			for (int j = r; j < N; j++) {

				if (a[j] >> i & 1) {

					swap(a[r], a[j]);

					for (int k = max(j, r + 1); k < N; k++) {

						if (a[k] >> i & 1) {

							a[k] ^= a[r];

						}

					}

					if (!(a[0] >> i & 1)) {

						a[0] ^= a[r];

					}

					r++;

					break;

				}

			}

		}

	}



	co(a[0] + (a[0] ^ goukei));



	Would you please return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.885073059015594x):
//#include<bits/stdc++.h>

#include<cstdio>

#include<algorithm>

using namespace std;

typedef long long ll;

#define rep(i, n) for(int i = 0; i < (n); i++)

#define rep1(i, n) for(int i = 1; i <= (n); i++)

#define co(x) cout << (x) << "\n"

#define cosp(x) cout << (x) << " "

#define ce(x) cerr << (x) << "\n"

#define cesp(x) cerr << (x) << " "

#define pb push_back

#define mp make_pair

#define Would

#define you

#define please



const int cm = 1 << 17;

char cn[cm], * ci = cn + cm, ct;

inline char getcha() {

	if (ci - cn == cm) { fread(cn, 1, cm, stdin); ci = cn; }

	return *ci++;

}

inline ll getint() {

	ll A = 0;

	if (ci - cn + 24 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';

	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';

	return A;

}



int main() {

	//cin.tie(0);

	//ios::sync_with_stdio(false);





	int N = getint();

	ll a[100000];

	ll goukei = 0;

	rep(i, N) {

		a[i] = getint();;

		goukei ^= a[i];

	}



	int M = 60;

	int r = 0;

	for (int i = M - 1; i >= 0; i--) {

		if (!(goukei >> i & 1)) {

			for (int j = r; j < N; j++) {

				if (a[j] >> i & 1) {

					swap(a[r], a[j]);

					for (int k = max(j, r + 1); k < N; k++) {

						if (a[k] >> i & 1) {

							a[k] ^= a[r];

						}

					}

					if (!(a[0] >> i & 1)) {

						a[0] ^= a[r];

					}

					r++;

					break;

				}

			}

		}

	}



	printf("%lld", a[0] + (a[0] ^ goukei));



	Would you please return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



#define loop(i, n) for(int i = 0;i < int(n);i++)

#define rloop(i, n) for(int i = int(n);i >= 0;i--)

#define range(i, a, b) for(int i = int(a);i <= int(b);i++)

#define SZ(c) int(c.size())

#define ALL(c) c.begin(), c.end()

#define RALL(c) c.rbegin(), c.rend()

#define PI acos(-1)

#define pb push_back

#define mp make_pair

#define fr first

#define sc second

#define sfi1(v) scanf("%d",&v)

#define sfi2(v1, v2) scanf("%d %d",&v1,&v2)

#define sfi3(v1, v2, v3) scanf("%d %d %d",&v1,&v2,&v3)

#define sfll1(v) scanf("%I64d",&v);

#define sfll2(v1, v2) scanf("%I64d %I64d",&v1,&v2)

#define sfll3(v1, v2, v3) scanf("%I64d %I64d %I64d",&v1,&v2,&v3)

#define endl '\n'



typedef vector<int> vi;

typedef vector<pair<int, int> > vii;

typedef long long ll;

typedef pair<int, int> pii;





const int N = 1e5 + 10, LOG_A = 60;

ll basis[LOG_A];



void insertVector(ll mask) {

    for (int i = LOG_A - 1; i >= 0; i--) {

        if ((mask & 1LL << i) == 0) continue;



        if (!basis[i]) {

            basis[i] = mask;

            return;

        }



        mask ^= basis[i];

    }

}



int main() {



#ifndef ONLINE_JUDGE

//    freopen("in.in", "r", stdin);

    //freopen("out.in", "w", stdout);

#endif

    ios_base::sync_with_stdio(0);

    cin.tie(0);

    cout.tie(0);



    int n;

    ll all = 0, ans = 0;

    cin >> n;

    vector<ll> v(n);

    for (auto &x : v)cin >> x, all ^= x;

    for (auto &x : v)x &= (~all);

    for (auto &x : v)insertVector(x);

    rloop(i, LOG_A - 1) {

        if (!basis[i])continue;

        if ((ans >> i) & 1)continue;

        ans ^= basis[i];

    }



    cout << ans + ans + all << endl;



    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.325711849885439x):
#include <stdio.h>

#include <stdint.h>

#include <stdbool.h>

#include <stdlib.h>

#include <string.h>



typedef uint64_t ull;

typedef  int64_t sll;



static const ull MOD = 1000000007LL;



int n;

int k;

int q;



ull a[200019];



ull umin (ull a, ull b) {

	return (a < b) ? a : b;

}

ull umax (ull a, ull b) {

	return (a > b) ? a : b;

}



ull solve () {

	sll i, j, ki;

	ull res = 0;



	ull allxor = 0;

	for (i = 0; i < n; i++) {

		allxor ^= a[i];

	}

	for (i = 0; i < n; i++) {

		a[i] &= ~allxor;

	}



	ull rank = 0;

	for (i = 59; i >= 0; i--) {

		for (j = rank; j < n; j++) {

			if (a[j] & (1LL << i)) break;

		}

		if (j == n) {

			continue;

		}



		if (j > rank) a[rank] ^= a[j];

		for (j = rank + 1; j < n; j++) {

			a[j] = umin(a[j], a[j] ^ a[rank]);

		}



		rank++;

	}

	ull x = 0;

	for (i = 0; i < n; i++) {

		x = umax(x, x ^ a[i]);

	}



	res = (x * 2) + allxor;



	return res;

}



int main(void){



	scanf("%d", &n, &k);

	for (int i = 0; i < n; i++) {

		scanf("%lld", &a[i]);

	}



	printf("%lld\n", solve());



	return 0;

}
// Slower C++ solution:
#include <stdio.h>



int n;

long long int A[100000];



// max_{R} xor_R  + (A xor xor_R)

// max_{R} xor_R and ~A



int main(){

  int i;

  long long int a=0, b, c, z=0;

  scanf("%d",&n);

  for(i=0;i<n;i++){

    scanf("%lld", A+i);

    a ^= A[i];

  }



  for(b=1LL<<59;b;b>>=1){

    if(b&a) continue;

    for(i=0;i<n;i++){

      if(A[i]&b) break;

    }

    if(i==n) continue;

    if(!(z&b)) z ^= A[i];

    c = A[i];

    for(;i<n;i++){

      if(A[i]&b) A[i] ^= c;

    }

  }



  printf("%lld\n", 2*(z&~a) + a);



  return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.6761426261918122x):


#include <unistd.h>



int n;

long long int A[100000];



char ibuf[4000000];

char *ibufe = ibuf-1;



void readall(){

  int k, t = 0;

  while((k=read(STDIN_FILENO, ibuf+t, sizeof(ibuf)-t))>0) t += k;

}



long long int read_uintll(){

  long long int x=0;

  while(*(++ibufe) <'0');

  do {

    x *= 10;

    x += *ibufe-'0';

  } while(*(++ibufe) >='0');



  return x;

}



char buf[2100000];

char *bufe = buf;



void write_uintll(long long int x){

  int i;

  static char tmp[14];

  if(x==0){

    *bufe++ = '0';

    *bufe++ = '\n';

    return;

  }



  for(i=0; x; i++){

    tmp[i] = '0' + x % 10;

    x /= 10;

  }

  for(i--; i >= 0; i--){

    *bufe++ = tmp[i];

  }

  *bufe++ = '\n';

}



void writeall(){

  int k, t = 0;

  while((k=write(STDOUT_FILENO, buf+t, bufe-buf-t))>0) t += k;

}







int main(){

  int i;

  long long int a=0, b, c, z=0;

  readall();

  n = read_uintll();

  for(i=0;i<n;i++){

    A[i] = read_uintll();

    a ^= A[i];

  }



  for(b=1LL<<59;b;b>>=1){

    if(b&a) continue;

    for(i=0;i<n;i++){

      if(A[i]&b) break;

    }

    if(i==n) continue;

    if(!(z&b)) z ^= A[i];

    c = A[i];

    for(;i<n;i++){

      if(A[i]&b) A[i] ^= c;

    }

  }



  write_uintll(2*(z&~a) + a);

  writeall();



  return 0;

}
// Slower C++ solution:
#include <stdio.h>



int n;

long long int A[100000];



// max_{R} xor_R  + (A xor xor_R)

// max_{R} xor_R and ~A



int main(){

  int i;

  long long int a=0, b, c, z=0;

  scanf("%d",&n);

  for(i=0;i<n;i++){

    scanf("%lld", A+i);

    a ^= A[i];

  }



  for(b=1LL<<59;b;b>>=1){

    if(b&a) continue;

    for(i=0;i<n;i++){

      if(A[i]&b) break;

    }

    if(i==n) continue;

    if(!(z&b)) z ^= A[i];

    c = A[i];

    for(;i<n;i++){

      if(A[i]&b) A[i] ^= c;

    }

  }



  printf("%lld\n", 2*(z&~a) + a);



  return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.6707844122595132x):
#include <unistd.h>



#define MIN(x,y) ((x)<(y)?(x):(y))

#define MAX(x,y) ((x)>(y)?(x):(y))



int n;

long long int B[60];



char ibuf[4000000];

char *ibufe = ibuf-1;



void readall(){

  int k, t = 0;

  while((k=read(STDIN_FILENO, ibuf+t, sizeof(ibuf)-t))>0) t += k;

}



long long int read_uintll(){

  long long int x=0;

  while(*(++ibufe) <'0');

  do {

    x *= 10;

    x += *ibufe-'0';

  } while(*(++ibufe) >='0');



  return x;

}



char buf[100];

char *bufe = buf;



void write_uintll(long long int x){

  int i;

  static char tmp[14];

  if(x==0){

    *bufe++ = '0';

    *bufe++ = '\n';

    return;

  }



  for(i=0; x; i++){

    tmp[i] = '0' + x % 10;

    x /= 10;

  }

  for(i--; i >= 0; i--){

    *bufe++ = tmp[i];

  }

  *bufe++ = '\n';

}



void writeall(){

  int k, t = 0;

  while((k=write(STDOUT_FILENO, buf+t, bufe-buf-t))>0) t += k;

}







int main(){

  int i, j;

  long long int a=0, z=0;

  readall();

  n = read_uintll();

  for(i=0;i<n;i++){

    long long int x = read_uintll();

    if(!x) continue;

    a ^= x;

    for(j=59;j>=0;j--){

      x = MIN(x, x^B[j]);

    }

    if(x) B[63-__builtin_clzll(x)] = x;

  }

  for(j=0;j<60;j++){

    B[j] &= ~a;

    if(!B[j]) continue;

    if(a&(1LL<<j)){

      int k = 63-__builtin_clzll(B[j]);

      for(;k>=0;k--) B[j] = MIN(B[j], B[j]^B[k]);

      if(B[j]) B[63-__builtin_clzll(B[j])] = B[j];

      B[j] = 0;

    }

  }

  for(j=59;j>=0;j--) z = MAX(z, z^B[j]);



  write_uintll(2*z + a);

  writeall();



  return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define me(a,x) memset(a,x,sizeof(a))

#define IN freopen("in.txt","r",stdin);

#define OUT freopen("out.txt","w",stdout);

#define sc scanf

#define itn int

#define STR clock_t startTime = clock();

#define END clock_t endTime = clock();cout << double(endTime - startTime) / CLOCKS_PER_SEC *1000<< "ms" << endl;

using namespace std;

const int N=1e6+5;

const long long mod=1e9+7;

const long long mod2=998244353;

const int oo=0x7fffffff;

const int sup=0x80000000;

typedef long long ll;

typedef unsigned long long ull;

template <typename it>void db(it *begin,it *end){while(begin!=end)cout<<(*begin++)<<" ";puts("");}

template <typename it>

string to_str(it n){string s="";while(n)s+=n%10+'0',n/=10;reverse(s.begin(),s.end());return s;}

template <typename it>int o(it a){cout<<a<<endl;return 0;}

inline ll mul_64(ll x,ll y,ll c){return (x*y-(ll)((long double)x/c*y)*c+c)%c;}

inline ll ksm(ll a,ll b,ll c){ll ans=1;for(;b;b>>=1,a=a*a%c)if(b&1)ans=ans*a%c;return ans;}

inline void exgcd(ll a,ll b,ll &x,ll &y){if(!b)x=1,y=0;else exgcd(b,a%b,y,x),y-=x*(a/b);}

int n;

ll a[N];

ll dp[65];

bool vis[65]={0};

void insert(ll x){

  for(int i=60;i>=0;i--){

    if(!vis[i])continue; 

    if(x>>i&1){

      if(!dp[i]){

        dp[i]=x;

        break;

      }

      x^=dp[i];

    }

  }

}

ll Q(){

  ll ans=0;

  for(int i=60;i>=0;i--)if(vis[i]&&(ans>>i&1)==0)ans^=dp[i];

  return ans;

}

int main(){

  cin>>n;

  ll sum=0;

  for(int i=1;i<=n;i++){

    sc("%lld",&a[i]);

    sum^=a[i];

  }

  for(int i=0;i<=60;i++){

    if(sum>>i&1)continue;

    vis[i]=1;

  }

  for(int i=1;i<=n;i++)insert(a[i]);

  ll g=Q();

  o((sum^g)+g);

}

// Faster C++ solution for the same problem (measured speedup: 5.218179970769172x):
#include <cstdio>

#include <cstring>

#include <algorithm>

using namespace std;

typedef long long ll;

const int maxd = 1e5+10;

ll p[maxd],a[maxd],sum,ans;

int t[maxd],tot,n;

void insert(ll x)

{

    for(int i=1;i<=tot;i++)

        if((x>>t[i])&1)

        {

            if(p[i]) x^= p[i];

            else

            {

                p[i]=x;

                break;

            }

        }

}

int main()

{

    // freopen("a.in","r",stdin);

    // freopen("k.out","w",stdout);

    scanf("%d",&n);

    for(int i=1;i<=n;i++) scanf("%lld",&a[i]);

    for(int i=1;i<=n;i++) sum ^= a[i];

    for(int i=60;i>=0;i--) if(( (sum>>i)&1) == 0) t[++tot]=i;

    for(int i=1;i<=n;i++) insert(a[i]);

    for(int i=1;i<=tot;i++) 

        if(((ans >>t[i])&1) == 0) ans ^=p[i];

    printf("%lld\n",ans+(sum^ans));





    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(int)(n);i++)

#define all(a) (a).begin(),(a).end()

#define EQ(a,b) (abs((a)-(b))<EPS)

#define fs first

#define sc second



using namespace std;

typedef double D;

typedef pair<int,int> P;

typedef pair<P,P> L;

typedef pair<D,int> pdi;



const D EPS = 1e-8;



inline D func(int x, P a, P b){

  D difx = b.fs - a.fs;

  D dify = b.sc - a.sc;

  return (D)dify/difx * (x-a.fs) + a.sc;

}



int main(){

  int m;

  while(cin >> m,m){

    vector<P> p(m);

    rep(i,m)cin >> p[i].fs >> p[i].sc, p[i].first*=2;

    vector<L> s(m);

    rep(i,m){

      s[i] = L(p[i],p[(i+1)%m]);

      if(s[i].fs > s[i].sc)swap(s[i].fs,s[i].sc);

    }



    int ans = 0;

    for(D x = -3999;x<4000;x+=2){

      vector<pdi> inv;

      rep(i,m){

	if(s[i].fs.fs < x+EPS && x< s[i].sc.fs+EPS){

	  inv.push_back(pdi(func(x,s[i].fs,s[i].sc), i));

	}

      }



      sort(all(inv));

      int prv = -10000;

      for(int i=0;i<(int)inv.size();i+=2){

	int u = inv[i+1].sc, b = inv[i].sc;

	int up = ceil(max(func(x-1,s[u].fs,s[u].sc),

			  func(x+1,s[u].fs,s[u].sc))-EPS);

	int bot = floor(min(func(x-1,s[b].fs,s[b].sc),

			    func(x+1,s[b].fs,s[b].sc))+EPS);

	if(bot<prv)bot = prv;

	ans += up - bot;

	prv = up;

      }

    }

    cout << ans << endl;

  }

}

// Faster C++ solution for the same problem (measured speedup: 1.2221746000030147x):
#include<bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(int)(n);i++)

#define all(a) (a).begin(),(a).end()

#define EQ(a,b) (abs((a)-(b))<EPS)

#define fs first

#define sc second



using namespace std;

typedef double D;

typedef pair<int,int> P;

typedef pair<P,P> L;

typedef pair<D,int> pdi;



const D EPS = 1e-8;



inline D func(int x, P a, P b){

  D difx = b.fs - a.fs;

  D dify = b.sc - a.sc;

  return (D)dify/difx * (x-a.fs) + a.sc;

}



int main(){

  int m,l,r;

  P p[110];

  L s[110];

  while(scanf("%d",&m),m){

    l = 10000, r = -10000;

    rep(i,m){

      scanf("%d%d",&p[i].fs,&p[i].sc);

      p[i].fs*=2;

      l = min(l,p[i].fs);

      r = max(r,p[i].fs);

    }

    rep(i,m){

      s[i] = L(p[i],p[(i+1)%m]);

      if(s[i].fs > s[i].sc)swap(s[i].fs,s[i].sc);

    }



    int ans = 0;

    for(D x=l+1;x<r;x+=2){

      vector<pdi> inv; inv.reserve(110);

      rep(i,m){

	if(s[i].fs.fs < x+EPS && x< s[i].sc.fs+EPS){

	  inv.push_back(pdi(func(x,s[i].fs,s[i].sc), i));

	}

      }



      sort(all(inv));

      int prv = -10000;

      for(int i=0;i<(int)inv.size();i+=2){

	int u = inv[i+1].sc, b = inv[i].sc;

	int up = ceil(max(func(x-1,s[u].fs,s[u].sc),

			  func(x+1,s[u].fs,s[u].sc))-EPS);

	int bot = floor(min(func(x-1,s[b].fs,s[b].sc),

			    func(x+1,s[b].fs,s[b].sc))+EPS);

	if(bot<prv)bot = prv;

	ans += up - bot;

	prv = up;

      }

    }

    printf("%d\n",ans);

  }

}
// Slower C++ solution:
#include<cstdio>

#include<algorithm>

#include<bitset>

#define rep(i,l,r) for (int i=(l); i<=(r); i++)

using namespace std;



const int mod=998244353,N=305;

int mi[N],n,m,k,ans,a[N][N];

bitset<N>b[N],x;



int main(){

	mi[0]=1; rep(i,1,300) mi[i]=2ll*mi[i-1]%mod;

	scanf("%d%d",&n,&m);

	rep(i,1,n){

		x.reset(); int l=-1;

		rep(j,0,m-1) scanf("%d",a[i]+j),x.set(j,a[i][j]);

		rep(j,0,m-1) if (x[j]){

			if (b[j].any()) x^=b[j]; else{ b[j]=x; l=j; break; }

		}

		if (l==-1) k++;

	}

	ans=(1ll*mi[m]*mi[k]+1ll*mi[m-1]*(mi[n]+mod-mi[k]))%mod;

	printf("%lld\n",(1ll*mi[n]*mi[m]+mod-ans)%mod);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.79039692403659x):
#include<bitset>

#include<cstdio>

#include<algorithm>

#define rep(i,l,r) for (int i=(l); i<=(r); i++)

using namespace std;



const int N=510,mod=998244353;

int n,m,y,rk,ans,a[N][N],pw[N];

bitset<N> b[N];



int main(){

	scanf("%d%d",&n,&m); pw[0]=1;

	rep(i,1,n){

		bitset<N>x(0);

		rep(j,1,m) scanf("%d",&y),x[j-1]=y;

		for(int j=m-1; ~j; j--)

			if (x[j]){

				if (b[j].any()) x^=b[j];

				 else{ b[j]=x; break; }

			}

	}

	rep(i,1,max(n,m)) pw[i]=2*pw[i-1]%mod;

	rep(i,0,m-1) if (b[i].any()) rk++;

	ans=1ll*(pw[n]-pw[n-rk])*pw[m-1]%mod;

	printf("%d\n",(ans+mod)%mod);

	return 0;

}