from sys import stdin

a,b = [int(x) for x in stdin.readline().rstrip().split()]

if b%a == 0:
    print(a+b)
else:
    print(b-a) from sys import stdin int(x) for x in stdin.readline().rstrip().split() for x in stdin.readline().rstrip().split() x stdin.readline().rstrip().split() stdin.readline().rstrip().split stdin.readline().rstrip() stdin.readline().rstrip stdin.readline() stdin.readline stdin readline rstrip split for x in stdin.readline().rstrip().split() int(x) int x a,b = [int(x) for x in stdin.readline().rstrip().split()] a [int(x) for x in stdin.readline().rstrip().split()] 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 b = [int(x) for x in stdin.readline().rstrip().split()] [int(x) for x in stdin.readline().rstrip().split()] b a,b = [int(x) for x in stdin.readline().rstrip().split()] [int(x) for x in stdin.readline().rstrip().split()] a
from sys import stdin

a,b = [int(x) for x in stdin.readline().rstrip().split()]

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