def pay_excess(principal, minimum, remainder):
    """Pay any excess remaining after making minimum payments."""

    excess = remainder

    if principal - excess <= 0:
        excess = principal
        remainder = remainder - principal
    else:
        remainder = 0
    return principal - excess, minimum + excess, remainder