main :: IO ()
main = do
    a <- map toInt . words <$> getLine
    let a0 = a !! 0
        a1 = a !! 1
    print $ if a1 `mod` a0 == 0
        then a1 + a0
        else a1 - a0

toInt :: String -> Int
toInt x = read x :: Int