





import os
import sys
from contextlib import contextmanager


# Windows only
if os.name == "nt":
      import ctypes
      import msvcrt  # noqa
      class     SCREAMING_SNAKE_CASE       (ctypes.Structure				):
         # _fields is a specific attr expected by ctypes
         _UpperCamelCase   :		List[Any]			 =	[('size', ctypes.c_int), ('visible', ctypes.c_byte)]




def       __UpperCamelCase  ()    ->       List[Any]:
  if os.name == "nt":
    lowercase__           =  CursorInfo()
    lowercase__           =  ctypes.windll.kernelaa.GetStdHandle(-11		)
    ctypes.windll.kernelaa.GetConsoleCursorInfo(_SCREAMING_SNAKE_CASE		,						ctypes.byref(_SCREAMING_SNAKE_CASE		)		)
    lowercase__           =  False
    ctypes.windll.kernelaa.SetConsoleCursorInfo(_SCREAMING_SNAKE_CASE		,						ctypes.byref(_SCREAMING_SNAKE_CASE		)		)
  elif os.name == "posix":
    sys.stdout.write('\033[?25l'		)
    sys.stdout.flush()




def       __UpperCamelCase  ()    ->       str:
  if os.name == "nt":
    lowercase__           =  CursorInfo()
    lowercase__           =  ctypes.windll.kernelaa.GetStdHandle(-11		)
    ctypes.windll.kernelaa.GetConsoleCursorInfo(_SCREAMING_SNAKE_CASE		,						ctypes.byref(_SCREAMING_SNAKE_CASE		)		)
    lowercase__           =  True
    ctypes.windll.kernelaa.SetConsoleCursorInfo(_SCREAMING_SNAKE_CASE		,						ctypes.byref(_SCREAMING_SNAKE_CASE		)		)
  elif os.name == "posix":
    sys.stdout.write('\033[?25h'		)
    sys.stdout.flush()




@contextmanager
def       __UpperCamelCase  ()    ->       Optional[Any]:
  try:
    hide_cursor()
    yield
  finally:
    show_cursor()









def       __UpperCamelCase  (_SCREAMING_SNAKE_CASE		,						_SCREAMING_SNAKE_CASE		,						_SCREAMING_SNAKE_CASE		)    ->       int:

  if exponent == 1:
    return base
  if exponent % 2 == 0:
    lowercase__           =  _modexpt(_SCREAMING_SNAKE_CASE		,						exponent // 2		,						_SCREAMING_SNAKE_CASE		) % modulo_value
    return (x * x) % modulo_value
  else:
    return (base * _modexpt(_SCREAMING_SNAKE_CASE		,						exponent - 1		,						_SCREAMING_SNAKE_CASE		)) % modulo_value




def       __UpperCamelCase  (_SCREAMING_SNAKE_CASE = 1777		,						_SCREAMING_SNAKE_CASE = 1855		,						_SCREAMING_SNAKE_CASE = 8		)    ->       int:
  lowercase__           =  base
  for _ in range(1		,						_SCREAMING_SNAKE_CASE		):
    lowercase__           =  _modexpt(_SCREAMING_SNAKE_CASE		,						_SCREAMING_SNAKE_CASE		,						10**digits		)

  return result


if __name__ == "__main__":
      print(f'''{solution() = }''')


