a = list(map(int,input().split()))
A = a[0]
B = a[1]
if B % A == 0:
    print(str(A+B))
else:
    print(str(B-A)) a = list(map(int,input().split())) a list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split A = a[0] A a[0] a 0 B = a[1] B a[1] a 1 if B % A == 0:
    print(str(A+B))
else:
    print(str(B-A)) B % A == 0 B % A B A 0 print(str(A+B)) print str(A+B) str A+B A B print(str(B-A)) print str(B-A) str B-A B A A = a[0] a[0] A B = a[1] a[1] B a = list(map(int,input().split())) list(map(int,input().split())) a
a = list(map(int,input().split()))
A = a[0]
B = a[1]
if B % A == 0:
    print(str(A+B))
else:
    print(str(B-A))