
'''simple docstring'''







class 		snake_case_       :



   """simple docstring"""





   class 		snake_case_       :



      """simple docstring"""





      __lowerCAmelCase	:							Union[str, Any]								="_prev", "_data", "_next"







      def __init__( self			,   UpperCamelCase			,   UpperCamelCase			,   UpperCamelCase):
             lowerCamelCase__				   =      link_p
             lowerCamelCase__				   =      element
             lowerCamelCase__				   =      link_n







      def     __UpperCAmelCase      ( self):
             return (
                 f""" Prev -> {self._prev is not None}, Next -> {self._next is not None}"""
             )







   def __init__( self):
          lowerCamelCase__				   =      self._Node(A__			,   A__			,   A__)
          lowerCamelCase__				   =      self._Node(A__			,   A__			,   A__)
          lowerCamelCase__				   =      self._trailer
          lowerCamelCase__				   =      self._header
          lowerCamelCase__				   =      0







   def __len__( self):
          return self._size







   def     __UpperCAmelCase      ( self):
          return self.__len__() == 0







   def     __UpperCAmelCase      ( self			,   UpperCamelCase			,   UpperCamelCase			,   UpperCamelCase):
          # Create new_node by setting it's prev.link -> header
          # setting it's next.link -> trailer
          lowerCamelCase__				   =      self._Node(A__			,   A__			,   A__)
          lowerCamelCase__				   =      new_node
          lowerCamelCase__				   =      new_node
          self._size += 1
          return self







   def     __UpperCAmelCase      ( self			,   UpperCamelCase):
          lowerCamelCase__				   =      node._prev
          lowerCamelCase__				   =      node._next

          lowerCamelCase__				   =      successor
          lowerCamelCase__				   =      predecessor
          self._size -= 1
          lowerCamelCase__				   =      node._data
          lowerCamelCase__				   =      lowerCamelCase__				   =      lowerCamelCase__				   =      None
          del node
          return temp







class 		snake_case_       (						_DoublyLinkedBase						):



   """simple docstring"""





   def     __UpperCAmelCase      ( self):
          if self.is_empty():
                 raise Exception("List is empty")
          return self._header._next._data







   def     __UpperCAmelCase      ( self):
          if self.is_empty():
                 raise Exception("List is empty")
          return self._trailer._prev._data







   def     __UpperCAmelCase      ( self			,   UpperCamelCase):
          return self._insert(self._header			,   A__			,   self._header._next)







   def     __UpperCAmelCase      ( self			,   UpperCamelCase):
          return self._insert(self._trailer._prev			,   A__			,   self._trailer)







   def     __UpperCAmelCase      ( self):
          if self.is_empty():
                 raise IndexError("remove_first from empty list")
          return self._delete(self._header._next)







   def     __UpperCAmelCase      ( self):
          if self.is_empty():
                 raise IndexError("remove_first from empty list")
          return self._delete(self._trailer._prev)







from string import ascii_uppercase

def       lowerCAmelCase_      (	lowerCamelCase:							str  ,					lowerCamelCase:							str  ,					lowerCamelCase:							bool = False  ,					lowerCamelCase:							str = ascii_uppercase    )       ->      str:


      '''simple docstring'''




      lowerCamelCase__   	=					keyword.upper()
      lowerCamelCase__   	=					plaintext.upper()
      lowerCamelCase__   	=					set(lowerCamelCase    )

      # create a list of unique characters in the keyword - their order matters
      # it determines how we will map plaintext characters to the ciphertext
      lowerCamelCase__   	=					[]
      for char in keyword:
            if char in alphabet_set and char not in unique_chars:
                  unique_chars.append(lowerCamelCase    )
    # the number of those unique characters will determine the number of rows
      lowerCamelCase__   	=					len(lowerCamelCase    )

      # create a shifted version of the alphabet
      lowerCamelCase__   	=					unique_chars + [
          char for char in alphabet if char not in unique_chars
      ]

      # create a modified alphabet by splitting the shifted alphabet into rows
      lowerCamelCase__   	=					[
          shifted_alphabet[k : k + num_unique_chars_in_keyword]
          for k in range(0  ,					26  ,					lowerCamelCase    )
      ]

      # map the alphabet characters to the modified alphabet characters
      # going 'vertically' through the modified alphabet - consider columns first
      lowerCamelCase__   	=					{}
      lowerCamelCase__   	=					0
      for column in range(lowerCamelCase    ):
            for row in modified_alphabet:
                  # if current row (the last one) is too short, break out of loop
                  if len(lowerCamelCase    ) <= column:
                        break

                  # map current letter to letter in modified alphabet
                  lowerCamelCase__   	=					row[column]
                  letter_index += 1

      if verbose:
            print(lowerCamelCase    )
      # create the encrypted text by mapping the plaintext to the modified alphabet
      return "".join(mapping[char] if char in mapping else char for char in plaintext    )


if __name__ == "__main__":
      # example use
      print(mixed_keyword("""college""", """UNIVERSITY"""))