'''simple docstring'''

from __future__ import annotations

from collections.abc import Iterable, Iterator
from typing import Any, Generic, TypeVar

_lowerCamelCase :				List[Any]														= TypeVar("""T""", bound=bool)




class    lowerCamelCase__  (   Generic[T]     ):



   def __init__(    self					,      lowerCAmelCase__     )				->     None:
        """simple docstring"""





        _UpperCamelCase  :T       =value
        _UpperCamelCase  :SkewNode[T] | None       =None
        _UpperCamelCase  :SkewNode[T] | None       =None



   @property
   def  _UpperCamelCase		(    self     )				->     T:
        """simple docstring"""





        return self._value




   @staticmethod
   def  _UpperCamelCase		(    lowerCAmelCase__					,      lowerCAmelCase__     )				->     SkewNode[T] | None:
        """simple docstring"""





        if not roota:
             return roota

        if not roota:
             return roota

        if roota.value > roota.value:
             _UpperCamelCase       ,      _UpperCamelCase  :Optional[int]       =roota, roota

        _UpperCamelCase  :Any       =roota
        _UpperCamelCase  :List[Any]       =roota.right
        _UpperCamelCase  :Dict       =roota.left
        _UpperCamelCase  :Optional[int]       =SkewNode.merge(lowerCAmelCase__					,      lowerCAmelCase__     )

        return result




class    lowerCamelCase__  (   Generic[T]     ):



   def __init__(    self					,      lowerCAmelCase__ = ()     )				->     None:
        """simple docstring"""





        _UpperCamelCase  :SkewNode[T] | None       =None
        if data:
             for item in data:
                  self.insert(lowerCAmelCase__     )



   def __bool__(    self     )				->     bool:
        """simple docstring"""





        return self._root is not None



   def __iter__(    self     )				->     Iterator[T]:
        """simple docstring"""





        _UpperCamelCase  :list[Any]       =[]
        while self:
             result.append(self.pop()     )

        # Pushing items back to the heap not to clear it.
        for item in result:
             self.insert(lowerCAmelCase__     )

        return iter(lowerCAmelCase__     )



   def  _UpperCamelCase		(    self					,      lowerCAmelCase__     )				->     None:
        """simple docstring"""





        _UpperCamelCase  :Dict       =SkewNode.merge(self._root					,      SkewNode(lowerCAmelCase__     )     )



   def  _UpperCamelCase		(    self     )				->     T | None:
        """simple docstring"""





        _UpperCamelCase  :Optional[int]       =self.top()
        _UpperCamelCase  :str       =(
            SkewNode.merge(self._root.left					,      self._root.right     ) if self._root else None
        )

        return result



   def  _UpperCamelCase		(    self     )				->     T:
        """simple docstring"""





        if not self._root:
             raise IndexError("""Can't get top element for the empty heap."""     )
        return self._root.value




   def  _UpperCamelCase		(    self     )				->     None:
        """simple docstring"""





        _UpperCamelCase  :int       =None


if __name__ == "__main__":
      import doctest

      doctest.testmod()

'''simple docstring'''


__SCREAMING_SNAKE_CASE						=      [chr(i) for i in range(32, 126)]
__SCREAMING_SNAKE_CASE						=      list(range(len(alphabets)))
__SCREAMING_SNAKE_CASE						=      list(range(len(alphabets)))
__SCREAMING_SNAKE_CASE						=      list(range(len(alphabets)))
__SCREAMING_SNAKE_CASE						=      list(reversed(range(len(alphabets))))
__SCREAMING_SNAKE_CASE						=      []
__SCREAMING_SNAKE_CASE						=      __SCREAMING_SNAKE_CASE						=      __SCREAMING_SNAKE_CASE						=      0
def 					__magic_name__(       ):
						global gear_one_pos
						global gear_two_pos
						global gear_three_pos
						UpperCamelCase_     :	List[Any]					     =     gear_one[0]
						gear_one.append(UpperCAmelCase__	)
						del gear_one[0]
						gear_one_pos += 1
						if gear_one_pos % int(len(UpperCAmelCase__	)	) == 0:
												UpperCamelCase_     :	List[str]					     =     gear_two[0]
												gear_two.append(UpperCAmelCase__	)
												del gear_two[0]
												gear_two_pos += 1
												if gear_two_pos % int(len(UpperCAmelCase__	)	) == 0:
																		UpperCamelCase_     :	List[Any]					     =     gear_three[0]
																		gear_three.append(UpperCAmelCase__	)
																		del gear_three[0]
																		gear_three_pos += 1
def 					__magic_name__(       UpperCAmelCase__ :       int	):
						UpperCamelCase_     :	Any					     =     alphabets.index(UpperCAmelCase__	)
						UpperCamelCase_     :	List[str]					     =     gear_one[target]
						UpperCamelCase_     :	str					     =     gear_two[target]
						UpperCamelCase_     :	int					     =     gear_three[target]
						UpperCamelCase_     :	Union[str, Any]					     =     reflector[target]
						UpperCamelCase_     :	Dict					     =     gear_three.index(UpperCAmelCase__	)
						UpperCamelCase_     :	Optional[int]					     =     gear_two.index(UpperCAmelCase__	)
						UpperCamelCase_     :	Optional[int]					     =     gear_one.index(UpperCAmelCase__	)
						code.append(alphabets[target]	)
						rotator()


if __name__ == "__main__":
	__SCREAMING_SNAKE_CASE						=      list(input("Type your message:\n"))
	while True:
		try:
			__SCREAMING_SNAKE_CASE						=      int(input("Please set token:(must be only digits)\n"))
			break
		except Exception as error:
			print(error)
	for _ in range(token):
		rotator()
	for j in decode:
		engine(j)
	print("\n" + "".join(code))
	print(
	    f"\nYour Token is {token} please write it down.\nIf you want to decode "
	    "this message again you should input same digits as token!"
	)




