program atcoder
implicit none
integer(16) :: a(2),f(2),i

read(*,*) a(1:2)

a(1) = a(1)-1
f = 0
do i = 1,2
	if(mod(a(i),2) == 0)then
		f(i) = a(i)
        if(mod(a(i)/2,2) == 1)then
    		f(i) = xor(f(i),1)
    	end if
	else if (mod(a(i)/2,2) == 0) then
    	f(i) = 1
	end if
end do

write(*,'(i0)') xor(f(1),f(2))

contains

end program atcoder