
"""simple docstring"""




_A      :	Dict       		=	{
    """A""": ("""ABCDEFGHIJKLM""", """NOPQRSTUVWXYZ"""),
    """B""": ("""ABCDEFGHIJKLM""", """NOPQRSTUVWXYZ"""),
    """C""": ("""ABCDEFGHIJKLM""", """ZNOPQRSTUVWXY"""),
    """D""": ("""ABCDEFGHIJKLM""", """ZNOPQRSTUVWXY"""),
    """E""": ("""ABCDEFGHIJKLM""", """YZNOPQRSTUVWX"""),
    """F""": ("""ABCDEFGHIJKLM""", """YZNOPQRSTUVWX"""),
    """G""": ("""ABCDEFGHIJKLM""", """XYZNOPQRSTUVW"""),
    """H""": ("""ABCDEFGHIJKLM""", """XYZNOPQRSTUVW"""),
    """I""": ("""ABCDEFGHIJKLM""", """WXYZNOPQRSTUV"""),
    """J""": ("""ABCDEFGHIJKLM""", """WXYZNOPQRSTUV"""),
    """K""": ("""ABCDEFGHIJKLM""", """VWXYZNOPQRSTU"""),
    """L""": ("""ABCDEFGHIJKLM""", """VWXYZNOPQRSTU"""),
    """M""": ("""ABCDEFGHIJKLM""", """UVWXYZNOPQRST"""),
    """N""": ("""ABCDEFGHIJKLM""", """UVWXYZNOPQRST"""),
    """O""": ("""ABCDEFGHIJKLM""", """TUVWXYZNOPQRS"""),
    """P""": ("""ABCDEFGHIJKLM""", """TUVWXYZNOPQRS"""),
    """Q""": ("""ABCDEFGHIJKLM""", """STUVWXYZNOPQR"""),
    """R""": ("""ABCDEFGHIJKLM""", """STUVWXYZNOPQR"""),
    """S""": ("""ABCDEFGHIJKLM""", """RSTUVWXYZNOPQ"""),
    """T""": ("""ABCDEFGHIJKLM""", """RSTUVWXYZNOPQ"""),
    """U""": ("""ABCDEFGHIJKLM""", """QRSTUVWXYZNOP"""),
    """V""": ("""ABCDEFGHIJKLM""", """QRSTUVWXYZNOP"""),
    """W""": ("""ABCDEFGHIJKLM""", """PQRSTUVWXYZNO"""),
    """X""": ("""ABCDEFGHIJKLM""", """PQRSTUVWXYZNO"""),
    """Y""": ("""ABCDEFGHIJKLM""", """OPQRSTUVWXYZN"""),
    """Z""": ("""ABCDEFGHIJKLM""", """OPQRSTUVWXYZN"""),
}


def   __magic_name__     (				__snake_case    :	str  )			->    list[tuple[str, str]]:
       return [alphabet[char] for char in key.upper()]


def   __magic_name__     (				__snake_case    :	str					,			__snake_case    :	str  )			->    str:
       lowercase   :    Any			=							""
       lowercase   :    Optional[int]			=							0
       lowercase   :    str			=							generate_table(__snake_case  )
       for char in words.upper():
              cipher += get_opponent(table[count]					,			__snake_case  )
              lowercase   :    int			=							(count + 1) % len(__snake_case  )
       return cipher


def   __magic_name__     (				__snake_case    :	str					,			__snake_case    :	str  )			->    str:
       return encrypt(__snake_case					,			__snake_case  )


def   __magic_name__     (				__snake_case    :	tuple[str, str]					,			__snake_case    :	str  )			->    tuple[int, int]:
       lowercase   :    int			=							0 if char in table[0] else 1
       lowercase   :    Optional[int]			=							table[row].index(__snake_case  )
       return row, col


def   __magic_name__     (				__snake_case    :	tuple[str, str]					,			__snake_case    :	str  )			->    str:
       lowercase		,   lowercase   :    Optional[int]			=							get_position(__snake_case					,			char.upper()  )
       if row == 1:
              return table[0][col]
       else:
              return table[1][col] if row == 0 else char


if __name__ == "__main__":
   import doctest

   doctest.testmod()  # Fist ensure that all our tests are passing...
   _A      :	List[Any]       		=	input("""Enter key: """).strip()
   _A      :	Optional[int]       		=	input("""Enter text to encrypt: """).strip()
   _A      :	Optional[Any]       		=	encrypt(key, text)

   print(F"Encrypted: {cipher_text}")
   print(F"Decrypted with key: {decrypt(key, cipher_text)}")




"""simple docstring"""




from __future__ import annotations

_A      :	List[str]       		=	"""Alexander Joslin"""


def   __magic_name__     (				__snake_case    :	int  )			->    int:

       if number <= 0:
              lowercase   :    Optional[Any]			=							f"""n must be greater than 0. Got n = {number}"""
              raise ValueError(__snake_case  )

       lowercase   :    List[str]			=							[number + 1] * (number + 1)

       # starting position
       lowercase   :    Optional[Any]			=							0
       for i in range(1					,			__snake_case  ):
              lowercase   :    str			=							min(table[i + 1]					,			table[i] + 1  )
              # check if out of bounds
              if i * 2 <= number:
                     lowercase   :    int			=							min(table[i * 2]					,			table[i] + 1  )
              # check if out of bounds
              if i * 3 <= number:
                     lowercase   :    Optional[int]			=							min(table[i * 3]					,			table[i] + 1  )
       return table[number]


if __name__ == "__main__":
   import doctest

   doctest.testmod()


