def solve():
    a, b = map(int, input().split())
    return a + b if b % a == 0 else b - a


if __name__ == "__main__":
    print(solve()) def solve():
    a, b = map(int, input().split())
    return a + b if b % a == 0 else b - a solve a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b return a + b if b % a == 0 else b - a 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 if __name__ == "__main__":
    print(solve()) __name__ == "__main__" __name__ "__main__" print(solve()) print solve() solve def solve():
    a, b = map(int, input().split())
    return a + b if b % a == 0 else b - a def solve():
    a, b = map(int, input().split())
    return a + b if b % a == 0 else b - a solve
def solve():
    a, b = map(int, input().split())
    return a + b if b % a == 0 else b - a


if __name__ == "__main__":
    print(solve())
