def main24():
    data = input().split()
    num = []
    for i in range(2):
        num.append(int(data[i]))
    if num[1] % num[0] == 0:
        print((num[0]+num[1]))
    else:
        print((num[1]-num[0]))

if __name__ == "__main__":
    main24() def main24():
    data = input().split()
    num = []
    for i in range(2):
        num.append(int(data[i]))
    if num[1] % num[0] == 0:
        print((num[0]+num[1]))
    else:
        print((num[1]-num[0])) main24 data = input().split() data input().split() ().split () input split num = [] num [] for i in range(2):
        num.append(int(data[i]))
     i range(2) range 2 num.append(int(data[i])) num.append num append int(data[i]) int data[i] data i if num[1] % num[0] == 0:
        print((num[0]+num[1]))
    else:
        print((num[1]-num[0])) num[1] % num[0] == 0 num[1] % num[0] num[1] num 1 num[0] num 0 0 print((num[0]+num[1])) print num[0]+num[1] num[0] num 0 num[1] num 1 print((num[1]-num[0])) print num[1]-num[0] num[1] num 1 num[0] num 0 if __name__ == "__main__":
    main24() __name__ == "__main__" __name__ "__main__" main24() main24 def main24():
    data = input().split()
    num = []
    for i in range(2):
        num.append(int(data[i]))
    if num[1] % num[0] == 0:
        print((num[0]+num[1]))
    else:
        print((num[1]-num[0])) def main24():
    data = input().split()
    num = []
    for i in range(2):
        num.append(int(data[i]))
    if num[1] % num[0] == 0:
        print((num[0]+num[1]))
    else:
        print((num[1]-num[0])) main24
def main24():
    data = input().split()
    num = []
    for i in range(2):
        num.append(int(data[i]))
    if num[1] % num[0] == 0:
        print((num[0]+num[1]))
    else:
        print((num[1]-num[0]))

if __name__ == "__main__":
    main24()