def multiply(a, b):
result = sum(b for _ in range(abs(a)))
return result if a > 0 else -result
print(multiply(2, 5))
print(multiply(-2, -5))
print(multiply(-2, 5))
print(multiply(2, -5))
ZGVmIG11bHRpcGx5KGEsIGIpOgogICAgcmVzdWx0ID0gc3VtKGIgZm9yIF8gaW4gcmFuZ2UoYWJzKGEpKSkKICAgIHJldHVybiByZXN1bHQgaWYgYSA+IDAgZWxzZSAtcmVzdWx0CiAgICAKcHJpbnQobXVsdGlwbHkoMiwgNSkpCnByaW50KG11bHRpcGx5KC0yLCAtNSkpCgpwcmludChtdWx0aXBseSgtMiwgNSkpCnByaW50KG11bHRpcGx5KDIsIC01KSkK