import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')

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

if b%a==0:
	print(a+b)
else:
	print(b-a) import sys sys if sys.platform =='ios':
    sys.stdin=open('input_file.txt') sys.platform =='ios' sys.platform sys platform 'ios' sys.stdin=open('input_file.txt') sys.stdin sys stdin open('input_file.txt') open 'input_file.txt' 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)
else:
	print(b-a) b%a==0 b%a b a 0 print(a+b) print a+b a b 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
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')

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

if b%a==0:
	print(a+b)
else:
	print(b-a)