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