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):
def divisors(x):
    '''公約数をリスト型で返す関数'''
    divisors = []
    divisor = 1
    while(divisor <= x / divisor):
        if x % divisor == 0:
            divisors.append(divisor)
            if divisor == int(x / divisor):
                pass
            else:
                divisors.append(int(x / divisor))
        else:
            pass
        divisor += 1
    return sorted(divisors)

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

if A in divisors(B):
    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())
C = 0

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

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

Solution (Python):

import sys
from bisect import bisect_left

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=list(map(int,input().split()))
print(sum(A) if A[1]%A[0]==0 else A[1]-A[0])

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

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

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

Solution (Python):
a , b = map(int, input().split())
yakusuu_list = []
for i in range(1,b+1):
    if b % i == 0:
        yakusuu_list.append(i)
if a in yakusuu_list:
    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=map(int,input().split(' '))
if b%a==0:
    print(a+b)
else:
    print(b-a)

Solution (Python):

import sys


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


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  
    B = int(next(tokens))  
    solve(A, B)

if __name__ == '__main__':
    main()

Solution (Python):


import sys
input = sys.stdin.readline

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

ans = B % A == 0
print((A + B) if ans 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 +/- A
https://atcoder.jp/contests/abc118/tasks/abc118_a

"""
import sys


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


if __name__ == '__main__':
    main(sys.argv[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())
if B%A == 0:
    print(B+A)
else:
    print(B-A)

Solution (Python):
import sys
from collections import Counter
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def MI(): return map(int, sys.stdin.readline().split())
def II(): return int(sys.stdin.readline())
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def IS(): return input()

a, b = MI()
print(a + b) if b % a == 0 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 (A % B) == 0 or (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)
print((B%A==0)*(A+B)+(B%A!=0)*(B-A))

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007


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


def B():
    n,m = LI()
    d = defaultdict(int)
    for i in range(n):
        l = LI()
        for j in range(1,len(l)):
            d[l[j]] += 1
    ans = 0
    for i in d.values():
        if i == n:
            ans += 1
    print(ans)
    return


def C():
    return


def D():
    return


def E():
    return


def F():
    return


def G():
    return


def H():
    return


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

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

m=B%A

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

def main():
    if B%A == 0:
        return B + A
    else:
        return B - A

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

Solution (Python):
ab = list(map(int, input().split()))
a = ab[0]
b = ab[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 = 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):
DATA=input()
DATA=DATA.split(" ")
A=int(DATA[0])
B=int(DATA[1])

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 a+b)

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

print(a+b if b % a == 0 else 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 divmod(B, A)[1] == 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,open(0).read().split())
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())
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(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):
numbers = [int(i) for i in input().split()]

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

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(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 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 == B // A:
    print(B + A)
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 = 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=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):
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 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 = [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, raw_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):
import sys
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip() 

a,b = na()
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))
else:
    print(int(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())
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 main():
    a, b = get_params()
    print(answer(a, b))


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


def answer(a, b):
    return a+b if b % a == 0 else 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):
def math(A,B):
    if B%A ==0:
        print(A+B)
    else:
        print(B-A)
A,B = tuple(map(int, input().split()))

math(A,B)

Solution (Python):
A,B = tuple(map(int,input().split()))
if int(int(B/A)*A) == B:
    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 = (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 = [int(item) for item 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, raw_input().split())
d = b + a
x = b - a
if b % a == 0:
    print d
else:
    print x

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

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

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

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

Solution (Python):
if __name__ == "__main__":
    A, B = [int(s) for s 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 = 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 = [int(i) for i in raw_input().split()]
if list[1]%list[0] == 0:
 	print(list[0]+list[1])
else:
	print(list[1]-list[0])

Solution (Python):
from sys import stdin
A, B = [int(x) for x in stdin.readline().rstrip().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:
    ans = A + B
else:
    ans = B - A

print(ans)
print()

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 = B % A

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

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

if 0 == 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 = [int(x) for x in input().split()]
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().rstrip().split(' '))
if B % A == 0:
    result = A + B
else:
    result = B - A

print(result)

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

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

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

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

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

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

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

l = map(int, raw_input().split())

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

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

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

Solution (Python):
n,m = map(int,input().split())
res = m % n
if res==0:
    print(m+n)
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(B+A)
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 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 = 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 divisor(A, B):
    if A==1:
        return A + B
    if B==1:
        return B-A
    if B % A == 0:
        return A + B
    return B - A

A, B = map(int, input().split(" "))
print(divisor(A, B))

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

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

Solution (Python):

"""
This file is part of https://github.com/cheran-senthil/PyRival
Copyright 2019 Cheran Senthilkumar <hello@cheran.io>

"""
from __future__ import division, print_function

import itertools
import os
import sys
from atexit import register
from io import BytesIO


class dict(dict):
    """dict() -> new empty dictionary"""

    def items(self):
        """D.items() -> a set-like object providing a view on D's items"""
        return dict.iteritems(self)

    def keys(self):
        """D.keys() -> a set-like object providing a view on D's keys"""
        return dict.iterkeys(self)

    def values(self):
        """D.values() -> an object providing a view on D's values"""
        return dict.itervalues(self)


def gcd(x, y):
    """greatest common divisor of x and y"""
    while y:
        x, y = y, x % y
    return x


range = xrange

filter = itertools.ifilter
map = itertools.imap
zip = itertools.izip

sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
sys.stdout = BytesIO()
register(lambda: os.write(1, sys.stdout.getvalue()))

input = lambda: sys.stdin.readline().rstrip('\r\n')


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):
"""
Atcoder Beginner Contest 118 Problem A(https://atcoder.jp/contests/abc118/tasks/abc118_a)
my code: https://atcoder.jp/contests/abc118/submissions/4279133
"""

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

Solution (Python):
def solve(std_in):
    """
    Calculate two numbers is a side number another number's divisor

    Paramaters
    ----------
    std_in : string
        input to standard input as string

    Returns
    -------
    y : int
        a side number +/- another number
    """
    _in = std_in.split()
    a = int(_in[0])
    b = int(_in[1])

    y = a + b if b % a == 0 else b - a
    return y

  
def main():
    stdin = input()
    out = solve(stdin)
    print(out)


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):
data = input().split()
a = int(data[0])
b = int(data[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):
import sys
num = [int(s) for s in sys.stdin.readline().split()]
if num[1]%num[0] == 0 :
  print (num[0]+num[1])
else :
  print (num[1]-num[0])

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