





from __future__ import annotations





def     _UpperCamelCase     (a__   :int = 4       ):






							"""simple docstring"""





							UpperCamelCase__				     =			abs(a__       ) or 4
							return [[1 + x + y * row_size for x in range(a__       )] for y in range(a__       )]





def     _UpperCamelCase     (a__   :list[list[int]]       ):






							"""simple docstring"""





							return reverse_row(transpose(a__       )       )
							# OR.. transpose(reverse_column(matrix))





def     _UpperCamelCase     (a__   :list[list[int]]       ):






							"""simple docstring"""





							return reverse_row(reverse_column(a__       )       )
							# OR.. reverse_column(reverse_row(matrix))





def     _UpperCamelCase     (a__   :list[list[int]]       ):






							"""simple docstring"""





							return reverse_column(transpose(a__       )       )
							# OR.. transpose(reverse_row(matrix))





def     _UpperCamelCase     (a__   :list[list[int]]       ):






							"""simple docstring"""





							UpperCamelCase__				     =			[list(a__       ) for x in zip(*a__       )]
							return matrix





def     _UpperCamelCase     (a__   :list[list[int]]       ):






							"""simple docstring"""





							UpperCamelCase__				     =			matrix[::-1]
							return matrix





def     _UpperCamelCase     (a__   :list[list[int]]       ):






							"""simple docstring"""





							UpperCamelCase__				     =			[x[::-1] for x in matrix]
							return matrix





def     _UpperCamelCase     (a__   :list[list[int]]       ):






							"""simple docstring"""





							for i in matrix:
														print(*a__       )


if __name__ == "__main__":
					UpperCamelCase__											= make_matrix()
					print("\norigin:\n")
					print_matrix(matrix)
					print("\nrotate 90 counterclockwise:\n")
					print_matrix(rotate_aa(matrix))

					UpperCamelCase__											= make_matrix()
					print("\norigin:\n")
					print_matrix(matrix)
					print("\nrotate 180:\n")
					print_matrix(rotate_aaa(matrix))

					UpperCamelCase__											= make_matrix()
					print("\norigin:\n")
					print_matrix(matrix)
					print("\nrotate 270 counterclockwise:\n")
					print_matrix(rotate_aaa(matrix))











UpperCamelCase__											= "ABCDEFGHIJKLMNOPQRSTUVWXYZ"





def     _UpperCamelCase     ():






							"""simple docstring"""





							UpperCamelCase__				     =			input("""Enter message: """       )
							UpperCamelCase__				     =			input("""Enter key [alphanumeric]: """       )
							UpperCamelCase__				     =			input("""Encrypt/Decrypt [e/d]: """       )

							if mode.lower().startswith("""e"""       ):
														UpperCamelCase__				     =			"""encrypt"""
														UpperCamelCase__				     =			encrypt_message(a__   ,			a__       )
							elif mode.lower().startswith("""d"""       ):
														UpperCamelCase__				     =			"""decrypt"""
														UpperCamelCase__				     =			decrypt_message(a__   ,			a__       )

							print(f"""\n{mode.title()}ed message:"""       )
							print(a__       )





def     _UpperCamelCase     (a__   :str   ,			a__   :str       ):






							"""simple docstring"""





							return translate_message(a__   ,			a__   ,			"""encrypt"""       )





def     _UpperCamelCase     (a__   :str   ,			a__   :str       ):






							"""simple docstring"""





							return translate_message(a__   ,			a__   ,			"""decrypt"""       )





def     _UpperCamelCase     (a__   :str   ,			a__   :str   ,			a__   :str       ):






							"""simple docstring"""





							UpperCamelCase__				     =			[]
							UpperCamelCase__				     =			0
							UpperCamelCase__				     =			key.upper()

							for symbol in message:
														UpperCamelCase__				     =			LETTERS.find(symbol.upper()       )
														if num != -1:
																					if mode == "encrypt":
																												num += LETTERS.find(key[key_index]       )
																					elif mode == "decrypt":
																												num -= LETTERS.find(key[key_index]       )

																					num %= len(a__       )

																					if symbol.isupper():
																												translated.append(LETTERS[num]       )
																					elif symbol.islower():
																												translated.append(LETTERS[num].lower()       )

																					key_index += 1
																					if key_index == len(a__       ):
																												UpperCamelCase__				     =			0
														else:
																					translated.append(a__       )
							return "".join(a__       )


if __name__ == "__main__":
					main()




