#!/usr/bin/env python3
a, b = map(int, open(0).read().split())
if b % a == 0:
    print(a+b)
else:
    print(b-a) a, b = map(int, open(0).read().split()) a map(int, open(0).read().split()) map int open(0).read().split() (0).read().split (0).read() (0).read (0) open 0 read split 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 b = map(int, open(0).read().split()) map(int, open(0).read().split()) b a, b = map(int, open(0).read().split()) map(int, open(0).read().split()) a
#!/usr/bin/env python3
a, b = map(int, open(0).read().split())
if b % a == 0:
    print(a+b)
else:
    print(b-a)
