






from string import ascii_uppercase

a__       =     {char: i for i, char in enumerate(ascii_uppercase)}
a__       =     dict(enumerate(ascii_uppercase))

def _UpperCAmelCase   (	a						:	str  ,					a						:	str ):
							snake_case__	  =       len(a )
							snake_case__	  =       0
							while True:
														if x == i:
																					snake_case__	  =       0
														if len(a ) == len(a ):
																					break
														key += key[i]
														i += 1
							return key

def _UpperCAmelCase   (	a						:	str  ,					a						:	str ):
							snake_case__	  =       """"""
							snake_case__	  =       0
							for letter in message:
														if letter == " ":
																					cipher_text += " "
														else:
																					snake_case__	  =       (dicta[letter] - dicta[key_new[i]]) % 26
																					i += 1
																					cipher_text += dicta[x]
							return cipher_text

def _UpperCAmelCase   (	a						:	str  ,					a						:	str ):
							snake_case__	  =       """"""
							snake_case__	  =       0
							for letter in cipher_text:
														if letter == " ":
																					or_txt += " "
														else:
																					snake_case__	  =       (dicta[letter] + dicta[key_new[i]] + 26) % 26
																					i += 1
																					or_txt += dicta[x]
							return or_txt

def _UpperCAmelCase   (	):
							snake_case__	  =       """THE GERMAN ATTACK"""
							snake_case__	  =       """SECRET"""
							snake_case__	  =       generate_key(a  ,					a )
							snake_case__	  =       cipher_text(a  ,					a )
							print(F'''Encrypted Text = {s}''' )
							print(F'''Original Text = {original_text(a  ,					a )}''' )


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	main()








from math import factorial

a__       =     {str(digit): factorial(digit) for digit in range(1_0)}

def _UpperCAmelCase   (	a						:	int ):
							if not isinstance(a  ,					a ):
														raise TypeError("""Parameter number must be int""" )

							if number < 0:
														raise ValueError("""Parameter number must be greater than or equal to 0""" )

							# Converts number in string to iterate on its digits and adds its factorial.
							return sum(DIGIT_FACTORIAL[digit] for digit in str(a ) )

def _UpperCAmelCase   (	a						:	int = 60  ,					a						:	int = 100_0000 ):

							if not isinstance(a  ,					a ) or not isinstance(a  ,					a ):
														raise TypeError("""Parameters chain_length and number_limit must be int""" )

							if chain_length <= 0 or number_limit <= 0:
														raise ValueError(
														    """Parameters chain_length and number_limit must be greater than 0""" )

							# the counter for the chains with the exact desired length
							snake_case__	  =       0
							# the cached sizes of the previous chains
							snake_case__	  =       {}

							for start_chain_element in range(1  ,					a ):
														# The temporary set will contain the elements of the chain
														snake_case__	  =       set()
														snake_case__	  =       0

														# Stop computing the chain when you find a cached size, a repeating item or the
														# length is greater then the desired one.
														snake_case__	  =       start_chain_element
														while (
														    chain_element not in chain_sets_lengths
														    and chain_element not in chain_set
														    and chain_set_length <= chain_length
														):
																					chain_set.add(a )
																					chain_set_length += 1
																					snake_case__	  =       digit_factorial_sum(a )

														if chain_element in chain_sets_lengths:
																					chain_set_length += chain_sets_lengths[chain_element]

														snake_case__	  =       chain_set_length

														# If chain contains the exact amount of elements increase the counter
														if chain_set_length == chain_length:
																					chains_counter += 1

							return chains_counter


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	print(F'''{solution()}''')
