program atcoder
implicit none
integer(16) :: a,b,i,f1,f2

read(*,*) a,b

f1 = 0
f2 = 0
do i = 0, a-1
	f1 = xor(f1,i)
end do

do i = 0, b
	f2 = xor(f2,i)
end do

write(*,'(i0)') xor(f1,f2)

contains

end program atcoder