






from __future__ import annotations
class     lowerCamelCase_					:







				def __init__(    self							,       __lowerCAmelCase = 0  ):
								"""simple docstring"""
								__magic_name__		:str   =   key







				def       A						(    self							,       __lowerCAmelCase							,       __lowerCAmelCase  ):
								"""simple docstring"""
								assert isinstance(__lowerCAmelCase							,       __lowerCAmelCase  ) and isinstance(__lowerCAmelCase							,       __lowerCAmelCase  )

								__magic_name__		:Optional[Any]   =   key or self.__key or 1

								# make sure key is an appropriate size
								key %= 2_5_5

								return [chr(ord(__lowerCAmelCase  ) ^ key  ) for ch in content]







				def       A						(    self							,       __lowerCAmelCase							,       __lowerCAmelCase  ):
								"""simple docstring"""
								assert isinstance(__lowerCAmelCase							,       __lowerCAmelCase  ) and isinstance(__lowerCAmelCase							,       __lowerCAmelCase  )

								__magic_name__		:Any   =   key or self.__key or 1

								# make sure key is an appropriate size
								key %= 2_5_5

								return [chr(ord(__lowerCAmelCase  ) ^ key  ) for ch in content]







				def       A						(    self							,       __lowerCAmelCase							,       __lowerCAmelCase = 0  ):
								"""simple docstring"""
								assert isinstance(__lowerCAmelCase							,       __lowerCAmelCase  ) and isinstance(__lowerCAmelCase							,       __lowerCAmelCase  )

								__magic_name__		:int   =   key or self.__key or 1

								# make sure key can be any size
								while key > 2_5_5:
												key -= 2_5_5

								# This will be returned
								__magic_name__		:List[Any]   =   ''''''

								for ch in content:
												ans += chr(ord(__lowerCAmelCase  ) ^ key  )

								return ans







				def       A						(    self							,       __lowerCAmelCase							,       __lowerCAmelCase = 0  ):
								"""simple docstring"""
								assert isinstance(__lowerCAmelCase							,       __lowerCAmelCase  ) and isinstance(__lowerCAmelCase							,       __lowerCAmelCase  )

								__magic_name__		:Tuple   =   key or self.__key or 1

								# make sure key can be any size
								while key > 2_5_5:
												key -= 2_5_5

								# This will be returned
								__magic_name__		:List[str]   =   ''''''

								for ch in content:
												ans += chr(ord(__lowerCAmelCase  ) ^ key  )

								return ans







				def       A						(    self							,       __lowerCAmelCase							,       __lowerCAmelCase = 0  ):
								"""simple docstring"""
								assert isinstance(__lowerCAmelCase							,       __lowerCAmelCase  ) and isinstance(__lowerCAmelCase							,       __lowerCAmelCase  )

								try:
												with open(__lowerCAmelCase  ) as fin, open('''encrypt.out'''							,       '''w+'''  ) as fout:
																# actual encrypt-process
																for line in fin:
																				fout.write(self.encrypt_string(__lowerCAmelCase							,       __lowerCAmelCase  )  )

								except OSError:
												return False

								return True







				def       A						(    self							,       __lowerCAmelCase							,       __lowerCAmelCase  ):
								"""simple docstring"""
								assert isinstance(__lowerCAmelCase							,       __lowerCAmelCase  ) and isinstance(__lowerCAmelCase							,       __lowerCAmelCase  )

								try:
												with open(__lowerCAmelCase  ) as fin, open('''decrypt.out'''							,       '''w+'''  ) as fout:
																# actual encrypt-process
																for line in fin:
																				fout.write(self.decrypt_string(__lowerCAmelCase							,       __lowerCAmelCase  )  )

								except OSError:
												return False

								return True


# Tests
# crypt = XORCipher()
# key = 67

# # test encrypt
# print(crypt.encrypt("hallo welt",key))
# # test decrypt
# print(crypt.decrypt(crypt.encrypt("hallo welt",key), key))

# # test encrypt_string
# print(crypt.encrypt_string("hallo welt",key))

# # test decrypt_string
# print(crypt.decrypt_string(crypt.encrypt_string("hallo welt",key),key))

# if (crypt.encrypt_file("test.txt",key)):
#       print("encrypt successful")
# else:
#       print("encrypt unsuccessful")

# if (crypt.decrypt_file("encrypt.out",key)):
#       print("decrypt successful")
# else:
#       print("decrypt unsuccessful")











from __future__ import annotations


def A    (							__UpperCamelCase = 4       )    ->   list[list[int]]:
			A__	  =     abs(__UpperCamelCase       ) or 4
			return [[1 + x + y * row_size for x in range(__UpperCamelCase       )] for y in range(__UpperCamelCase       )]


def A    (							__UpperCamelCase       )    ->   list[list[int]]:
			return reverse_row(transpose(__UpperCamelCase       )       )
			# OR.. transpose(reverse_column(matrix))


def A    (							__UpperCamelCase       )    ->   list[list[int]]:
			return reverse_row(reverse_column(__UpperCamelCase       )       )
			# OR.. reverse_column(reverse_row(matrix))


def A    (							__UpperCamelCase       )    ->   list[list[int]]:
			return reverse_column(transpose(__UpperCamelCase       )       )
			# OR.. transpose(reverse_row(matrix))


def A    (							__UpperCamelCase       )    ->   list[list[int]]:
			A__	  =     [list(__UpperCamelCase       ) for x in zip(*__UpperCamelCase       )]
			return matrix


def A    (							__UpperCamelCase       )    ->   list[list[int]]:
			A__	  =     matrix[::-1]
			return matrix


def A    (							__UpperCamelCase       )    ->   list[list[int]]:
			A__	  =     [x[::-1] for x in matrix]
			return matrix


def A    (							__UpperCamelCase       )    ->   None:
			for i in matrix:
						print(*__UpperCamelCase       )


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

							SCREAMING_SNAKE_CASE__   			=   make_matrix()
							print('''\norigin:\n''')
							print_matrix(matrix)
							print('''\nrotate 180:\n''')
							print_matrix(rotate_aaa(matrix))

							SCREAMING_SNAKE_CASE__   			=   make_matrix()
							print('''\norigin:\n''')
							print_matrix(matrix)
							print('''\nrotate 270 counterclockwise:\n''')
							print_matrix(rotate_aaa(matrix))




