






import math



def 					_lowerCamelCase(			):





				'''simple docstring'''







				SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   input('Enter message: '      )
				SCREAMING_SNAKE_CASE_   :	Dict													=   int(input(F'''Enter key [2-{len(lowerCAmelCase__      ) - 1}]: '''      )      )
				SCREAMING_SNAKE_CASE_   :	List[str]													=   input('Encryption/Decryption [e/d]: '      )

				if mode.lower().startswith('e'      ):
								SCREAMING_SNAKE_CASE_   :	int													=   encrypt_message(lowerCAmelCase__    ,    lowerCAmelCase__      )
				elif mode.lower().startswith('d'      ):
								SCREAMING_SNAKE_CASE_   :	Union[str, Any]													=   decrypt_message(lowerCAmelCase__    ,    lowerCAmelCase__      )

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



def 					_lowerCamelCase(			lowerCAmelCase__				:		int    ,    lowerCAmelCase__				:		str      ):





				'''simple docstring'''







				SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   [''] * key
				for col in range(lowerCAmelCase__      ):
								SCREAMING_SNAKE_CASE_   :	Optional[int]													=   col
								while pointer < len(lowerCAmelCase__      ):
												cipher_text[col] += message[pointer]
												pointer += key
				return "".join(lowerCAmelCase__      )



def 					_lowerCamelCase(			lowerCAmelCase__				:		int    ,    lowerCAmelCase__				:		str      ):





				'''simple docstring'''







				SCREAMING_SNAKE_CASE_   :	Optional[int]													=   math.ceil(len(lowerCAmelCase__      ) / key      )
				SCREAMING_SNAKE_CASE_   :	List[str]													=   key
				SCREAMING_SNAKE_CASE_   :	Optional[int]													=   (num_cols * num_rows) - len(lowerCAmelCase__      )
				SCREAMING_SNAKE_CASE_   :	List[str]													=   [''] * num_cols
				SCREAMING_SNAKE_CASE_   :	Any													=   0
				SCREAMING_SNAKE_CASE_   :	List[Any]													=   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)
								):
												SCREAMING_SNAKE_CASE_   :	str													=   0
												row += 1

				return "".join(lowerCAmelCase__      )


if __name__ == "__main__":
				import doctest

				doctest.testmod()
				main()







import math



def 					_lowerCamelCase(			lowerCAmelCase__				:		float    ,    lowerCAmelCase__				:		float      ):





				'''simple docstring'''







				return math.pow(lowerCAmelCase__    ,    2      ) - a



def 					_lowerCamelCase(			lowerCAmelCase__				:		float      ):





				'''simple docstring'''







				return 2 * x



def 					_lowerCamelCase(			lowerCAmelCase__				:		float      ):





				'''simple docstring'''







				SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   2.0

				while start <= a:
								SCREAMING_SNAKE_CASE_   :	str													=   math.pow(lowerCAmelCase__    ,    2      )

				return start



def 					_lowerCamelCase(			lowerCAmelCase__				:		float    ,    lowerCAmelCase__				:		int = 9999    ,    lowerCAmelCase__				:		float = 0.00_000_000_000_001      ):





				'''simple docstring'''







				if a < 0:
								raise ValueError('math domain error'      )

				SCREAMING_SNAKE_CASE_   :	Optional[int]													=   get_initial_point(lowerCAmelCase__      )

				for _ in range(lowerCAmelCase__      ):
								SCREAMING_SNAKE_CASE_   :	Tuple													=   value
								SCREAMING_SNAKE_CASE_   :	Union[str, Any]													=   value - fx(lowerCAmelCase__    ,    lowerCAmelCase__      ) / fx_derivative(lowerCAmelCase__      )
								if abs(prev_value - value      ) < tolerance:
												return value

				return value


if __name__ == "__main__":
				from doctest import testmod

				testmod()