ab = list(map(int, input().split(' ')))
a = ab[0]
b = ab[1]
if b % a == 0:
    print(a + b)
else:
    print(b - a) ab = list(map(int, input().split(' '))) ab list(map(int, input().split(' '))) list map(int, input().split(' ')) map int input().split(' ') ().split () input split ' ' a = ab[0] a ab[0] ab 0 b = ab[1] b ab[1] ab 1 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 = ab[1] ab[1] b a = ab[0] ab[0] a ab = list(map(int, input().split(' '))) list(map(int, input().split(' '))) ab
ab = list(map(int, input().split(' ')))
a = ab[0]
b = ab[1]
if b % a == 0:
    print(a + b)
else:
    print(b - a)