import sys

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



a, b = rm()

print((b-a if b%a else a+b))
import sys

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



a, b = rm()

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

import sys

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

import sys

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

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