# coding: utf-8
from sys import stdin
A,B = map(int,stdin.readline().rstrip().split())
print( A + B if B % A == 0 else B - A)  from sys import stdin A,B = map(int,stdin.readline().rstrip().split()) A map(int,stdin.readline().rstrip().split()) map int stdin.readline().rstrip().split() stdin.readline().rstrip().split stdin.readline().rstrip() stdin.readline().rstrip stdin.readline() stdin.readline stdin readline rstrip split B print( A + B if B % A == 0 else B - A) print A + B if B % A == 0 else B - A B % A == 0 B % A B A 0 A + B A B B - A B A A,B = map(int,stdin.readline().rstrip().split()) map(int,stdin.readline().rstrip().split()) A B = map(int,stdin.readline().rstrip().split()) map(int,stdin.readline().rstrip().split()) B
# coding: utf-8
from sys import stdin
A,B = map(int,stdin.readline().rstrip().split())
print( A + B if B % A == 0 else B - A) 