def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    a, b = Input()
    print(a+b if b%a==0 else b-a)

main() def mapt(fn, *args):
    return tuple(map(fn, *args)) mapt return tuple(map(fn, *args)) tuple(map(fn, *args)) tuple map(fn, *args) map fn *args args fn fn *args def Input():
    return mapt(int, input().split(" ")) Input return mapt(int, input().split(" ")) mapt(int, input().split(" ")) mapt int input().split(" ") ().split () input split " " def main():
    a, b = Input()
    print(a+b if b%a==0 else b-a) main a, b = Input() a Input() Input b print(a+b if b%a==0 else b-a) print a+b if b%a==0 else b-a b%a==0 b%a b a 0 a+b a b b-a b a main() main def main():
    a, b = Input()
    print(a+b if b%a==0 else b-a) def main():
    a, b = Input()
    print(a+b if b%a==0 else b-a) main def Input():
    return mapt(int, input().split(" ")) def Input():
    return mapt(int, input().split(" ")) Input def mapt(fn, *args):
    return tuple(map(fn, *args)) def mapt(fn, *args):
    return tuple(map(fn, *args)) mapt
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    a, b = Input()
    print(a+b if b%a==0 else b-a)

main()