program x
    integer(8)A,B;
    read*,A,B;A=A-1;
    write(*,'(i0)')xor(xor0to(A),xor0to(B))
contains
function xor0to(x) result(y)
    integer(8) x,y;
    if(mod(x,4)==0)then;y=x;
    else if(mod(x,4)==2)then;y=x+1;
    else if(mod(x,4)==1)then;y=1;
    else if(mod(x,4)==3)then;y=0;
    else if(mod(x,4)==-1)then;y=0;endif;
endfunction xor0to
end program x