a, b = map(int, input().split())
if a <= a <= b <= 20:
    if 0 == b % a:
        print(a + b)
    else:
        print(b - a)
else:
    print('hoge') a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b if a <= a <= b <= 20:
    if 0 == b % a:
        print(a + b)
    else:
        print(b - a)
else:
    print('hoge') a <= a <= b <= 20 a <= a <= b a <= a a a b 20 if 0 == b % a:
        print(a + b)
    else:
        print(b - a) 0 == b % a 0 b % a b a print(a + b) print a + b a b print(b - a) print b - a b a print('hoge') print 'hoge' a, b = map(int, input().split()) map(int, input().split()) a b = map(int, input().split()) map(int, input().split()) b
a, b = map(int, input().split())
if a <= a <= b <= 20:
    if 0 == b % a:
        print(a + b)
    else:
        print(b - a)
else:
    print('hoge')