# -*- coding: utf-8 -*-

# input
A, B = map(int, input().split())

# solve
ans = A + B if B % A == 0 else B - A

# output
print(ans) A, B = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B ans = A + B if B % A == 0 else B - A ans A + B if B % A == 0 else B - A B % A == 0 B % A B A 0 A + B A B B - A B A print(ans) print ans ans = A + B if B % A == 0 else B - A A + B if B % A == 0 else B - A ans A, B = map(int, input().split()) map(int, input().split()) A B = map(int, input().split()) map(int, input().split()) B
# -*- coding: utf-8 -*-

# input
A, B = map(int, input().split())

# solve
ans = A + B if B % A == 0 else B - A

# output
print(ans)
