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