





import os
import string
import sys


snake_case_							=			1 << 8

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,
}

snake_case_							=			KEYMAP['''up''']
snake_case_							=			KEYMAP['''left''']

if sys.platform == "win32":
				snake_case_							=			[]
				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):
				snake_case_							=			ord(str(i))


def 					A__	(       )   ->     List[Any]:






		if os.name == "nt":
				import msvcrt

				lowerCamelCase   : Optional[Any]								='''mbcs'''
				# Flush the keyboard buffer
				while msvcrt.kbhit():
						msvcrt.getch()
				if len(_UpperCamelCase		) == 0:
						# Read the keystroke
						lowerCamelCase   : int								=msvcrt.getch()

						# If it is a prefix char, get second part
						if ch in (b"\x00", b"\xe0"):
								lowerCamelCase   : Dict								=ch + msvcrt.getch()
								# Translate actual Win chars to bullet char types
								try:
										lowerCamelCase   : str								=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(1_2_6		)		)
										lowerCamelCase   : Any								=chr(KEYMAP['''esc''']		)
								except KeyError:
										lowerCamelCase   : Optional[Any]								=cha[1]
						else:
								lowerCamelCase   : Optional[int]								=ch.decode(_UpperCamelCase		)
				else:
						lowerCamelCase   : List[str]								=WIN_CH_BUFFER.pop(0		)
		elif os.name == "posix":
				import termios
				import tty

				lowerCamelCase   : int								=sys.stdin.fileno()
				lowerCamelCase   : List[Any]								=termios.tcgetattr(_UpperCamelCase		)
				try:
						tty.setraw(_UpperCamelCase		)
						lowerCamelCase   : Any								=sys.stdin.read(1		)
				finally:
						termios.tcsetattr(_UpperCamelCase							,       termios.TCSADRAIN							,       _UpperCamelCase		)
		return ch



def 					A__	(       )   ->     Union[str, Any]:
		lowerCamelCase   : Dict								=get_raw_chars()
		if ord(_UpperCamelCase		) in [KEYMAP["interrupt"], KEYMAP["newline"]]:
				return char

		elif ord(_UpperCamelCase		) == KEYMAP["esc"]:
				lowerCamelCase   : List[Any]								=get_raw_chars()
				if ord(_UpperCamelCase		) == KEYMAP["mod_int"]:
						lowerCamelCase   : int								=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"]








import string


def 					A__	(       SCREAMING_SNAKE_CASE_		)   ->     str:
		lowerCamelCase   : Optional[Any]								=''''''
		for i in sequence:
				lowerCamelCase   : int								=ord(SCREAMING_SNAKE_CASE_		)
				if 6_5 <= extract <= 9_0:
						output += chr(1_5_5 - extract		)
				elif 9_7 <= extract <= 1_2_2:
						output += chr(2_1_9 - extract		)
				else:
						output += i
		return output


def 					A__	(       SCREAMING_SNAKE_CASE_		)   ->     str:
		lowerCamelCase   : Tuple								=string.ascii_letters
		lowerCamelCase   : int								=string.ascii_lowercase[::-1] + string.ascii_uppercase[::-1]
		return "".join(
		    letters_reversed[letters.index(SCREAMING_SNAKE_CASE_		)] if c in letters else c for c in sequence		)


def 					A__	(       )   ->     None:
		from timeit import timeit

		print('''Running performance benchmarks...'''		)
		lowerCamelCase   : Tuple								='''from string import printable ; from __main__ import atbash, atbash_slow'''
		print(F"> atbash_slow(): {timeit('atbash_slow(printable)'							,       setup=SCREAMING_SNAKE_CASE_		)} seconds"		)
		print(F">      atbash(): {timeit('atbash(printable)'							,       setup=SCREAMING_SNAKE_CASE_		)} seconds"		)


if __name__ == "__main__":
				for example in ("ABCDEFGH", "123GGjj", "testStringtest", "with space"):
								print(F"""{example} encrypted in atbash: {atbash(example)}""")
				benchmark()

