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