

'''simple docstring'''

import safs







class lowerCamelCase   (    safs.SaFileSystem				):
				pass









"""simple docstring"""


def   a__			(					__lowercase )						->						bool:
				# must be
				_A       	=      [list(__lowercase ) for row in matrix]
				if matrix and isinstance(__lowercase  ,      __lowercase ):
								if isinstance(matrix[0]  ,      __lowercase ):
												_A       	=      0
												for row in matrix:
																if prev_len == 0:
																				_A       	=      len(__lowercase )
																				_A       	=      True
																else:
																				_A       	=      prev_len == len(__lowercase )
								else:
												_A       	=      True
				else:
								_A       	=      False

				return result






def   a__			(					__lowercase )						->						None:
				if check_matrix(__lowercase ) and len(__lowercase ) > 0:
								_A       	=      [list(__lowercase ) for row in a]
								_A       	=      len(__lowercase )
								if isinstance(a[0]  ,      __lowercase ):
												_A       	=      len(a[0] )
								else:
												for dat in a:
																print(__lowercase )
												return

								# horizotal printing increasing
								for i in range(0  ,      __lowercase ):
												print(a[0][i] )
								# vertical printing down
								for i in range(1  ,      __lowercase ):
												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] )
								_A       	=      [row[1 : mat_col - 1] for row in a[1 : mat_row - 1]]
								if len(__lowercase ) > 0:
												spiral_print_clockwise(__lowercase )
								else:
												return
				else:
								print("Not a valid matrix" )
								return






def   a__			(					__lowercase )						->						list[int]:
				if matrix:
								return list(matrix.pop(0 ) ) + spiral_traversal(list(zip(*__lowercase ) )[::-1] )
				else:
								return []


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

		doctest.testmod()

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