A, B = map(int, input().rstrip().split(' '))
if B % A == 0:
    result = A + B
else:
    result = B - A

print(result)
 A, B = map(int, input().rstrip().split(' ')) A map(int, input().rstrip().split(' ')) map int input().rstrip().split(' ') ().rstrip().split ().rstrip() ().rstrip () input rstrip split ' ' B if B % A == 0:
    result = A + B
else:
    result = B - A B % A == 0 B % A B A 0 result = A + B result A + B A B result = B - A result B - A B A print(result) print result B = map(int, input().rstrip().split(' ')) map(int, input().rstrip().split(' ')) B A, B = map(int, input().rstrip().split(' ')) map(int, input().rstrip().split(' ')) A result = B - A B - A result result = A + B A + B result
A, B = map(int, input().rstrip().split(' '))
if B % A == 0:
    result = A + B
else:
    result = B - A

print(result)

