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())

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

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

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

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

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())
print(A+B) if B % A == 0 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 = 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):



def isDivisor(target, n):
    return n % target == 0



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

if isDivisor(a, b):
    output = a + b
else:
    output = b - a

print("{}".format(output))

Solution (Python):
a, b = map(int, input().split())
 
if b % a == 0:
    print(a + b)
elif b % a != 0:
    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):
if __name__ == '__main__':
    a, b = map(int, input().split())
    if b % a:
        print(b - a)
    else:
        print(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):
n,k = map(int, input().split())


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

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());print([b+a,b-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(B+A)
else:
  print(B-A)

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

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

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

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

print(R)

Solution (Python):
a, b = [int(x) for x 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=[int(i) for i in input().split()];print([a+b,b-a][b%a!=0])

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

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

Solution (Python):


import sys


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

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 LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


a, b = LI()
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 == B // A:
    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 = [int(x) for x in 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())
print([a+b,b-a][b%a>0])

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

Solution (Python):
number = input().split()
a = int(number[0])
b = int(number[1])

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):
inp = input().split(' ')

A = int(inp[0])
B = int(inp[1])

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):
N = input().split(" ")
A = int(N[0])
B = int(N[1])

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

print(ans)

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

Solution (Python):




def solveProblem(Seme,Uke):
	amari = Uke % Seme
	if amari == 0:
		answer = Uke + Seme
	else:
		answer = Uke - Seme
	return answer


if __name__ == '__main__':
	A,B = map(int,input().strip().split(' '))
	solution = solveProblem(A,B)
	print("{}".format(solution))

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 = list(map(int, input().split()))

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


if __name__ == '__main__':
  main()

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

Solution (Python):
inputData = input().split(' ')
ans = 0

if int(inputData[1]) % int(inputData[0]) ==0:
    ans = int(inputData[0]) + int(inputData[1])
else:
    ans = int(inputData[1]) - int(inputData[0])
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 = [int(x) for x 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(A+B)
else:
  print(B-A)

Solution (Python):
a,b = map(int,input().split())
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):
a, b = map(int, input().split())
if b % a == 0:
    print(a + b)
else:
    print(b - a)

Solution (Python):
val = input().split(" ")

if int(val[0]) == int(val[1]):
  print(int(val[0]) + int(val[1]))
elif int(val[0]) > int(val[1]):
  if int(val[0]) % int(val[1]) == 0:
    print(int(val[0]) + int(val[1]))
  else:
    print(int(val[1]) - int(val[0]))
elif int(val[0]) < int(val[1]):
  if int(val[1]) % int(val[0]) == 0:
    print(int(val[0]) + int(val[1]))
  else:
    print(int(val[1]) - int(val[0]))

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

Solution (Python):
a, b = map(int, input().rstrip().split(" "))
num = b / a
if num == int(num):
  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 = [int(x) for x in input().split()]

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

Solution (Python):
num = input()
num = num.split()
a = int(num[0])
b = int(num[1])
flag = 0

for i in range(b):
    j = i + 1
    if b % j == 0:
        if a == j:
            flag = 1
            print(a + b)
if flag == 0:
    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):
str = input().split()
a = int(str[0])
b = int(str[1])

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):
print((lambda a:a[1] + (-a[0] if(a[1]%a[0]) else a[0])) (list(map(int,input().split()))) )

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

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

Solution (Python):

import sys



def solve(lines):
    A,B = map(int, lines.pop(0).split(' '))
    if B%A == 0:
        print(A+B)
    else:
        print(B-A)





lines = [x.strip() for x in sys.stdin.readlines()]




solve(lines)

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

Solution (Python):
a, b = list(map(int,input().split()))
if b/a - 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):
a, b = map(int, input().split())

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

Solution (Python):
from sys import stdin

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

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

input = lambda: stdin.readline()
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());print((b-a)*(b%a>0)or a+b)

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

Solution (Python):
from sys import stdin

a, b = stdin.readline().rstrip().split()
a, b = int(a), int(b)

for i in range(1, 21):
    if a * i > b:
        print(b - a)
        break

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

Solution (Python):
s = input()

str1, str2 = s.split()
num1 = int(str1)
num2 = int(str2)

if num2 % num1 == 0:
    print(num1 + num2)
else:
    print(num2 - num1)

Solution (Python):
a = input().split()

b = int(a[0])
c = int(a[1])

if c % b == 0:
  print(c + b)
else:
  print(c - 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().strip().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):
