num = [int(e) for e in input().split()]
A=num[0]
B=num[1]
if B%A==0:
    print(A+B)
else:
    print(B-A) int(e) for e in input().split() for e in input().split() e input().split() ().split () input split for e in input().split() int(e) int e num = [int(e) for e in input().split()] num [int(e) for e in input().split()] A=num[0] A num[0] num 0 B=num[1] B num[1] num 1 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 num = [int(e) for e in input().split()] [int(e) for e in input().split()] num B=num[1] num[1] B A=num[0] num[0] A
num = [int(e) for e in input().split()]
A=num[0]
B=num[1]
if B%A==0:
    print(A+B)
else:
    print(B-A)