# ABC118a
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

a, b = map(int, input().split())
print(a+b if b % a == 0 else b-a) import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline sys.setrecursionlimit(10**6) sys.setrecursionlimit sys setrecursionlimit 10**6 10 6 a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split 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 input = sys.stdin.readline sys.stdin.readline input b = map(int, input().split()) map(int, input().split()) b a, b = map(int, input().split()) map(int, input().split()) a
# ABC118a
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

a, b = map(int, input().split())
print(a+b if b % a == 0 else b-a)
