
from string import ascii_uppercase



def       _lowercase					(      __SCREAMING_SNAKE_CASE				,    __SCREAMING_SNAKE_CASE				,    __SCREAMING_SNAKE_CASE = False				,    __SCREAMING_SNAKE_CASE = ascii_uppercase )	->     str:
			UpperCamelCase__    :		Tuple     =				keyword.upper()
			UpperCamelCase__    :		List[str]     =				plaintext.upper()
			UpperCamelCase__    :		Optional[Any]     =				set(__SCREAMING_SNAKE_CASE )

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

			# create a shifted version of the alphabet
			UpperCamelCase__    :		List[str]     =				unique_chars + [
			    char for char in alphabet if char not in unique_chars
			]

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

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

									# map current letter to letter in modified alphabet
									UpperCamelCase__    :		Optional[int]     =				row[column]
									letter_index += 1

			if verbose:
						print(__SCREAMING_SNAKE_CASE )
			# 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'''))





import numpy as np

UpperCAmelCase__				:  str       					=				[
    ['''a''', '''b''', '''c''', '''d''', '''e'''],
    ['''f''', '''g''', '''h''', '''i''', '''k'''],
    ['''l''', '''m''', '''n''', '''o''', '''p'''],
    ['''q''', '''r''', '''s''', '''t''', '''u'''],
    ['''v''', '''w''', '''x''', '''y''', '''z'''],
]



class 			UpperCamelCase_			:




							'''simple docstring'''

							def __init__(				self) ->	None:
										UpperCamelCase__    :		Any     =				np.array(UpperCamelCase)
							def        lowerCAmelCase__ (				self     ,						UpperCamelCase) ->	np.ndarray:
										UpperCamelCase__   ,			UpperCamelCase__    :		Optional[int]     =				np.where(letter == self.SQUARE)
										UpperCamelCase__    :		int     =				np.concatenate([indexa + 1, indexa + 1])
										return indexes
							def        lowerCAmelCase__ (				self     ,						UpperCamelCase     ,						UpperCamelCase) ->	str:
										return self.SQUARE[indexa - 1, indexa - 1]
							def        lowerCAmelCase__ (				self     ,						UpperCamelCase) ->	str:
										UpperCamelCase__    :		str     =				message.lower()
										UpperCamelCase__    :		int     =				message.replace('j'     ,						'i')

										UpperCamelCase__    :		List[Any]     =				''
										for letter_index in range(len(UpperCamelCase)):
													if message[letter_index] != " ":
																UpperCamelCase__    :		Union[str, Any]     =				self.letter_to_numbers(message[letter_index])
																UpperCamelCase__    :		int     =				encoded_message + str(numbers[0]) + str(numbers[1])
													elif message[letter_index] == " ":
																UpperCamelCase__    :		str     =				encoded_message + ' '

										return encoded_message






							def        lowerCAmelCase__ (				self     ,						UpperCamelCase) ->	str:
										UpperCamelCase__    :		Union[str, Any]     =				message.replace(' '     ,						'  ')
										UpperCamelCase__    :		int     =				''
										for numbers_index in range(int(len(UpperCamelCase) / 2)):
													if message[numbers_index * 2] != " ":
																UpperCamelCase__    :		List[str]     =				message[numbers_index * 2]
																UpperCamelCase__    :		Tuple     =				message[numbers_index * 2 + 1]

																UpperCamelCase__    :		Tuple     =				self.numbers_to_letter(int(UpperCamelCase)     ,						int(UpperCamelCase))
																UpperCamelCase__    :		List[str]     =				decoded_message + letter
													elif message[numbers_index * 2] == " ":
																UpperCamelCase__    :		str     =				decoded_message + ' '

										return decoded_message



