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


abc() def abc():
    a, b = map(int, input().rstrip().split())
    if b % a == 0:
        print(a + b)
    else:
        print(b -a) abc a, b = map(int, input().rstrip().split()) a map(int, input().rstrip().split()) map int input().rstrip().split() ().rstrip().split ().rstrip() ().rstrip () input 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 abc() abc def abc():
    a, b = map(int, input().rstrip().split())
    if b % a == 0:
        print(a + b)
    else:
        print(b -a) def abc():
    a, b = map(int, input().rstrip().split())
    if b % a == 0:
        print(a + b)
    else:
        print(b -a) abc
def abc():
    a, b = map(int, input().rstrip().split())
    if b % a == 0:
        print(a + b)
    else:
        print(b -a)


abc()
