{$Q+,R+,I+,O-}



uses SysUtils,Math;


const FileName = 'xor';
      MaxLog = 32;
      MaxN = 100000;

var
  u:array[0..MaxLog-1] of integer;
  a:array[1..MaxN,0..MaxLog-1] of integer;
  w:array[1..MaxN] of integer;

procedure poisk(n,l,r:integer);
var p1,p2,t:integer;
    d:int64;
begin
  if n = MaxLog then exit;
  if l>=r then exit;
  p1:=l;
  p2:=l;
  while (p2<=r) do begin
    while (p2<=r) and (a[w[p2]][n] = 0) do inc(p2);
    if p2<=r then begin
      t:=w[p1]; w[p1]:=w[p2];w[p2]:=t;  inc(p1); inc(p2);
    end;
  end;
  d:=p1;
  u[n]:=(u[n]+((((d-l)*(d-l-1)) shr 1) and 1)) and 1;
  u[n]:=(u[n]+((((r-d+1)*(r-d)) shr 1) and 1)) and 1;
  poisk(n+1,l,p1-1);
  poisk(n+1,p1,r);
end;

var y,n,i,j:integer;
    x:array[1..MaxN] of integer;

begin
  reset(input,FileName+'.in');
  rewrite(output,FileName+'.out');
  while not seekeof do begin
    read(n);
    for i:=1 to n do begin
      read(x[i]);
      for j:=0 to MaxLog-1 do a[i][j]:=(x[i] shr j) and 1;
      w[i]:=i;
    end; 
    fillchar(u,sizeof(u),0);
    poisk(0,1,n);
    y:=0;
    for i:=MaxLog-1 downto 0 do y:=y shl 1+(u[i] and 1);
    for i:=1 to n do y:=y xor x[i];
    writeln(y);
  end;

end.