s = input()

num1 = int(s.split()[0])
num2 = int(s.split()[1])

if num2 % num1 == 0:
	print(num1 + num2)
else:
	print(num2 - num1)

Solution (Python):
A,B=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(A+B)

else:
    print(B-A)

Solution (Python):

import sys

def io_generator():
	while True:
		yield raw_input()



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



if __name__ == "__main__":
	io=io_generator()
	print main(io)

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())

wari = b%a
if wari == 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:
    print(B-A)
else:
    print(A+B)

Solution (Python):


def func_a():
  argv = input().split(" ")
  A = int(argv[0]) if int(argv[0]) >= 1 else 0
  B = int(argv[1]) if int(argv[1]) <= 20 else 0

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


if __name__ == "__main__":
  func_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 = [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())
print(a+b if (b%a)==0 else b-a)

Solution (Python):
A, B = [int(x) for x in input().split()]

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

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

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(i) for i in 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):
    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 = (int(x) for x 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:
    c= a + b
    print(c)
else:
    d = b - a
    print(d)

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 = (int(x) for x 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(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:
    ans = a + b
else:
    ans = b - a

print(str(ans))

Solution (Python):
ab=input().split()
a=int(ab[0])
b=int(ab[1])
if (b/a).is_integer():
  print(str(a+b))
else:
  print(str(b-a))

Solution (Python):


if __name__ == '__main__':
    A, B = map(int, input().split(' '))
    print(A + B if B % A == 0 else B - A)

Solution (Python):
def check(a, b):
    if (b % a) == 0:
        return a + b
    else:
        return b - a 

def main():
    [a, b] = [int (num) for num in input().split(" ")]
    print(check(a, b))

if __name__ == "__main__":
    main()

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

Solution (Python):
from sys import stdin


def a_minus_b_or_b_minus_a(a, b):
    if b % a == 0:
        return a + b
    else:
        return b - a

def main():
    input_line = stdin.readline().rstrip()
    a, b = [int(num_string) for num_string in input_line.split(' ')]
    answer = a_minus_b_or_b_minus_a(a, b)
    print(answer)


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:
    c = a+b
else:
    c = b-a

print(c)

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

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

Solution (Python):
a,b=[int(x) for x in 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):
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):
""" AtCoder"""

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

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

Solution (Python):


def main():
    sp = [int(e) for e in input().split(" ")]
    a = sp[0]
    b = sp[1]
    if b%a == 0:
        print(a+b)
    else:
        print(b-a)

main()

Solution (Python):
A, B = map(int, input().split())
if B%A==0:
    print("{}".format(A+B))
else:
    print("{}".format(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 = list(map(int, input().split()))
if a[1] % a[0] == 0:
  b = a[0] + a[1]
if a[1] % a[0] != 0:
  b = a[1] - a[0]
print(b)

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):
A,B = map(int,input().split())

if 0<A<21 and 0<B<21:
    if B%A == 0:
        print(A+B)
    else:
        print(B-A)
else :
    print("error")

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



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

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

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

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

c = B % A
if c ==0:
    ans = A+B
else:
    ans = B-A

print(ans)

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):
num1,num2 = [int(_) for _ in input().split()]
for i in range(num2):
    if num2%(i+1) == 0:
        if i+1 == num1:
            ans = num2+num1
            break
        else:
            ans = num2-num1
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):
import sys
input_lines = sys.stdin.readline()
a,b = input_lines.split( )

a = int(a)
b = int(b)

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

Solution (Python):
if __name__ == "__main__":
    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())
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())
def qA(A,B):
    if B % A == 0:
        print(B+A)
    else:
        print(B-A)
