Problem:
 Score : 100 points    Problem Statement You are given positive integers A and B .  If A is a divisor of B , print A + B ; otherwise, print B - A .      Constraints  All values in input are integers.  1 \leq A \leq B \leq 20         Input Input is given from Standard Input in the following format:  A  B       Output If A is a divisor of B , print A + B ; otherwise, print B - A .        Sample Input 1 4 12      Sample Output 1 16  As 4 is a divisor of 12 , 4 + 12 = 16 should be printed.       Sample Input 2 8 20      Sample Output 2 12       Sample Input 3 1 1      Sample Output 3 2  1 is a divisor of 1 .

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

Solution (Python):
a, b = map(int, input().split())

if b % a == 0:
    print(a+b)

else:
    print(b-a)

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

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

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

Solution (Python):
a = list(map(int,input().split()))

if((a[1]%a[0]) == 0):
    print(a[0] + a[1])
else:
    print(a[1] - a[0])

Solution (Python):
a = list(map(int,input().split()))

if a[1] % a[0] == 0:
    print(a[0]+a[1])

else:
    print(a[1]-a[0])

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

Solution (Python):
A, B = map(int, input().split())

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

Solution (Python):
a,b = map(int,input().split())

if b%a == 0 :
    print(a+b)
else :
    print(b-a)

Solution (Python):

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

Solution (Python):
a,b = map(int, input().split())

if b % a ==0:
    print(a+b)

else:
    print(b-a)

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

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

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

Solution (Python):
a,b=map(int, input().split())

if b%a==0:
    print(a+b)
    
else:
    print(b-a)

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

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

Solution (Python):
a,b=map(int,input().split(" "))
print([a+b,b-a][b%a>0])

Solution (Python):
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    a, b = Input()
    print(a+b if b%a==0 else b-a)

main()

Solution (Python):
A,B=map(int,input().split())
if B%A==0:
    print(A+B)
else:
    print(B-A)

Solution (Python):
A,B=map(int,input().split())
if B%A==0:
    print(A+B)
else:
    print(B-A)

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

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

Solution (Python):
A, B = map(int, input().split())

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

Solution (Python):
A, B = map(int, input().split())
if B % A == 0:
    print(A + B)
else:
    print(B - A)

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

Solution (Python):
def resolve():
    A, B = list(map(int, input().split(" ")))
    print(A+B if B%A==0 else B-A)

if '__main__' == __name__:
    resolve()

Solution (Python):
a, b = map(int, input().split())

if b % a == 0:
    print(a + b)
else:
    print(b - a)

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

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

Solution (Python):
A, B = map(int, input().split())
if B % A == 0:
    print(A+B)
else:
    print(B-A)

Solution (Python):
A, B = map(int, input().split())
if B % A == 0:
    print(A + B)
else:
    print(B - A)

Solution (Python):
A, B = map(int, input().split())

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

Solution (Python):
def main():
    a, b = map(int, input().split())

    if b % a == 0:
        print(a + b)
    else:
        print(b - a)


if __name__ == "__main__":
    main()

Solution (Python):
a, b = map(int, input().split())

print(a+b if b%a==0 else b-a)

Solution (Python):
A, B = map(int, input().split())
if B % A == 0:
    print(A+B)
else:
    print(B-A)

Solution (Python):

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

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

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

Solution (Python):
a, b = map(int, input().split())

if b%a == 0:
    ans = a+b
else:
    ans = b-a

print(ans)

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

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

Solution (Python):
A, B = map(int, input().split())
if B % A == 0:
  print(A + B)
else:
  print(B - A)

Solution (Python):
A,B = map(int,input().split())

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

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

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

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

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

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

Solution (Python):
A, B = map(int,input().split())
if B%A == 0:
    print(A+B)
else:
    print(B-A)

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

Solution (Python):
a,b = map(int,input().split())

if b%a == 0:
    print(a+b)

else:
    print(b-a)

Solution (Python):
a,b=map(int,input().split())
print([b-a,b+a][b%a==0])

