program prob1
    implicit none
    integer :: a, b
    read(*,*) a, b
    if(mod(b, a) == 0) then
        write(*,*) a+b
    else
        write(*,*) b-a
    end if
    stop
contains
end program prob1