program main
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32)::a,b

    read*, a,b
    if (mod(b,a)==0) then
        print'(i0)', a+b
    else
        print'(i0)', b-a
    end if
end program main