ab = [int(i) for i in input().split()]

a = ab[0]
b = ab[1]

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 ab = [int(i) for i in input().split()] ab [int(i) for i in 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 ab = [int(i) for i in input().split()] [int(i) for i in input().split()] ab b = ab[1] ab[1] b a = ab[0] ab[0] a
ab = [int(i) for i in input().split()]

a = ab[0]
b = ab[1]

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