A,B=map(int,input().split())
print([B-A,A+B][B%A==0]) A,B=map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split B print([B-A,A+B][B%A==0]) print [B-A,A+B][B%A==0] [B-A,A+B] B-A B A A+B A B B%A==0 B%A B A 0 B=map(int,input().split()) map(int,input().split()) B A,B=map(int,input().split()) map(int,input().split()) A
A,B=map(int,input().split())
print([B-A,A+B][B%A==0])