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