{$O-,Q-,R+}
const MaxN=100000;
var i, j, n, t, x:integer;
    a:array [1..MaxN] of integer;
begin
  reset (input, 'xor.in');
  rewrite (output, 'xor.out');
  repeat
    read (n);
    x:=0;
    for i:=1 to n do begin read (a[i]); x:=x xor a[i] end;
    for i:=1 to n do for j:=i+1 to n do begin
      t:=a[i]-a[j]; if t=0 then t:=-1 else t:=(t xor (t-1)) shr 1;
      x:=x xor t
    end;
    writeln (x);
  until seekeof;
end.