# 2019-11-12 15:53:47(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# import numpy as np 

def main():
    a, b = (int(x) for x in sys.stdin.readline().split())
    print(a + b if b % a == 0 else b - a)



if __name__ == "__main__":
    main() import sys sys def main():
    a, b = (int(x) for x in sys.stdin.readline().split())
    print(a + b if b % a == 0 else b - a) main int(x) for x in sys.stdin.readline().split() for x in sys.stdin.readline().split() x sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split for x in sys.stdin.readline().split() int(x) int x a, b = (int(x) for x in sys.stdin.readline().split()) a (int(x) for x in sys.stdin.readline().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 = (int(x) for x in sys.stdin.readline().split())
    print(a + b if b % a == 0 else b - a) def main():
    a, b = (int(x) for x in sys.stdin.readline().split())
    print(a + b if b % a == 0 else b - a) main
# 2019-11-12 15:53:47(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# import numpy as np 

def main():
    a, b = (int(x) for x in sys.stdin.readline().split())
    print(a + b if b % a == 0 else b - a)



if __name__ == "__main__":
    main()
