

from __future__ import annotations



def  __lowerCAmelCase (  A    ,       A    ,       A    ,       A      ):
	UpperCAmelCase_			,				UpperCAmelCase_    			=     m - 1, 0
	while i >= 0 and j < n:
		if key == mat[i][j]:
			print(F"Key {key} found at row- {i + 1} column- {j + 1}"      )
			return
		if key < mat[i][j]:
			i -= 1
		else:
			j += 1
	print(F"Key {key} not found"      )



def  __lowerCAmelCase (  ):
	UpperCAmelCase_    			=     [[2, 5, 7], [4, 8, 13], [9, 11, 15], [12, 17, 20]]
	UpperCAmelCase_    			=     int(input("Enter the element to be searched:"      )      )
	print(A      )
	search_in_a_sorted_matrix(A    ,       len(A      )    ,       len(mat[0]      )    ,       A      )


if __name__ == "__main__":
				import doctest

				doctest.testmod()
				main()


from string import ascii_uppercase



def  __lowerCAmelCase (  A    ,       A    ,       A = False    ,       A = ascii_uppercase      ):
	UpperCAmelCase_    			=     keyword.upper()
	UpperCAmelCase_    			=     plaintext.upper()
	UpperCAmelCase_    			=     set(A      )

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

	# create a shifted version of the alphabet
	UpperCAmelCase_    			=     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_    			=     [
	    shifted_alphabet[k : k + num_unique_chars_in_keyword]
	    for k in range(0    ,       26    ,       A      )
	]

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

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

	if verbose:
		print(A      )
	# 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"""))