import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A, B = list(map(int, sys.stdin.buffer.readline().split()))
    print(B+A if B%A == 0 else B-A)


if __name__ == '__main__':
    main() import sys sys import os os def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A, B = list(map(int, sys.stdin.buffer.readline().split()))
    print(B+A if B%A == 0 else B-A) main if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

     os.getenv("LOCAL") os.getenv os getenv "LOCAL" sys.stdin = open("input.txt", "r") sys.stdin sys stdin open("input.txt", "r") open "input.txt" "r" A, B = list(map(int, sys.stdin.buffer.readline().split())) A list(map(int, sys.stdin.buffer.readline().split())) list map(int, sys.stdin.buffer.readline().split()) map int sys.stdin.buffer.readline().split() sys.stdin.buffer.readline().split sys.stdin.buffer.readline() sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline split B print(B+A if B%A == 0 else B-A) print B+A if B%A == 0 else B-A B%A == 0 B%A B A 0 B+A B A B-A B A if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A, B = list(map(int, sys.stdin.buffer.readline().split()))
    print(B+A if B%A == 0 else B-A) def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A, B = list(map(int, sys.stdin.buffer.readline().split()))
    print(B+A if B%A == 0 else B-A) main
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A, B = list(map(int, sys.stdin.buffer.readline().split()))
    print(B+A if B%A == 0 else B-A)


if __name__ == '__main__':
    main()
