




'''simple docstring'''






from __future__ import annotations

from string import ascii_letters






def 		UpperCamelCase__     (		__SCREAMING_SNAKE_CASE							,			__SCREAMING_SNAKE_CASE							,			__SCREAMING_SNAKE_CASE = None		)						->      str:
      snake_case__					:      List[str]  			=						alphabet or ascii_letters

      # The final result string
      snake_case__					:      Optional[Any]  			=						''

      for character in input_string:
            if character not in alpha:
                  # Append without encryption if character is not in the alphabet
                  result += character
            else:
                  # Get the index of the new key and make sure it isn't too large
                  snake_case__					:      Union[str, Any]  			=						(alpha.index(__SCREAMING_SNAKE_CASE		) + key) % len(__SCREAMING_SNAKE_CASE		)

                  # Append the encoded character to the alphabet
                  result += alpha[new_key]

      return result






def 		UpperCamelCase__     (		__SCREAMING_SNAKE_CASE							,			__SCREAMING_SNAKE_CASE							,			__SCREAMING_SNAKE_CASE = None		)						->      str:
      key *= -1

      return encrypt(__SCREAMING_SNAKE_CASE							,			__SCREAMING_SNAKE_CASE							,			__SCREAMING_SNAKE_CASE		)






def 		UpperCamelCase__     (		__SCREAMING_SNAKE_CASE							,			__SCREAMING_SNAKE_CASE = None		)						->      dict[int, str]:
      snake_case__					:      List[str]  			=						alphabet or ascii_letters

      # To store data on all the combinations
      snake_case__					:      List[Any]  			=						{}

      # Cycle through each combination
      for key in range(1							,			len(__SCREAMING_SNAKE_CASE		) + 1		):
            # Decrypt the message and store the result in the data
            snake_case__					:      Any  			=						decrypt(__SCREAMING_SNAKE_CASE							,			__SCREAMING_SNAKE_CASE							,			__SCREAMING_SNAKE_CASE		)

      return brute_force_data


if __name__ == "__main__":
      while True:
            print(F'\n{"-" * 10}\n Menu\n{"-" * 10}')
            print(*["1.Encrypt", "2.Decrypt", "3.BruteForce", "4.Quit"], sep="\n")

            # get user input
            A_ 			=		input("\nWhat would you like to do?: ").strip() or "4"

            # run functions based on what the user chose
            if choice not in ("1", "2", "3", "4"):
                  print("Invalid choice, please enter a valid choice")
            elif choice == "1":
                  A_ 			=		input("Please enter the string to be encrypted: ")
                  A_ 			=		int(input("Please enter off-set: ").strip())

                  print(encrypt(input_string, key))
            elif choice == "2":
                  A_ 			=		input("Please enter the string to be decrypted: ")
                  A_ 			=		int(input("Please enter off-set: ").strip())

                  print(decrypt(input_string, key))
            elif choice == "3":
                  A_ 			=		input("Please enter the string to be decrypted: ")
                  A_ 			=		brute_force(input_string)

                  for key, value in brute_force_data.items():
                        print(F'Key: {key} | Message: {value}')

            elif choice == "4":
                  print("Goodbye.")
                  break






'''simple docstring'''






class 					lowercase_			:





     def __init__(    self    :				Any ):
           snake_case__					:      List[str]  			=						[0]
           snake_case__					:      Optional[Any]  			=						0





     def  _lowerCAmelCase			(    self    :				List[str]    ,       __lowerCamelCase    :				int ):
           snake_case__					:      Optional[int]  			=						self.__heap[i]
           while i // 2 > 0:
                 if self.__heap[i] > self.__heap[i // 2]:
                       snake_case__					:      Union[str, Any]  			=						self.__heap[i // 2]
                       snake_case__					:      Union[str, Any]  			=						temporary
                 i //= 2





     def  _lowerCAmelCase			(    self    :				int    ,       __lowerCamelCase    :				int ):
           self.__heap.append(__lowerCamelCase )
           self.__size += 1
           self.__swap_up(self.__size )





     def  _lowerCAmelCase			(    self    :				Dict    ,       __lowerCamelCase    :				int ):
           while self.__size >= 2 * i:
                 if 2 * i + 1 > self.__size:
                       snake_case__					:      List[str]  			=						2 * i
                 else:
                       if self.__heap[2 * i] > self.__heap[2 * i + 1]:
                             snake_case__					:      Any  			=						2 * i
                       else:
                             snake_case__					:      Tuple  			=						2 * i + 1
                 snake_case__					:      int  			=						self.__heap[i]
                 if self.__heap[i] < self.__heap[bigger_child]:
                       snake_case__					:      Tuple  			=						self.__heap[bigger_child]
                       snake_case__					:      int  			=						temporary
                 snake_case__					:      int  			=						bigger_child





     def  _lowerCAmelCase			(    self    :				Union[str, Any] ):
           snake_case__					:      Any  			=						self.__heap[1]
           snake_case__					:      List[str]  			=						self.__heap[self.__size]
           self.__size -= 1
           self.__heap.pop()
           self.__swap_down(1 )
           return max_value





     @property
     def  _lowerCAmelCase			(    self    :				Union[str, Any] ):
           return self.__heap[1:]





     def __len__(    self    :				int ):
           return self.__size


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      # create an instance of BinaryHeap
      A_ 			=		BinaryHeap()
      binary_heap.insert(6)
      binary_heap.insert(10)
      binary_heap.insert(15)
      binary_heap.insert(12)
      # pop root(max-values because it is max heap)
      print(binary_heap.pop())  # 15
      print(binary_heap.pop())  # 12
      # get the list and size after operations
      print(binary_heap.get_list)
      print(len(binary_heap))
