def resolve():
    A, B = list(map(int, input().split(" ")))
    print(A+B if B%A==0 else B-A)

if '__main__' == __name__:
    resolve() def resolve():
    A, B = list(map(int, input().split(" ")))
    print(A+B if B%A==0 else B-A) resolve A, B = list(map(int, input().split(" "))) A list(map(int, input().split(" "))) list map(int, input().split(" ")) map int input().split(" ") ().split () input split " " B print(A+B if B%A==0 else B-A) print 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 if '__main__' == __name__:
    resolve() '__main__' == __name__ '__main__' __name__ resolve() resolve def resolve():
    A, B = list(map(int, input().split(" ")))
    print(A+B if B%A==0 else B-A) def resolve():
    A, B = list(map(int, input().split(" ")))
    print(A+B if B%A==0 else B-A) resolve
def resolve():
    A, B = list(map(int, input().split(" ")))
    print(A+B if B%A==0 else B-A)

if '__main__' == __name__:
    resolve()