Solution (Python):
a,b=map(int,input().split())
print([a+b,b-a][b%a!=0])

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

Solution (Python):

str_line = input().split(" ")
num_1 = int(str_line[0])
num_2 = int(str_line[1])

if num_2%num_1 == 0:
    ans = num_1 + num_2
else:
    ans = num_2 - num_1

print(ans)

Solution (Python):
A,B=map(int,input().split())
print(A+B if B%A==0 else B-A)

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

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

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

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

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

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    A, B = map(int, input().split())
    if B % A == 0:
        print(A + B)
    else:
        print(B - A)


if __name__ == '__main__':
    main()

Solution (Python):
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


a, b = LI()
if b % a == 0:
    print(a+b)
else:
    print(b-a)

Solution (Python):
A,B = map(int,input().split())
if B % A == 0:
  print(A+B)
else:
  print(B-A)

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

Solution (Python):
import sys
input = sys.stdin.buffer.readline




def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))



def main():
	a,b=MI()
	if b%a==0:
		ans=a+b
	else:
		ans=b-a
	print(ans)











if __name__ == "__main__":
	main()

Solution (Python):
A, B = map(int, input().split())
if (B%A == 0):
  print(A+B)
else:
  print(B-A)

Solution (Python):
A, B = map(int, input().split())
if B%A==0:
    print(A+B)
else:
    print(B-A)

Solution (Python):
A, B = map(int, input().split())
print(B - A) if B % A else print(A + B)

Solution (Python):



from fractions import gcd
from itertools import combinations,permutations,accumulate, product 

from collections import deque,defaultdict,Counter
import decimal
import re












import sys
sys.setrecursionlimit(10000000)


mod = 998244353
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
a,b = readInts()
print(a+b if b%a == 0 else b-a)

Solution (Python):
a, b = [int(i) for i in input().split()]
if b % a == 0:
    print(a + b)
else:
    print(b - a)

Solution (Python):
A,B=map(int,input().split())
if B%A==0:
	print(A+B)
else:
	print(B-A)

Solution (Python):
A,B = map(int,input().split())
if B%A==0:
    print(B+A)
else:
    print(B-A)

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

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

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

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

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

Solution (Python):
A,B = map(int,input().split())
if B % A == 0:
    print(A+B)
else:
    print(B-A)

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

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A, B = map(int, readline().split())

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

    return


if __name__ == '__main__':
    main()

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

Solution (Python):
A, B = map(int, input().split())

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

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

Solution (Python):
A,B = map (int, input ().split ())
if B%A == 0:
  print (A+B)
else:
  print (B-A)

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

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

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

Solution (Python):
a, b = list(map(int, input().split()))

if b % a == 0:
    print(a+b)
else:
    print(b-a)

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

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

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

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

Solution (Python):
A,B = map(int,input().split())
print(A+B if B%A==0 else B-A)

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    a, b = LI()
    if b % a == 0:
        print(a+b)
        return
    print(b-a)


main()

Solution (Python):








a,b = map(int, input().split())

if b % a == 0:
    print(a+b)
else:
    print(b-a)

Solution (Python):

A, B = map(int, input().split())

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

Solution (Python):
A, B = map(int, input().split())
if B%A==0:
    print(A+B)
else:
    print(B-A)

Solution (Python):
A,B = map(int,input().split())
X = B % A

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

Solution (Python):
A,B=map(int,input().split())
print(A+B if B%A==0 else B-A)

Solution (Python):
A, B = map(int, input().split())

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

Solution (Python):
A,B=list(map(int,input().split()))
if B%A==0:
  print(A+B)
else:
  print(B-A)

Solution (Python):
def main():
    a, b = map(int, input().split())
    if b % a == 0:
        print(a + b)
    else:
        print(b - a)


if __name__ == "__main__":
    main()

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

Solution (Python):
A, B = map(int, input().split())
print(B-A if B%A else A+B)

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

Solution (Python):
A, B = map(int,input().split())

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

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

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

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

Solution (Python):
A,B=map(int,input().split())
if B%A==0 :
  print(A+B)
else :
  print(B-A)

