# 初期入力
import sys
input = sys.stdin.readline
A,B = (int(i) for i in input().split())
if (B/A).is_integer() :
    print(A+B)
else:
    print(B-A) import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i A,B = (int(i) for i in input().split()) A (int(i) for i in input().split()) B if (B/A).is_integer() :
    print(A+B)
else:
    print(B-A) (B/A).is_integer() B/A).is_integer B/A B A is_integer print(A+B) print A+B A B print(B-A) print B-A B A input = sys.stdin.readline sys.stdin.readline input B = (int(i) for i in input().split()) (int(i) for i in input().split()) B A,B = (int(i) for i in input().split()) (int(i) for i in input().split()) A
# 初期入力
import sys
input = sys.stdin.readline
A,B = (int(i) for i in input().split())
if (B/A).is_integer() :
    print(A+B)
else:
    print(B-A)