import sys
m,b=map(int,sys.stdin.readline().split())
if b%m==0:
    print(m+b)
else:
    print(b-m) import sys sys m,b=map(int,sys.stdin.readline().split()) m map(int,sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split b if b%m==0:
    print(m+b)
else:
    print(b-m) b%m==0 b%m b m 0 print(m+b) print m+b m b print(b-m) print b-m b m b=map(int,sys.stdin.readline().split()) map(int,sys.stdin.readline().split()) b m,b=map(int,sys.stdin.readline().split()) map(int,sys.stdin.readline().split()) m
import sys
m,b=map(int,sys.stdin.readline().split())
if b%m==0:
    print(m+b)
else:
    print(b-m)