A, B = [ int(x) for x in input().split() ]

if B % A == 0:
    ans = A + B
else:
    ans = B - A

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

if B % A == 0:
    ans = A + B
else:
    ans = B - A

print(ans)
print()
