integer(8)A,B;
read*,A,B;A=A-1;
if(mod(B,2)==0)then
    if(mod(B,4)/=0)then
        B=B+1;
    endif
else
    if(mod(B-1,4)==0)then
        B=1
    else
        B=0
    endif
endif
if(mod(A,2)==0)then
    if(mod(A,4)/=0)then
        A=A+1;
    endif
else
    if(mod(A-1,4)==0)then
        A=1
    else
        A=0
    endif
endif
A = xor(A,B);
write(*,'(i0)')A
end