Solution (Python):
A,B=map(int,input().split())
if B%A==0 :
  print(A+B)
else :
  print(B-A)

Solution (Python):
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    a, b = nm()
    print(a + b if b % a == 0 else b - a)


if __name__ == '__main__':
    main()

Solution (Python):
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    A,B=mi()
    if B % A == 0:
        print(A+B)
    else:
        print(B-A)




if __name__ == "__main__":
    main()

Solution (Python):
A,B=map(int, input().split())
if B%A == 0:
    print(A+B)
else:
    print(B-A)

Solution (Python):
a, b = map(int, input().split())

if b % a == 0:
    print(a+b)
else:
    print(b-a)

Solution (Python):
A, B = map(int, input().split())

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

Solution (Python):
a, b = map(int, input().split())

if b % a == 0:
    print(a + b)
else:
    print(b - a)

Solution (Python):
[a,b]=map(int,input().split())
print(a+b if b%a==0 else b-a)

Solution (Python):
[a,b]=map(int,input().split())
print(a+b if b%a==0 else b-a)

Solution (Python):
[a, b] = map(int, input().split())
print(a + b if b % a == 0 else b - a)

Solution (Python):
[a, b] = map(int, input().split())
print(a + b if b % a == 0 else b - a)

Solution (Python):
[a, b] = map(int, input().split())
print(a + b if b % a == 0 else b - a)

Solution (Python):
[a, b] = map(int, input().split())
print(a + b if b % a == 0 else b - a)

Solution (Python):
[a, b] = map(int, input().split())
print(a + b if b % a == 0 else b - a)

Solution (Python):
[a, b] = map(int, input().split())
print(a + b if b % a == 0 else b - a)

Solution (Python):
[a, b] = map(int, input().split())
print(a + b if b % a == 0 else b - a)

Solution (Python):
[a, b] = map(int, input().split())
print(a + b if b % a == 0 else b - a)

Solution (Python):
[a, b] = map(int, input().split())
print(a + b if b % a == 0 else b - a)

Solution (Python):
[a, b] = map(int, input().split())
print(a + b if b % a == 0 else b - a)

Solution (Python):
[a, b] = map(int, input().split())
print(a + b if b % a == 0 else b - a)

Solution (Python):
[a, b] = map(int, input().split())
print(a + b if b % a == 0 else b - a)

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

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

Solution (Python):
[a, b] = map(int, input().split())
print(a + b if b % a == 0 else b - a)

Solution (Python):
[a, b] = map(int, input().split())
print(a + b if b % a == 0 else b - a)

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

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

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

Solution (Python):
a,b=map(int,input().split());print([b-a,a+b][b%a==0])

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

Solution (Python):
A,B = list(map(int,input().split()))
if B % A == 0:
    print(A + B)
else:
    print(B - A)

Solution (Python):
a, b = map(int, input().split())

print(a + b) if b % a == 0 else print ( b - a)

Solution (Python):
a, b = list(map(int, input().split()))
if b % a == 0:
  my_result = a + b
else:
  my_result = b - a
print(my_result)

Solution (Python):
A, B = map(int, input().split())
if B % A == 0:
  print(A + B)
else:
  print(B - A)

Solution (Python):
ary = input().split(" ")
A = int(ary[0])
B = int(ary[1])

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

Solution (Python):
A,B=map(int,input().split())
if B%A==0:
  print(A+B)
else:
  print(B-A)

Solution (Python):
n, m = map(int, input().split())

if m % n == 0:
    print(n + m)
else:
  print(m - n)

Solution (Python):
A,B=map(int,input().split())
if B % A == 0:
  print(A+B)
else:
  print(B-A)

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

Solution (Python):
A, B = map(int, input().split())

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

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

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

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

Solution (Python):














































def calculation(lines):
    
    
    A, B = list(map(int, lines[0].split()))
    
    
    
    

    if B % A == 0:
        result = A+B
    else:
        result = B-A

    return [result]



def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines



