# -*- coding: utf-8 -*-

A,B = [int(i) for i in input().rstrip().split()]

print( (A+B) if B%A == 0 else (B-A) ) int(i) for i in input().rstrip().split() for i in input().rstrip().split() i input().rstrip().split() ().rstrip().split ().rstrip() ().rstrip () input rstrip split for i in input().rstrip().split() int(i) int i A,B = [int(i) for i in input().rstrip().split()] A [int(i) for i in input().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 = [int(i) for i in input().rstrip().split()] [int(i) for i in input().rstrip().split()] A B = [int(i) for i in input().rstrip().split()] [int(i) for i in input().rstrip().split()] B
# -*- coding: utf-8 -*-

A,B = [int(i) for i in input().rstrip().split()]

print( (A+B) if B%A == 0 else (B-A) )
