



import os
import string
import sys


SCREAMING_SNAKE_CASE__   			=   1 << 8

SCREAMING_SNAKE_CASE__   			=   {
    '''tab''': ord('''\t'''),
    '''newline''': ord('''\r'''),
    '''esc''': 2_7,
    '''up''': 6_5 + ARROW_KEY_FLAG,
    '''down''': 6_6 + ARROW_KEY_FLAG,
    '''right''': 6_7 + ARROW_KEY_FLAG,
    '''left''': 6_8 + ARROW_KEY_FLAG,
    '''mod_int''': 9_1,
    '''undefined''': sys.maxsize,
    '''interrupt''': 3,
    '''insert''': 5_0,
    '''delete''': 5_1,
    '''pg_up''': 5_3,
    '''pg_down''': 5_4,
}

SCREAMING_SNAKE_CASE__   			=   KEYMAP['''up''']
SCREAMING_SNAKE_CASE__   			=   KEYMAP['''left''']

if sys.platform == "win32":
							SCREAMING_SNAKE_CASE__   			=   []
							SCREAMING_SNAKE_CASE__   			=   {
							    b'''\xe0H''': KEYMAP['''up'''] - ARROW_KEY_FLAG,
							    b'''\x00H''': KEYMAP['''up'''] - ARROW_KEY_FLAG,
							    b'''\xe0P''': KEYMAP['''down'''] - ARROW_KEY_FLAG,
							    b'''\x00P''': KEYMAP['''down'''] - ARROW_KEY_FLAG,
							    b'''\xe0M''': KEYMAP['''right'''] - ARROW_KEY_FLAG,
							    b'''\x00M''': KEYMAP['''right'''] - ARROW_KEY_FLAG,
							    b'''\xe0K''': KEYMAP['''left'''] - ARROW_KEY_FLAG,
							    b'''\x00K''': KEYMAP['''left'''] - ARROW_KEY_FLAG,
							}

for i in range(1_0):
							SCREAMING_SNAKE_CASE__   			=   ord(str(i))


def A    (							)    ->   Union[str, Any]:
			if os.name == "nt":
						import msvcrt

						A__	  =     'mbcs'
						# Flush the keyboard buffer
						while msvcrt.kbhit():
									msvcrt.getch()
						if len(__UpperCamelCase       ) == 0:
									# Read the keystroke
									A__	  =     msvcrt.getch()

									# If it is a prefix char, get second part
									if ch in (b"\x00", b"\xe0"):
												A__	  =     ch + msvcrt.getch()
												# Translate actual Win chars to bullet char types
												try:
															A__	  =     chr(WIN_KEYMAP[cha]       )
															WIN_CH_BUFFER.append(chr(KEYMAP['mod_int']       )       )
															WIN_CH_BUFFER.append(__UpperCamelCase       )
															if ord(__UpperCamelCase       ) in (
															    KEYMAP["insert"] - 1 << 9,
															    KEYMAP["delete"] - 1 << 9,
															    KEYMAP["pg_up"] - 1 << 9,
															    KEYMAP["pg_down"] - 1 << 9,
															):
																		WIN_CH_BUFFER.append(chr(126       )       )
															A__	  =     chr(KEYMAP['esc']       )
												except KeyError:
															A__	  =     cha[1]
									else:
												A__	  =     ch.decode(__UpperCamelCase       )
						else:
									A__	  =     WIN_CH_BUFFER.pop(0       )
			elif os.name == "posix":
						import termios
						import tty

						A__	  =     sys.stdin.fileno()
						A__	  =     termios.tcgetattr(__UpperCamelCase       )
						try:
									tty.setraw(__UpperCamelCase       )
									A__	  =     sys.stdin.read(1       )
						finally:
									termios.tcsetattr(__UpperCamelCase			,						termios.TCSADRAIN			,						__UpperCamelCase       )
			return ch






def A    (							)    ->   Dict:
			A__	  =     get_raw_chars()
			if ord(__UpperCamelCase       ) in [KEYMAP["interrupt"], KEYMAP["newline"]]:
						return char

			elif ord(__UpperCamelCase       ) == KEYMAP["esc"]:
						A__	  =     get_raw_chars()
						if ord(__UpperCamelCase       ) == KEYMAP["mod_int"]:
									A__	  =     get_raw_chars()
									if ord(__UpperCamelCase       ) >= KEYMAP["arrow_begin"] - ARROW_KEY_FLAG and ord(__UpperCamelCase       ) <= KEYMAP["arrow_end"] - ARROW_KEY_FLAG:
												return chr(ord(__UpperCamelCase       ) + ARROW_KEY_FLAG       )
									else:
												return KEYMAP["undefined"]
						else:
									return get_raw_chars()

			else:
						if char in string.printable:
									return char
						else:
									return KEYMAP["undefined"]









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

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


def A    (							__UpperCamelCase = 1_777			,						__UpperCamelCase = 1_855			,						__UpperCamelCase = 8       )    ->   int:
			A__	  =     base
			for _ in range(1			,						__UpperCamelCase       ):
						A__	  =     _modexpt(__UpperCamelCase			,						__UpperCamelCase			,						10**digits       )

			return result


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




