n1, n2  = [int(i) for i in input().split()]

if n2 % n1 == 0:
    r3 = n1 + n2
else:
    r3 = n2 - n1

print(r3) int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i n1, n2  = [int(i) for i in input().split()] n1 [int(i) for i in input().split()] n2 if n2 % n1 == 0:
    r3 = n1 + n2
else:
    r3 = n2 - n1 n2 % n1 == 0 n2 % n1 n2 n1 0 r3 = n1 + n2 r3 n1 + n2 n1 n2 r3 = n2 - n1 r3 n2 - n1 n2 n1 print(r3) print r3 n2  = [int(i) for i in input().split()] [int(i) for i in input().split()] n2 n1, n2  = [int(i) for i in input().split()] [int(i) for i in input().split()] n1 r3 = n1 + n2 n1 + n2 r3 r3 = n2 - n1 n2 - n1 r3
n1, n2  = [int(i) for i in input().split()]

if n2 % n1 == 0:
    r3 = n1 + n2
else:
    r3 = n2 - n1

print(r3)