A,B = map(int,input().split())
if B%A == 0:
    print(A+B)
elif B%A != 0:
    print(B-A)
else:
    pass A,B = map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split B if B%A == 0:
    print(A+B)
elif B%A != 0:
    print(B-A)
else:
    pass B%A == 0 B%A B A 0 print(A+B) print A+B A B elif B%A != 0:
    print(B-A) B%A != 0 B%A B A 0 print(B-A) print B-A B A B = map(int,input().split()) map(int,input().split()) B A,B = map(int,input().split()) map(int,input().split()) A
A,B = map(int,input().split())
if B%A == 0:
    print(A+B)
elif B%A != 0:
    print(B-A)
else:
    pass