"""simple docstring"""
import math





def       lowerCAmelCase__			(	)    -> None:





						"""simple docstring"""






						snake_case	    =	input('Enter message: '    )
						snake_case	    =	int(input(f"""Enter key [2-{len(_snake_case    ) - 1}]: """    )    )
						snake_case	    =	input('Encryption/Decryption [e/d]: '    )

						if mode.lower().startswith('e'    ):
												snake_case	    =	encrypt_message(_snake_case       ,	_snake_case    )
						elif mode.lower().startswith('d'    ):
												snake_case	    =	decrypt_message(_snake_case       ,	_snake_case    )

						# Append pipe symbol (vertical bar) to identify spaces at the end.
						print(f"""Output:\n{text + "|"}"""    )





def       lowerCAmelCase__			(	_UpperCamelCase				: int       ,	_UpperCamelCase				: str    )    -> str:





						"""simple docstring"""






						snake_case	    =	[""] * key
						for col in range(_snake_case    ):
												snake_case	    =	col
												while pointer < len(_snake_case    ):
																		cipher_text[col] += message[pointer]
																		pointer += key
						return "".join(_snake_case    )





def       lowerCAmelCase__			(	_UpperCamelCase				: int       ,	_UpperCamelCase				: str    )    -> str:





						"""simple docstring"""






						snake_case	    =	math.ceil(len(_snake_case    ) / key    )
						snake_case	    =	key
						snake_case	    =	(num_cols * num_rows) - len(_snake_case    )
						snake_case	    =	[""] * num_cols
						snake_case	    =	0
						snake_case	    =	0

						for symbol in message:
												plain_text[col] += symbol
												col += 1

												if (
												    (col == num_cols)
												    or (col == num_cols - 1)
												    and (row >= num_rows - num_shaded_boxes)
												):
																		snake_case	    =	0
																		row += 1

						return "".join(_snake_case    )


if __name__ == "__main__":
					import doctest

					doctest.testmod()
					main()




def   lowerCAmelCase_						(					_snake_case      :  list[list[int | float]]   )				->		int:







	'''simple docstring'''


	__magic_name__		:		Any	   =     len(_snake_case   )
	__magic_name__		:		Optional[Any]	   =     len(matrix[0]   )
	__magic_name__		:		Union[str, Any]	   =     min(_snake_case      ,   _snake_case   )

	for row in range(_snake_case   ):
		# Check if diagonal element is not zero
		if matrix[row][row] != 0:
			# Eliminate all the elements below the diagonal
			for col in range(row + 1      ,   _snake_case   ):
				__magic_name__		:		Optional[Any]	   =     matrix[col][row] / matrix[row][row]
				for i in range(_snake_case      ,   _snake_case   ):
					matrix[col][i] -= multiplier * matrix[row][i]
		else:
			# Find a non-zero diagonal element to swap rows
			__magic_name__		:		str	   =     True
			for i in range(row + 1      ,   _snake_case   ):
				if matrix[i][row] != 0:
					__magic_name__   ,    __magic_name__		:		List[str]	   =     matrix[i], matrix[row]
					__magic_name__		:		Union[str, Any]	   =     False
					break
			if reduce:
				rank -= 1
				for i in range(_snake_case   ):
					__magic_name__		:		Any	   =     matrix[i][rank]

            # Reduce the row pointer by one to stay on the same row
			row -= 1

	return rank


if __name__ == "__main__":
				import doctest

				doctest.testmod()
