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

a, b = rm()
print(a+b if b%a == 0 else b-a) 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(a+b if b%a == 0 else b-a) print a+b if b%a == 0 else b-a b%a == 0 b%a b a 0 a+b a b b-a b a a, b = rm() rm() a b = rm() rm() b rm = lambda: map(int, sys.stdin.buffer.readline().split()) lambda: map(int, sys.stdin.buffer.readline().split()) rm
import sys
rm = lambda: map(int, sys.stdin.buffer.readline().split())

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