list = [int(i) for i in raw_input().split()]
if list[1]%list[0] == 0:
 	print(list[0]+list[1])
else:
	print(list[1]-list[0]) int(i) for i in raw_input().split() for i in raw_input().split() i raw_input().split() ().split () raw_input split for i in raw_input().split() int(i) int i list = [int(i) for i in raw_input().split()] list [int(i) for i in raw_input().split()] if list[1]%list[0] == 0:
 	print(list[0]+list[1])
else:
	print(list[1]-list[0]) list[1]%list[0] == 0 list[1]%list[0] list[1] list 1 list[0] list 0 0 print(list[0]+list[1]) print list[0]+list[1] list[0] list 0 list[1] list 1 print(list[1]-list[0]) print list[1]-list[0] list[1] list 1 list[0] list 0 list = [int(i) for i in raw_input().split()] [int(i) for i in raw_input().split()] list
list = [int(i) for i in raw_input().split()]
if list[1]%list[0] == 0:
 	print(list[0]+list[1])
else:
	print(list[1]-list[0])
