
lst_1 = input().split()

A = int(lst_1[0])
B = int(lst_1[1])

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

print(ans) lst_1 = input().split() lst_1 input().split() ().split () input split A = int(lst_1[0]) A int(lst_1[0]) int lst_1[0] lst_1 0 B = int(lst_1[1]) B int(lst_1[1]) int lst_1[1] lst_1 1 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 ans = A + B A + B ans ans = B - A B - A ans A = int(lst_1[0]) int(lst_1[0]) A lst_1 = input().split() input().split() lst_1 B = int(lst_1[1]) int(lst_1[1]) B

lst_1 = input().split()

A = int(lst_1[0])
B = int(lst_1[1])

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

print(ans)