x, y = map(int, input().split())
if y % x == 0:
    print(x+y)
else:
    print(y-x) x, y = map(int, input().split()) x map(int, input().split()) map int input().split() ().split () input split y if y % x == 0:
    print(x+y)
else:
    print(y-x) y % x == 0 y % x y x 0 print(x+y) print x+y x y print(y-x) print y-x y x x, y = map(int, input().split()) map(int, input().split()) x y = map(int, input().split()) map(int, input().split()) y
x, y = map(int, input().split())
if y % x == 0:
    print(x+y)
else:
    print(y-x)
