import os, sys, re, math

(A, B) = [int(n) for n in input().split()]

if B % A == 0:
    print (A + B)
else:
    print (B - A) import os, sys, re, math os sys re math int(n) for n in input().split() for n in input().split() n input().split() ().split () input split for n in input().split() int(n) int n (A, B) = [int(n) for n in input().split()] (A, B) A B [int(n) for n in input().split()] 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
import os, sys, re, math

(A, B) = [int(n) for n in input().split()]

if B % A == 0:
    print (A + B)
else:
    print (B - A)
