# coding: utf-8
# Your code here!

N = input().split()
N_map = map(int,N)

N_list = [x for x in N_map]
a = N_list[0]
b = N_list[1]

if b % a == 0:
    print(b+a)

else:
    print(b-a) N = input().split() N input().split() ().split () input split N_map = map(int,N) N_map map(int,N) map int N x for x in N_map for x in N_map x N_map for x in N_map x N_list = [x for x in N_map] N_list [x for x in N_map] a = N_list[0] a N_list[0] N_list 0 b = N_list[1] b N_list[1] N_list 1 if b % a == 0:
    print(b+a)

else:
    print(b-a) b % a == 0 b % a b a 0 print(b+a) print b+a b a print(b-a) print b-a b a N = input().split() input().split() N N_list = [x for x in N_map] [x for x in N_map] N_list b = N_list[1] N_list[1] b N_map = map(int,N) map(int,N) N_map a = N_list[0] N_list[0] a
# coding: utf-8
# Your code here!

N = input().split()
N_map = map(int,N)

N_list = [x for x in N_map]
a = N_list[0]
b = N_list[1]

if b % a == 0:
    print(b+a)

else:
    print(b-a)