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


import sys
import math

def parse_input(lines_as_string = None):

    lines = []
    if lines_as_string is None:
        for line in sys.stdin:
            lines.append(line)
    else:
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    params = lines[0].split(" ")
    a = int(params[0])
    b = int(params[1])

    return (a, b)


def solve(a, b):

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

    return result

def main():
    

    print("%d" % solve(*parse_input()))

if __name__ == '__main__':

    main()

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 print(B-A)

Solution (Python):


import sys

def parse_input(lines_as_string = None):

    lines = []
    if lines_as_string is None:
        for line in sys.stdin:
            lines.append(line)
    else:
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    params = lines[0].split(" ")
    a = int(params[0])
    b = int(params[1])

    return (a, b)


def solve(a, b):

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

    return result

def main():
    

    a, b = parse_input()
    print("%d" % solve(a, b))

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


def parse_input():
    line = [int(e) for e in input().split(" ")]
    a = line[0]
    b = line[1]

    return (a, b)


def solve(a, b):

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

    return str(result)

def main():
    

    a, b = parse_input()
    print(solve(a, b))

if __name__ == '__main__':

    main()

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

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

Solution (Python):
nums = input().split(" ")
num1 = int(nums[0])
num2 = int(nums[1])
if num2 % num1 == 0:
  print(num1+num2)
else:
  print(num2-num1)

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):
import sys
import pprint

pp = pprint.PrettyPrinter(indent=4)

def main():
    """ Code implementation """
    a, b = map(int, input().split())
    if b % a == 0:
        print(b + a)
    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 = [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())
1 <= A <= B <= 20
 
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 solve(a, b):
    return (a+b) if (b % a == 0) else (b-a)
a, b = map(int, input().split())
print(solve(a,b))

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):
i = [int(each) for each in input().split()]

a = i[0]
b = i[1]

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

Solution (Python):
import sys

v = []
for line in sys.stdin:
  v = [int(l) for l in line.split()]

if v[1] % v[0] == 0:
  print(v[0] + v[1])
else:
  print(v[1] - v[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):




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


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


print(ans)

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

Solution (Python):
import os, sys 

s = input()

A, B = map(int, s.split(' '))

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

Solution (Python):




"""








"""
def s(a, b):
    """
    >>> s(1,2)
    3
    >>> s(1,1)
    2
    >>> s(8,20)
    12
    >>> s(4,12)
    16
    """
    if b % a == 0:
        print(a+b)
    else:
        print(b-a)
        
def i():
  return [int(i) for i in input().split()]


if __name__ == '__main__':
  s(*i())

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

Solution (Python):
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(' '))
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 a > b:
	a, b = b, a

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



solve()

Solution (Python):
A, B = [int(x) for x in input().split()]
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 = map(int, raw_input().split())

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

else:
	print b - a

Solution (Python):
AB = input()


mapped_AB  = map(int, AB.split())


listed_AB = list(mapped_AB)
A = listed_AB[0]
B = listed_AB[1]

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())
result = 0

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

print(result)

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

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

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

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

print(K)

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

Solution (Python):
a,b=map(int,input().split())
count=0
for i in range(1,b+1,1):
    if b%i==0:
        if i==a:
            count+=1

if count==1:
    print(a+b)
else:
    print(b-a)

Solution (Python):
a, b = (int(i) for i in input().split())

c = b -  a

ahi = False

for i in range(a):
    if b % a == 0:
        ahi = True

if ahi:
    c = a + b

print(c)

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

Solution (Python):
import sys

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

if b % a == 0:
  print(a + b)
  sys.exit()
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):
x1, x2 = [int(i) for i in input().split()]
if(x2 % x1 == 0):
  print(x1+x2)
else:
  print(x2-x1)

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


