
'''simple docstring'''
def     UpperCamelCase_  (						__SCREAMING_SNAKE_CASE,		__SCREAMING_SNAKE_CASE,		__SCREAMING_SNAKE_CASE							):
    """simple docstring"""






    assert b != 0, "This cannot accept modulo that is == 0"
    if n == 0:
        return 1

    if n % 2 == 1:
        return (bin_exp_mod(__SCREAMING_SNAKE_CASE,		n - 1,		__SCREAMING_SNAKE_CASE							) * a) % b

    snake_case_			:     Optional[Any]        =    bin_exp_mod(__SCREAMING_SNAKE_CASE,		n / 2,		__SCREAMING_SNAKE_CASE							)
    return (r * r) % b


if __name__ == "__main__":
  try:
    a_           =    int(input("Enter Base : ").strip())
    a_           =    int(input("Enter Power : ").strip())
    a_           =    int(input("Enter Modulo : ").strip())
  except ValueError:
    print("Invalid literal for integer")

  print(bin_exp_mod(BASE, POWER, MODULO))






'''simple docstring'''
import itertools

def     UpperCamelCase_  (						__SCREAMING_SNAKE_CASE = 1_0_0_0_0_0_0							):
    """simple docstring"""






    snake_case_			:     Optional[int]        =    [1]

    for i in itertools.count(len(__SCREAMING_SNAKE_CASE							)							):
        snake_case_			:     str        =    0
        for j in itertools.count(1							):
            snake_case_			:     List[str]        =    -1 if j % 2 == 0 else +1
            snake_case_			:     str        =    (j * j * 3 - j) // 2
            if index > i:
                break
            item += partitions[i - index] * sign
            item %= number
            index += j
            if index > i:
                break
            item += partitions[i - index] * sign
            item %= number

        if item == 0:
            return i
        partitions.append(__SCREAMING_SNAKE_CASE							)

    return 0


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  print(f"""{solution() = }""")




