A,B = (int(i) for i in input().split(" "))
if B % A == 0:
    print(A+B)
else:
    print(B-A) int(i) for i in input().split(" ") for i in input().split(" ") i input().split(" ") ().split () input split " " for i in input().split(" ") int(i) int i A,B = (int(i) for i in input().split(" ")) A (int(i) for i in input().split(" ")) B 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 B = (int(i) for i in input().split(" ")) (int(i) for i in input().split(" ")) B A,B = (int(i) for i in input().split(" ")) (int(i) for i in input().split(" ")) A
A,B = (int(i) for i in input().split(" "))
if B % A == 0:
    print(A+B)
else:
    print(B-A)
