a,b=(int(x) for x in input().split())

if b % a ==0:
  print(a+b)
elif b % a !=0:
  print(b-a) int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x a,b=(int(x) for x in input().split()) a (int(x) for x in input().split()) b if b % a ==0:
  print(a+b)
elif b % a !=0:
  print(b-a) b % a ==0 b % a b a 0 print(a+b) print a+b a b elif b % a !=0:
  print(b-a) b % a !=0 b % a b a 0 print(b-a) print b-a b a b=(int(x) for x in input().split()) (int(x) for x in input().split()) b a,b=(int(x) for x in input().split()) (int(x) for x in input().split()) a
a,b=(int(x) for x in input().split())

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