L = list(map(int, input().split()))

sub = L[1] % L[0]

if sub == 0:
    print(L[0]+L[1])
else:
    print(L[1]-L[0]) L = list(map(int, input().split())) L list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split sub = L[1] % L[0] sub L[1] % L[0] L[1] L 1 L[0] L 0 if sub == 0:
    print(L[0]+L[1])
else:
    print(L[1]-L[0]) sub == 0 sub 0 print(L[0]+L[1]) print L[0]+L[1] L[0] L 0 L[1] L 1 print(L[1]-L[0]) print L[1]-L[0] L[1] L 1 L[0] L 0 sub = L[1] % L[0] L[1] % L[0] sub L = list(map(int, input().split())) list(map(int, input().split())) L
L = list(map(int, input().split()))

sub = L[1] % L[0]

if sub == 0:
    print(L[0]+L[1])
else:
    print(L[1]-L[0])