def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['4 12']
        lines_export = [16]
    if pattern == 2:
        lines_input = ['8 20']
        lines_export = [12]
    if pattern == 3:
        lines_input = ['1 1']
        lines_export = [2]
    return lines_input, lines_export



def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode



def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    
    
    
    
    
    
    
    
    
    
    



if __name__ == '__main__':
    main()

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

Solution (Python):
a, b = map(int,input().split())

if b % a == 0:
    print(int(a + b))

if b % a != 0:
    print(int(b - a))

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

Solution (Python):
a, b = map(int, input().split())
num = b/a
if num.is_integer():
    print(a+b)
else:
    print(b-a)

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

Solution (Python):
A,B = map(int, input().split())
if B % A == 0:
    print(A + B)
else:
    print(B - A)

Solution (Python):
a, b = map(int, input().split())

b_divisor = [i for i in range(1, b+1) if b % i == 0]


if a in b_divisor:
    print(a+b)
else:
    print(b-a)

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

Solution (Python):
A,B=map(int,input().split())
if B%A==0:
    print(A+B)
else:
    print(B-A)

Solution (Python):
A,B = map(int, input().split())

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

Solution (Python):
A,B=map(int,input().split())
print(A+B if B%A==0 else B-A)

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    a, b = map(int, input().split())
    if b%a == 0:
        print(a+b)
    else:
        print(b-a)
        
if __name__ == '__main__':
    main()

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

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

Solution (Python):
a, b = map(int, input().split())

if b % a == 0:
  print(a + b)
else:
  print(b - a)

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

Solution (Python):
a,b=map(int,input().split())

if b%a==0:
  print(a+b)
else:
  print(b-a)

Solution (Python):
a, b = map(int, input().split())

if b % a == 0:
    print(a + b)
else:
    print(b - a)

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

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    a, b = map(int, readline().split())

    if b % a == 0:
        print(a + b)
    else:
        print(b - a)


if __name__ == '__main__':
    main()

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

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

a,b = map(int, input().split())

if b % a == 0:
    print(a + b)
else:
    print(b - a)

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

Solution (Python):
A,B = map(int,input().split())

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

Solution (Python):






def main():
    a, b = map(int, input().split())
    if b % a == 0:
        return a + b
    else:
        return b - a


print(main())

Solution (Python):
A, B = map(int, input().split())

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

Solution (Python):
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

a,b=mp()
print(a+b if b%a==0 else b-a)

Solution (Python):
A,B = map(int,input().split())
if B%A == 0:
  print(A+B)
else:
  print(B-A)

Solution (Python):
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

a,b=nii()
print(a+b if b%a==0 else b-a)

Solution (Python):
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

a,b=nii()
print(a+b if b%a==0 else b-a)

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

a,b = inpl()
if b%a == 0:
    print(a+b)
else:
    print(b-a)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

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

Solution (Python):
A, B=map(int, input().split())
if B%A==0:
  print(A+B)
else:
  print(B-A)

Solution (Python):
a, b = map(int, input().split())

if b%a==0: print(a+b)
else: print(b-a)

Solution (Python):
def resolve():
  a, b = map(int, input().split())
  if b % a == 0:
    print(a+b)
  else:
    print(b-a)
  return

if __name__ == "__main__":
  resolve()

Solution (Python):
A,B = map(int,input().split())
if B%A==0:
  print(A+B)
else:
  print(B-A)

Solution (Python):
A, B = map(int,input().split())

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

Solution (Python):
import sys
from collections import defaultdict, deque, Counter
import math


from bisect import bisect_left, bisect_right
import heapq




input = sys.stdin.readline

getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = 10 ** 20
MOD = 10**9 + 7
divide = lambda x: pow(x, MOD-2, MOD)


def nck(n, k, kaijyo):
    return (npk(n, k, kaijyo) * divide(kaijyo[k])) % MOD


def npk(n, k, kaijyo):
    if k == 0 or k == n:
        return n % MOD
    return (kaijyo[n] * divide(kaijyo[n-k])) % MOD


def kaijyo(n):
    ret = [1]
    for i in range(1, n + 1):
        ret.append((ret[-1] * i)% MOD)
    return ret