import sys, re
from collections import deque, defaultdict, Counter
from math import sqrt, hypot, factorial, pi, sin, cos, radians, log10
if sys.version_info.minor >= 5: from math import gcd
else: from fractions import gcd 
from heapq import heappop, heappush, heapify, heappushpop
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul, xor
from copy import copy, deepcopy
from functools import reduce, partial
from fractions import Fraction
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def round(x): return int((x*2+1) // 2)
def fermat(x, y, MOD): return x * pow(y, MOD-2, MOD) % MOD
def lcm(x, y): return (x * y) // gcd(x, y)
def lcm_list(nums): return reduce(lcm, nums, 1)
def gcd_list(nums): return reduce(gcd, nums, nums[0])
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

A, B = MAP()

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

Solution (Python):
list1 = [int(a) for a in input().split()]
list1_0 = list1[0] 
list1_1 = list1[1] 

if (list1_1 % list1_0) == 0:
    print(list1_0 + list1_1)
else:
    print(list1_1 - list1_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):
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())

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

Solution (Python):

if __name__ == "__main__":
    a, b = map(int, raw_input().split(" "))
    if b % a:
        print(str(b - a))
    else:
        print(str(a + b))

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

if x-y>0:
  A=x
  B=y
else:
  A=y
  B=x

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




def solve(string):
    a, b = map(int, string.split())
    return str(a + b) if b % a == 0 else str(b - a)


if __name__ == '__main__':
    print(solve(input()))

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

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

Solution (Python):
import sys

c = sys.stdin.readline().split()
A = int(c[0])
B = int(c[1])
if B % A == 0:
    print(str(B + A))
else:
    print(str(B - A))

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

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

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(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):
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=input().split()
b=int(a[1])
a=int(a[0])
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().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(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):
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(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())
c=b/a
if c.is_integer()==True:
    print(b+a)
else:
    print(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):

x = list(map(int,input().strip().split()))

a = x[0]
b = x[1]

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

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

Solution (Python):
def main():
	a, b = [int(x) for x in 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:
  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):
tmp_a,tmp_b = input().split()
tmp_a = int(tmp_a)
tmp_b = int(tmp_b)

n = tmp_b//tmp_a
tmp = False
for idx in range(n+1):
    if tmp_b == tmp_a * idx:
        tmp = True

if tmp == True:
    ans = tmp_a + tmp_b
else:
    ans = tmp_b - tmp_a

print(ans)

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


stdin = input().split(' ')
stdin = [ int(c) for c in stdin]
print(main(stdin[0], stdin[1]))

Solution (Python):
import sys

def main():
  input = sys.stdin.readline
  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):

from sys import stdin


s_in = lambda: stdin.readline()[:-1]  
d_in = lambda: int(stdin.readline())  
ds_in = lambda: list(map(int, stdin.readline().split()))  


A, B = ds_in()
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 = 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 :
    R = B - A
else:
    R = A + B
print(R)

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

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

Solution (Python):
s = input().split()
s = [int(i) for i in s]
print(sum(s)) if s[1]%s[0] == 0 else print(s[1] - s[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=(float(i) for i in input().split())
if (b/a).is_integer():
    print(int(a+b))
else:
    print(int(b-a))

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

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

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

Solution (Python):
def inpl():
    return list(map(int, input().split()))


a, b = inpl()

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):
from sys import stdin

A,B = [int(x) for x in stdin.readline().strip().split()]
if not B % A:
    print(A+B)
else:
    print(B-A)

Solution (Python):
from sys import stdin


a, b = [int(x) for x in stdin.readline().rstrip().split()]

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

print(res)

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

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

Solution (Python):
def get_int(): return int(input())
def get_float(): return float(input())
def get_line(): return input().split()
def get_lines(v): return [get_line() for _ in range(v)]
def get_int_line(): return list(map(int, get_line()))
def get_int_lines(v): return [get_int_line() for _ in range(v)]
def get_float_line(): return list(map(float, get_line()))
def get_float_lines(v): return [get_float_line() for _ in range(v)]

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

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

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=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):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-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 pf(s): return print(s, flush=True)


def main():
    a,b = LI()
    if b % a == 0:
        return a + b

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

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,raw_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):
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())
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 = 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 = (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().rstrip().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().strip().split())
if ( b% a == 0):
  print ( a+b)
else:
  print(b-a)

Solution (Python):



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


if __name__ == '__main__':
    main()

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

Solution (Python):
a,b=map(int,input().split())
print(b-a+2*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 not 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());print(b+[a,-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):

import sys


def solve(A: int, B: int):
    if B % A == 0:
        print(A+B)
    else:
        print(B-A)
    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):
A, B = [int(i) for i 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)