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