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

    print(a+b if b % a == 0 else b-a)

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

    print(a+b if b % a == 0 else b-a) main a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split 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 if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    a, b = map(int, input().split())

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

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

    print(a+b if b % a == 0 else b-a)

if __name__ == '__main__':
    main()