

'''simple docstring'''

import math




def 				UpperCamelCase(					):
	UpperCAmelCase	:     List[str]						 =			input('Enter message: '     )
	UpperCAmelCase	:     str						 =			int(input(F"""Enter key [2-{len(UpperCAmelCase_     ) - 1}]: """     )     )
	UpperCAmelCase	:     List[str]						 =			input('Encryption/Decryption [e/d]: '     )

	if mode.lower().startswith('e'     ):
		UpperCAmelCase	:     Optional[int]						 =			encrypt_message(UpperCAmelCase_  ,	UpperCAmelCase_     )
	elif mode.lower().startswith('d'     ):
		UpperCAmelCase	:     Any						 =			decrypt_message(UpperCAmelCase_  ,	UpperCAmelCase_     )

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




def 				UpperCamelCase(					UpperCAmelCase_  ,	UpperCAmelCase_     ):
	UpperCAmelCase	:     List[Any]						 =			[''] * key
	for col in range(UpperCAmelCase_     ):
		UpperCAmelCase	:     List[str]						 =			col
		while pointer < len(UpperCAmelCase_     ):
			cipher_text[col] += message[pointer]
			pointer += key
	return "".join(UpperCAmelCase_     )




def 				UpperCamelCase(					UpperCAmelCase_  ,	UpperCAmelCase_     ):
	UpperCAmelCase	:     Optional[int]						 =			math.ceil(len(UpperCAmelCase_     ) / key     )
	UpperCAmelCase	:     List[Any]						 =			key
	UpperCAmelCase	:     Union[str, Any]						 =			(num_cols * num_rows) - len(UpperCAmelCase_     )
	UpperCAmelCase	:     List[str]						 =			[''] * num_cols
	UpperCAmelCase	:     Optional[Any]						 =			0
	UpperCAmelCase	:     Tuple						 =			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)
		):
			UpperCAmelCase	:     Any						 =			0
			row += 1

	return "".join(UpperCAmelCase_     )


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	main()







'''simple docstring'''

def 				UpperCamelCase(					UpperCAmelCase_  ,	UpperCAmelCase_     ):
 UpperCAmelCase	:     int						 =			len(UpperCAmelCase_     )
 UpperCAmelCase	:     int						 =			len(UpperCAmelCase_     )
 UpperCAmelCase	:     int						 =			(
     first_str_length if first_str_length > second_str_length else second_str_length
 )
 UpperCAmelCase	:     list						 =			[]
 for char_count in range(UpperCAmelCase_     ):
  if char_count < first_str_length:
   output_list.append(first_str[char_count]     )
  if char_count < second_str_length:
   output_list.append(second_str[char_count]     )
 return "".join(UpperCAmelCase_     )


if __name__ == "__main__":
 print(alternative_string_arrange("AB", "XYZ"), end=" ")




