# ABC118 A

def main():
    a, b = map(int, input().split())

    if b % a:
        print(b - a)
    else:
        print(a + b)

if __name__ == '__main__':
    main() def main():
    a, b = map(int, input().split())

    if b % a:
        print(b - a)
    else:
        print(a + b) main a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b if b % a:
        print(b - a)
    else:
        print(a + b) b % a b a print(b - a) print b - a b a print(a + b) print a + b a b if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    a, b = map(int, input().split())

    if b % a:
        print(b - a)
    else:
        print(a + b) def main():
    a, b = map(int, input().split())

    if b % a:
        print(b - a)
    else:
        print(a + b) main
# ABC118 A

def main():
    a, b = map(int, input().split())

    if b % a:
        print(b - a)
    else:
        print(a + b)

if __name__ == '__main__':
    main()