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-----
4 12

-----Sample Output-----
16

As 4 is a divisor of 12, 4 + 12 = 16 should be printed.

Difficulty: introductory

Starter code:

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

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

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

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

else:
    print(b-a)

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

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

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


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

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

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


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

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

else:
    print(b-a)

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


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

# import numpy as np
# import math

# from scipy.special import perm : perm(n, r, exact=True)
# from scipy.special import comb : comb(n, r, exact=True)

# import itertools
# for v in itertools.combinations(L, n):M.append(list(v))

# from numba import njit
# @njit('f8(i8,i8,i8,i8,f8[:,:,:])', cache=True)


""" Definitions  """

def lcm(a, b):
    return a*b//math.gcd(a, b)

MOD = 10**9+7

# ============================================================

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


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

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

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

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

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


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

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

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

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

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

else:
    print(b-a)

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

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

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

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


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

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

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

import sys

input = sys.stdin.readline


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


def __starting_point():
    main()

__starting_point()

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

# A -B+/-A
a, b = list(map(int, input().split()))
if b % a == 0:
    print((a+b))
else:
    print((b-a))


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

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

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

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

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

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

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


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

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

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

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

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


A, B = input().split() 

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

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

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

    return


def __starting_point():
    main()

__starting_point()

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

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



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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [input() for _ in range(n)]

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

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






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

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

#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
import sys
sys.setrecursionlimit(10000000)
#mod = 10**9 + 7
#mod = 9982443453
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))


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

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

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

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

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

print(ans)

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

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

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

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

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

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

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

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

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

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

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

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

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


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)

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

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

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

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

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

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


A,B=map(int,input().split());print([B-A,A+B][B%A==0])

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

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

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

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

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


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

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

a, b = list(map(int, input().split()))
print((a+b - a*2*(b%a!=0)))


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