a, b = input().split()
a = int(a)
b = int(b)

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

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