

from __future__ import annotations

UpperCamelCase__					: Tuple								=      "Alexander Joslin"


def    _UpperCAmelCase    (					_SCREAMING_SNAKE_CASE   :						int    ):





    """simple docstring"""


    if number <= 0:
        SCREAMING_SNAKE_CASE_													=  f"""n must be greater than 0. Got n = {number}"""
        raise ValueError(_SCREAMING_SNAKE_CASE    )

    SCREAMING_SNAKE_CASE_													=  [number + 1] * (number + 1)

    # starting position
    SCREAMING_SNAKE_CASE_													=  0
    for i in range(1	,				_SCREAMING_SNAKE_CASE    ):
        SCREAMING_SNAKE_CASE_													=  min(table[i + 1]	,				table[i] + 1    )
        # check if out of bounds
        if i * 2 <= number:
            SCREAMING_SNAKE_CASE_													=  min(table[i * 2]	,				table[i] + 1    )
        # check if out of bounds
        if i * 3 <= number:
            SCREAMING_SNAKE_CASE_													=  min(table[i * 3]	,				table[i] + 1    )
    return table[number]


if __name__ == "__main__":
       import doctest

       doctest.testmod()





def    _UpperCAmelCase    (					_SCREAMING_SNAKE_CASE   :						int	,				_SCREAMING_SNAKE_CASE   :						int	,				_SCREAMING_SNAKE_CASE   :						int    ):





    """simple docstring"""


    if power < 0:
        return -1
    base %= mod
    SCREAMING_SNAKE_CASE_													=  1

    while power > 0:
        if power & 1:
            SCREAMING_SNAKE_CASE_													=  (result * base) % mod
        SCREAMING_SNAKE_CASE_													=  power >> 1
        SCREAMING_SNAKE_CASE_													=  (base * base) % mod

    return result


def    _UpperCAmelCase    (					):





    """simple docstring"""


    print(modular_exponential(3	,				200	,				13    )    )


if __name__ == "__main__":
       import doctest

       doctest.testmod()

       main()


