import sys
rm = lambda: map(int, sys.stdin.buffer.readline().split())

a, b = rm()
print(b-a if b%a else a+b) import sys sys rm = lambda: map(int, sys.stdin.buffer.readline().split()) rm lambda: map(int, sys.stdin.buffer.readline().split()) map(int, sys.stdin.buffer.readline().split()) map int sys.stdin.buffer.readline().split() sys.stdin.buffer.readline().split sys.stdin.buffer.readline() sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline split a, b = rm() a rm() rm b print(b-a if b%a else a+b) print b-a if b%a else a+b b%a b a b-a b a a+b a b rm = lambda: map(int, sys.stdin.buffer.readline().split()) lambda: map(int, sys.stdin.buffer.readline().split()) rm b = rm() rm() b a, b = rm() rm() a
import sys
rm = lambda: map(int, sys.stdin.buffer.readline().split())

a, b = rm()
print(b-a if b%a else a+b)