def solve():
    a, b = getList()
    if (b % a) == 0:
        print(a + b)
    else:
        print(b - a)

def main():
    n = getN()
    for _ in range(n):
        solve()


if __name__ == "__main__":
    
    solve()

Solution (Python):
def main():
 a,b = map(int,input().split())
 if b % a == 0:
     print(a + b)
 else:
     print(b - a)
main()

Solution (Python):
a,b = map(int,input().split())
ans = a+b
if b % a != 0:
    ans = b-a
print(ans)

Solution (Python):
A,B=map(int,input().split())
if(B%A==0):
  print(A+B)
else:
  print(B-A)

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

Solution (Python):
a,b=map(int,input().split())

if b%a==0:
  print(a+b)
else:
  print(b-a)

Solution (Python):
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]





A, B = mi()

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

Solution (Python):
A,B=map(int,input().split())
if B%A==0:
  print(A+B)
else:
  print(B-A)

Solution (Python):
def main():
    a,b =map(int,input().split())
    if b%a==0:
       print(a+b)
    else:
        print(b-a)
main()

Solution (Python):
import sys
A,B = map(int,input().split())
if not ( 1 <= A <= 20 and 1 <= B <= 20 ): sys.exit()
print(A + B) if B % A == 0 else print(B - A)

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

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

Solution (Python):
a,b = map(int,input().split())

if b%a == 0:
  print(a+b)
else:
  print(b-a)

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

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

Solution (Python):
def INT():
    return int(input())

def MI():
    return map(int, input().split())

def LI():
    return list(map(int, input().split()))

A, B = MI()

print((-1) ** int(B % A != 0) * A + B)

Solution (Python):
a, b = list(map(int, input().split()))

if b%a == 0:
    print(a+b)
else:
    print(b-a)

Solution (Python):
A,B = (int(X) for X in input().split())
if B%A==0: print(B+A)
else: print(B-A)

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

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

Solution (Python):
import sys
input = sys.stdin.readline
A,B=list(map(int,input().split()))
print(A+B if B%A==0 else B-A)

Solution (Python):
a,b = map(int,input().split())

if b % a == 0:
    print(a+b)
else:
    print(b-a)

Solution (Python):
import sys, os, math, bisect, itertools, collections, heapq, queue

from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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


if __name__ == '__main__':
    main()

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

Solution (Python):
A, B = map(int,input().split())
if B%A == 0:
  print(A+B)
else:
  print(B-A)

Solution (Python):
import sys
rm = lambda: map(int, sys.stdin.buffer.readline().split())

a, b = rm()
print(a+b if b%a == 0 else b-a)

Solution (Python):
import sys
rm = lambda: map(int, sys.stdin.buffer.readline().split())

a, b = rm()
print(b-a if b%a else a+b)

Solution (Python):
import sys
rm = lambda: map(int, sys.stdin.buffer.readline().split())

a, b = rm()
print(b-a if b%a else a+b)

Solution (Python):
a,b=map(int,input().split())
print(a+b-2*a*(b%a>0))

Solution (Python):
A, B = map(int, input().split())

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

Solution (Python):
A, B = map(int, input().split())

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

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

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

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

Solution (Python):
A,B=map(int,input().split())
if B%A==0:
  print(B+A)
else:
  print(B-A)

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

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

Solution (Python):
4,12
a,b = map(int, raw_input().split(' '))
print a + b if (b % a == 0) else -a + b

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

Solution (Python):
A,B = map(int,input().split())
print(A+B if B%A==0 else B-A)

Solution (Python):

import sys
input = sys.stdin.readline
A,B = (int(i) for i in input().split())
if (B/A).is_integer() :
    print(A+B)
else:
    print(B-A)

Solution (Python):
A,B=map(int,input().split())
if B%A==0:
  print(A+B)
else:
  print(B-A)

Solution (Python):
A,B=map(int,input().split())

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

Solution (Python):
A, B = map(int, input().split())
if B % A == 0:
    print(A + B)
else:
    print(B - A)