import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda x: [na() for _ in range(x)]
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()

a, b = na()

if b % a == 0:
    print(a + b)
else:
    print(b - a) import sys sys stdin = sys.stdin stdin sys.stdin sys stdin ni = lambda: int(ns()) ni lambda: int(ns()) int(ns()) int ns() ns na = lambda: list(map(int, stdin.readline().split())) na lambda: list(map(int, stdin.readline().split())) list(map(int, stdin.readline().split())) list map(int, stdin.readline().split()) map int stdin.readline().split() stdin.readline().split stdin.readline() stdin.readline stdin readline split na() for _ in range(x) for _ in range(x) _ range(x) range x for _ in range(x) na() na nan = lambda x: [na() for _ in range(x)] nan lambda x: [na() for _ in range(x)] [na() for _ in range(x)] x ns = lambda: stdin.readline().rstrip() ns lambda: stdin.readline().rstrip() stdin.readline().rstrip() stdin.readline().rstrip stdin.readline() stdin.readline stdin readline rstrip nas = lambda: stdin.readline().split() nas lambda: stdin.readline().split() stdin.readline().split() stdin.readline().split stdin.readline() stdin.readline stdin readline split a, b = na() a na() na b if b % a == 0:
    print(a + b)
else:
    print(b - a) b % a == 0 b % a b a 0 print(a + b) print a + b a b print(b - a) print b - a b a nan = lambda x: [na() for _ in range(x)] lambda x: [na() for _ in range(x)] nan b = na() na() b ns = lambda: stdin.readline().rstrip() lambda: stdin.readline().rstrip() ns na = lambda: list(map(int, stdin.readline().split())) lambda: list(map(int, stdin.readline().split())) na stdin = sys.stdin sys.stdin stdin ni = lambda: int(ns()) lambda: int(ns()) ni nas = lambda: stdin.readline().split() lambda: stdin.readline().split() nas a, b = na() na() a
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda x: [na() for _ in range(x)]
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()

a, b = na()

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