A, B = map(int, raw_input().split())
if B%A == 0:
    print A+B
if B%A != 0:
    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 A+B B%A == 0 B%A B A 0 print A+B A B if B%A != 0:
    print B-A B%A != 0 B%A B A 0 print B-A B A B = map(int, raw_input().split()) map(int, raw_input().split()) B A, B = map(int, raw_input().split()) map(int, raw_input().split()) A
A, B = map(int, raw_input().split())
if B%A == 0:
    print A+B
if B%A != 0:
    print B-A
