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