Catherine received an array of integers as a gift for March 8. Eventually she grew bored with it, and she started calculated various useless characteristics for it. She succeeded to do it for each one she came up with. But when she came up with another one — xor of all pairwise sums of elements in the array, she realized that she couldn't compute it for a very large array, thus she asked for your help. Can you do it? Formally, you need to compute

$$$ (a_1 + a_2) ⊕ (a_1 + a_3) ⊕ … ⊕ (a_1 + a_n) \\\ ⊕ (a_2 + a_3) ⊕ … ⊕ (a_2 + a_n) \\\ … \\\ ⊕ (a_{n-1} + a_n) \\\ $$$

Here x ⊕ y is a bitwise XOR operation (i.e. x ^ y in many modern programming languages). You can read about it in Wikipedia: <https://en.wikipedia.org/wiki/Exclusive_or#Bitwise_operation>.

Input

The first line contains a single integer n (2 ≤ n ≤ 400 000) — the number of integers in the array.

The second line contains integers a_1, a_2, …, a_n (1 ≤ a_i ≤ 10^7).

Output

Print a single integer — xor of all pairwise sums of integers in the given array.

Examples

Input


2
1 2


Output


3

Input


3
1 2 3


Output


2

Note

In the first sample case there is only one sum 1 + 2 = 3.

In the second sample case there are three sums: 1 + 2 = 3, 1 + 3 = 4, 2 + 3 = 5. In binary they are represented as 011_2 ⊕ 100_2 ⊕ 101_2 = 010_2, thus the answer is 2.

⊕ is the bitwise xor operation. To define x ⊕ y, consider binary representations of integers x and y. We put the i-th bit of the result to be 1 when exactly one of the i-th bits of x and y is 1. Otherwise, the i-th bit of the result is put to be 0. For example, 0101_2   ⊕   0011_2 = 0110_2.
import java.io.*;
import java.util.*;


public class  Main{
	static int solveLower(int i,int[]in,int left,int right) {
		int lo=0,hi=i-1;
		int ans=-1;
		while(lo<=hi) {
			int mid=(lo+hi)>>1;
			int sum=in[i]+in[mid];
			if(sum<left) {
					lo=mid+1;
			}
			else {
				if(sum>right)
				    hi=mid-1;
				else{
				    ans=mid;
			        hi=mid-1;    
				}    
			}
		}
		return ans;
	}
	static int solveUpper(int i,int[]in,int left,int right) {
		int lo=0,hi=i-1;
		int ans=-1;
		while(lo<=hi) {
			int mid=(lo+hi)>>1;
			int sum=in[i]+in[mid];
			if(sum<left) {
					lo=mid+1;
			}
			else {
				if(sum>right)
				    hi=mid-1;
				else{
				    ans=mid;
			        lo=mid+1;    
				}    
			}
		}
		return ans;
	}
	public static void main(String[] args) throws Exception{
		MScanner sc=new MScanner(System.in);
		PrintWriter pw=new PrintWriter(System.out);
		int n=sc.nextInt();
		int[]in=sc.takearr(n);
		int ans=0;
		int tmp[]=new int[n];
		for(int b=0;b<26;b++) {
			for(int i=0;i<n;i++) {
				tmp[i]=in[i]%(1<<(b+1));
			}
			Arrays.sort(tmp);
			
			int left=1<<b,right=(1<<(b+1))-1;
			
			long cnt=0;
			for(int i=1;i<n;i++) {
				int lower=solveLower(i, tmp, left, right);
				if(lower==-1)continue;
				int upper=solveUpper(i, tmp, left, right);
				cnt+=upper-lower+1;
			}
			
			left=(1<<b)+(1<<(b+1));right=(1<<(b+2))-2;
			
			for(int i=1;i<n;i++) {
				int lower=solveLower(i, tmp, left, right);
				if(lower==-1)continue;
				int upper=solveUpper(i, tmp, left, right);
				cnt+=upper-lower+1;
			}
			if(cnt%2==1) {
				ans+=1<<b;
			}
		}
		pw.println(ans);
		pw.flush();
	}
	static class MScanner {
		StringTokenizer st;
		BufferedReader br;
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}
 
		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}
 
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int[] takearr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public long[] takearrl(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public Integer[] takearrobj(int n) throws IOException {
	        Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public Long[] takearrlobj(int n) throws IOException {
	        Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public String nextLine() throws IOException {
			return br.readLine();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public char nextChar() throws IOException {
			return next().charAt(0);
		}
 
		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public boolean ready() throws IOException {
			return br.ready();
		}
 
		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}