B,A=list(map(int,input().split()))

which=A%B

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

which=A%B

if which==0:
    print(A+B)
else:
    print(A-B)