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