
"""simple docstring"""
from itertools import permutations

def 				lowercase      ():
						__lowerCAmelCase        =       list(map("""""".join				,  permutations("""0123456789"""		)		)		)
						return result[99_9999]


if __name__ == "__main__":
			print(solution())


"""simple docstring"""
def 				lowercase      (_lowerCAmelCase		):
						# must be
						__lowerCAmelCase        =       [list(_lowerCAmelCase		) for row in matrix]
						if matrix and isinstance(_lowerCAmelCase				,  _lowerCAmelCase		):
												if isinstance(matrix[0]				,  _lowerCAmelCase		):
																		__lowerCAmelCase        =       0
																		for row in matrix:
																								if prev_len == 0:
																														__lowerCAmelCase        =       len(_lowerCAmelCase		)
																														__lowerCAmelCase        =       True
																								else:
																														__lowerCAmelCase        =       prev_len == len(_lowerCAmelCase		)
												else:
																		__lowerCAmelCase        =       True
						else:
												__lowerCAmelCase        =       False

						return result

def 				lowercase      (_lowerCAmelCase		):
						if check_matrix(_lowerCAmelCase		) and len(_lowerCAmelCase		) > 0:
												__lowerCAmelCase        =       [list(_lowerCAmelCase		) for row in a]
												__lowerCAmelCase        =       len(_lowerCAmelCase		)
												if isinstance(a[0]				,  _lowerCAmelCase		):
																		__lowerCAmelCase        =       len(a[0]		)
												else:
																		for dat in a:
																								print(_lowerCAmelCase		)
																		return

												# horizotal printing increasing
												for i in range(0				,  _lowerCAmelCase		):
																		print(a[0][i]		)
												# vertical printing down
												for i in range(1				,  _lowerCAmelCase		):
																		print(a[i][mat_col - 1]		)
												# horizotal printing decreasing
												if mat_row > 1:
																		for i in range(mat_col - 2				,  -1				,  -1		):
																								print(a[mat_row - 1][i]		)
        # vertical printing up
												for i in range(mat_row - 2				,  0				,  -1		):
																		print(a[i][0]		)
												__lowerCAmelCase        =       [row[1 : mat_col - 1] for row in a[1 : mat_row - 1]]
												if len(_lowerCAmelCase		) > 0:
																		spiral_print_clockwise(_lowerCAmelCase		)
												else:
																		return
						else:
												print("""Not a valid matrix"""		)
												return

def 				lowercase      (_lowerCAmelCase		):
						if matrix:
												return list(matrix.pop(0		)		) + spiral_traversal(list(zip(*_lowerCAmelCase		)		)[::-1]		)
						else:
												return []


# driver code
if __name__ == "__main__":
			import doctest

			doctest.testmod()

			SCREAMING_SNAKE_CASE_			      =					[[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]]
			spiral_print_clockwise(a)
