first = input()
(sA, sB, ) = first.split()
A = int(sA)
B = int(sB)
if B%A == 0:
    print(A+B)
else:
    print(B-A) first = input() first input() input (sA, sB, ) = first.split() (sA, sB, ) sA sB first.split() first.split first split A = int(sA) A int(sA) int sA B = int(sB) B int(sB) int sB if B%A == 0:
    print(A+B)
else:
    print(B-A) B%A == 0 B%A B A 0 print(A+B) print A+B A B print(B-A) print B-A B A first = input() input() first B = int(sB) int(sB) B A = int(sA) int(sA) A
first = input()
(sA, sB, ) = first.split()
A = int(sA)
B = int(sB)
if B%A == 0:
    print(A+B)
else:
    print(B-A)