def ans():

  a, b = list(map(int,input().split()))

  if(b%a == 0):

    print((a+b))

  else:

    print((b-a))

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

if(B%A == 0):

  print((A+B))

else:

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


ans()

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

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