"""simple docstring"""







from string import ascii_uppercase

_a					:					Dict=			{char: i for i, char in enumerate(ascii_uppercase)}
_a					:					Optional[Any]=			dict(enumerate(ascii_uppercase))
def   __UpperCAmelCase    (   UpperCAmelCase_   :    str      ,							UpperCAmelCase_   :    str  )							->      str:

	'''simple docstring'''





	__snake_case      :							Union[str, Any]						=			len(UpperCAmelCase_  )
	__snake_case      :							int						=			0
	while True:
		if x == i:
			__snake_case      :							str						=			0
		if len(UpperCAmelCase_  ) == len(UpperCAmelCase_  ):
			break
		key += key[i]
		i += 1
	return key
def   __UpperCAmelCase    (   UpperCAmelCase_   :    str      ,							UpperCAmelCase_   :    str  )							->      str:

	'''simple docstring'''





	__snake_case      :							str						=			''
	__snake_case      :							List[Any]						=			0
	for letter in message:
		if letter == " ":
			cipher_text += " "
		else:
			__snake_case      :							Optional[Any]						=			(dicta[letter] - dicta[key_new[i]]) % 26
			i += 1
			cipher_text += dicta[x]
	return cipher_text
def   __UpperCAmelCase    (   UpperCAmelCase_   :    str      ,							UpperCAmelCase_   :    str  )							->      str:

	'''simple docstring'''





	__snake_case      :							Dict						=			''
	__snake_case      :							Optional[Any]						=			0
	for letter in cipher_text:
		if letter == " ":
			or_txt += " "
		else:
			__snake_case      :							str						=			(dicta[letter] + dicta[key_new[i]] + 26) % 26
			i += 1
			or_txt += dicta[x]
	return or_txt
def   __UpperCAmelCase    (   )							->      None:

	'''simple docstring'''





	__snake_case      :							Tuple						=			'THE GERMAN ATTACK'
	__snake_case      :							int						=			'SECRET'
	__snake_case      :							str						=			generate_key(UpperCAmelCase_      ,							UpperCAmelCase_  )
	__snake_case      :							Tuple						=			cipher_text(UpperCAmelCase_      ,							UpperCAmelCase_  )
	print(F"Encrypted Text = {s}"  )
	print(F"Original Text = {original_text(UpperCAmelCase_      ,							UpperCAmelCase_  )}"  )


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	main()






"""simple docstring"""







from decimal import Decimal, getcontext
from math import ceil, factorial
def   __UpperCAmelCase    (   UpperCAmelCase_   :    int  )							->      str:

	'''simple docstring'''





	if not isinstance(UpperCAmelCase_      ,							UpperCAmelCase_  ):
		raise TypeError('Undefined for non-integers'  )
	elif precision < 1:
		raise ValueError('Undefined for non-natural numbers'  )

	__snake_case      :							Any						=			precision
	__snake_case      :							Optional[int]						=			ceil(precision / 14  )
	__snake_case      :							List[Any]						=			42_68_80 * Decimal(1_00_05  ).sqrt()
	__snake_case      :							Optional[Any]						=			1
	__snake_case      :							Union[str, Any]						=			13_59_14_09
	__snake_case      :							int						=			Decimal(UpperCAmelCase_  )
	for k in range(1      ,							UpperCAmelCase_  ):
		__snake_case      :							Union[str, Any]						=			factorial(6 * k  ) // (factorial(3 * k  ) * factorial(UpperCAmelCase_  ) ** 3)
		linear_term += 5_45_14_01_34
		exponential_term *= -26_25_37_41_26_40_76_80_00
		partial_sum += Decimal(multinomial_term * linear_term  ) / exponential_term
	return str(constant_term / partial_sum  )[:-1]


if __name__ == "__main__":
	_a					:					List[Any]=			50
	print(f'''The first {n} digits of pi is: {pi(n)}''')





