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