qA(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(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 = [int(v) for v in input().split()]
if b % a == 0:
        print(a + b)
else:
        print(b - a)

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

if int(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:
    ans = A+B
else:
    ans = B - A

print(ans)

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

Solution (Python):


if __name__ == '__main__':
    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):
list = list(map(int, input().split()))
if (list[1] % list[0] == 0):
    print(list[1] + list[0])
else:
    print(list[1] - list[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())

Q = B/A

if Q.is_integer():
    print(A+B)
else:
    print(B-A)

Solution (Python):
As,Bs=input().split()
A=int(As)
B=int(Bs)
C=B/A
Cx=round(C,0)

if Cx==C:
    print(A+B)
else:
    print(B-A)

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

Solution (Python):
def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        divisor_list.append(1)
        for i in range(2, num // 2 + 1):
            if num % i == 0:
                divisor_list.append(i)
        divisor_list.append(num)

        return divisor_list

if __name__ == "__main__":
    A, B = [int(i) for i in input().split()]
    B_list = make_divisor_list(B)
    if A in B_list:
        print(A+B)
    elif A not in B_list:
        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 = (int(i) for i in input().split())  
if B%A == 0:
  print(A + B)
else:
  print(B - A)

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

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

Solution (Python):
data = input().split()
A = int(data[0])
B = int(data[1])
C = B%A
if C == 0 :
    ANS = A+B
else:
    ANS = B - A
print(ANS)

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

   if B%A == 0:
       print(A+B)
   else:
       print(B-A)
judge(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 = list(map(int, input().split()))
num = b % a
if num == 0:
    print(a+b)
else:
    print(b-a)

Solution (Python):
a,b= (int(x) for x in 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):
a,b = map (int , input().split())
if b % a == 0 :
    c = a+b
else:
    c = b-a
print (c)

Solution (Python):
"""
https://atcoder.jp/contests/abc118/tasks/abc118_a
"""


def parse():
    A, B = list(map(int, input().split()))
    return A, B


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


if __name__ == '__main__':
    inputs = parse()
    solve(*inputs)

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

def f(a, b):
    if (b % a == 0):
        return a + b 
    else:
        return b - a 
print(f(a[0], a[1]))

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

Solution (Python):
i = list(map(int, input().split()))
A = i[0]
B = i[1]

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

Solution (Python):
def main():
    row_input = input()
    row_input = row_input.split()
    A = int(row_input[0])
    B = int(row_input[1])

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

if __name__ == '__main__':
    main()

Solution (Python):




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

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

Solution (Python):
s = input()
S = s.split()
A = int(S[0])
B = int(S[1])
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):
import numpy as np
from collections import defaultdict

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

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

Solution (Python):
L = list(map(int, input().split()))
A = L[0]
B = L[1]
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() -> None:
    x = [int(i) for i in input().split()]
    if x[1] % x[0] == 0:
        print(sum(x))
    else:
        print(x[1] - x[0])


if __name__ == '__main__':
    main()

Solution (Python):
a, b = list(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):
a, b = map(int, input().split())
if b / a - b // a == 0:
    print(a + b)
else:
    print(b - a)

Solution (Python):
n = list(map(int, input().split()))
if n[1]%n[0] == 0:
    print(n[0]+n[1])
else:
    print(n[1]-n[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).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:
	c = a + b
else:
	c = b - a
    
print(c)

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):

"""
Created on Sat Feb 16 21:06:50 2019

@author: yff20
"""

l = input().split()
a = int(l[0])
b = int(l[1])

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

Solution (Python):


def solve():
    A, B = map(int, input().split())
    if (B//A)*A == B:
        res = A+B
    else:
        res = B-A

    return str(res)
if __name__ == '__main__':
    print(solve())

Solution (Python):

"""
Created on Sat Feb 16 20:59:53 2019

@author: iwata
"""

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())
result = a + b if b % a == 0 else b - a
print(result)

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()
if (int(B) % int(A)) == 0:
    print(int(B) + int(A))
else:
    print(int(B) - int(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)

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
stdin = sys.stdin
def li(): return map(int, stdin.readline().split())
a, b = tuple(li())
div, mod = divmod(b, a)
if mod == 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 numpy as np

x = input().split()

a = int(x[0])
b = int(x[1])

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=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())
print(a+b) if b%a==0 else print(b-a)

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

Solution (Python):
A, B = map(int, input().split())
if B % A == 0 and B >= A:
    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:
    print(b - a)
else:
    print(a + b)

Solution (Python):
a, b=[int(i) for i in input().split()]
n=0
for i in range(1,30):
    if b == a*i:
        n = n+1
if n ==0:
    print(b-a)
if n==1:
    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 solve():
    ans1, ans2 = map(int, input().split())
    if ans2 % ans1 == 0:
        print(ans1 + ans2)
    else:
        print(ans2 - ans1)

solve()

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

Solution (Python):
A,B = [int(x) for x in input().split(' ')]

pp = B / float(A)
pp2 = int(pp) * A
if abs(pp2 - B) != 0:
  print(B-A)
else:
  print(A+B)

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

amari = B % A

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

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

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

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

print(x)

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

Solution (Python):
a,b = [int(i) for i in input().split()]
if b/a == b//a:
    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)