




def  snake_case_					(		SCREAMING_SNAKE_CASE_    )      ->			bool:
							# must be
							lowercase__  :	List[str]        =							[list(SCREAMING_SNAKE_CASE_    ) for row in matrix]
							if matrix and isinstance(SCREAMING_SNAKE_CASE_    ,SCREAMING_SNAKE_CASE_    ):
														if isinstance(matrix[0]    ,SCREAMING_SNAKE_CASE_    ):
																					lowercase__  :	Union[str, Any]        =							0
																					for row in matrix:
																												if prev_len == 0:
																																			lowercase__  :	Union[str, Any]        =							len(SCREAMING_SNAKE_CASE_    )
																																			lowercase__  :	Optional[int]        =							True
																												else:
																																			lowercase__  :	List[str]        =							prev_len == len(SCREAMING_SNAKE_CASE_    )
														else:
																					lowercase__  :	Optional[int]        =							True
							else:
														lowercase__  :	Dict        =							False

							return result
def  snake_case_					(		SCREAMING_SNAKE_CASE_    )      ->			None:
							if check_matrix(SCREAMING_SNAKE_CASE_    ) and len(SCREAMING_SNAKE_CASE_    ) > 0:
														lowercase__  :	Optional[int]        =							[list(SCREAMING_SNAKE_CASE_    ) for row in a]
														lowercase__  :	Tuple        =							len(SCREAMING_SNAKE_CASE_    )
														if isinstance(a[0]    ,SCREAMING_SNAKE_CASE_    ):
																					lowercase__  :	Dict        =							len(a[0]    )
														else:
																					for dat in a:
																												print(SCREAMING_SNAKE_CASE_    )
																					return

														# horizotal printing increasing
														for i in range(0    ,SCREAMING_SNAKE_CASE_    ):
																					print(a[0][i]    )
														# vertical printing down
														for i in range(1    ,SCREAMING_SNAKE_CASE_    ):
																					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]    )
														lowercase__  :	Tuple        =							[row[1 : mat_col - 1] for row in a[1 : mat_row - 1]]
														if len(SCREAMING_SNAKE_CASE_    ) > 0:
																					spiral_print_clockwise(SCREAMING_SNAKE_CASE_    )
														else:
																					return
							else:
														print("Not a valid matrix"    )
														return
def  snake_case_					(		SCREAMING_SNAKE_CASE_    )      ->			list[int]:
							if matrix:
														return list(matrix.pop(0    )    ) + spiral_traversal(list(zip(*SCREAMING_SNAKE_CASE_    )    )[::-1]    )
							else:
														return []


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

						doctest.testmod()

						__a  :		Optional[Any]		     =   [[1, 2, 3, 4], [5, 6, 7, 8], [9, 1_0, 1_1, 1_2]]
						spiral_print_clockwise(a)





def  snake_case_					(		SCREAMING_SNAKE_CASE_    )      ->			list:
							lowercase__  :	Optional[Any]        =							len(SCREAMING_SNAKE_CASE_    )

							# Set the gap value to be decreased by a factor of 1.3
							# after each iteration
							lowercase__  :	Tuple        =							1.3

							# Continue sorting until the gap is 1
							while gap > 1:
														# Decrease the gap value
														lowercase__  :	Tuple        =							int(gap / shrink    )

														# Sort the elements using insertion sort
														for i in range(SCREAMING_SNAKE_CASE_    ,len(SCREAMING_SNAKE_CASE_    )    ):
																					lowercase__  :	int        =							collection[i]
																					lowercase__  :	Union[str, Any]        =							i
																					while j >= gap and collection[j - gap] > temp:
																												lowercase__  :	str        =							collection[j - gap]
																												j -= gap
																					lowercase__  :	List[Any]        =							temp

							return collection


if __name__ == "__main__":
						import doctest

						doctest.testmod()