



def 				UpperCAmelCase__		(					_SCREAMING_SNAKE_CASE :						Union[str, Any]					)->bool:
      # must be
      _lowerCAmelCase			      =	[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					):
                  _lowerCAmelCase			      =	0
                  for row in matrix:
                        if prev_len == 0:
                              _lowerCAmelCase			      =	len(_SCREAMING_SNAKE_CASE					)
                              _lowerCAmelCase			      =	True
                        else:
                              _lowerCAmelCase			      =	prev_len == len(_SCREAMING_SNAKE_CASE					)
            else:
                  _lowerCAmelCase			      =	True
      else:
            _lowerCAmelCase			      =	False

      return result
def 				UpperCAmelCase__		(					_SCREAMING_SNAKE_CASE :						Any					)->None:
      if check_matrix(_SCREAMING_SNAKE_CASE					) and len(_SCREAMING_SNAKE_CASE					) > 0:
            _lowerCAmelCase			      =	[list(_SCREAMING_SNAKE_CASE					) for row in a]
            _lowerCAmelCase			      =	len(_SCREAMING_SNAKE_CASE					)
            if isinstance(a[0]  ,					_SCREAMING_SNAKE_CASE					):
                  _lowerCAmelCase			      =	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]					)
            _lowerCAmelCase			      =	[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 				UpperCAmelCase__		(					_SCREAMING_SNAKE_CASE :						Union[str, Any]					)->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()

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

'''simple docstring'''







def 				_snake_case (		lowercase						)       ->       Tuple:
				__a       :     Union[str, Any]								=	[7_0_1, 3_0_1, 1_3_2, 5_7, 2_3, 1_0, 4, 1]
				for gap in gaps:
								for i in range(lowercase			,    len(lowercase						)						):
												__a       :     Tuple								=	collection[i]
												__a       :     Optional[int]								=	i
												while j >= gap and collection[j - gap] > insert_value:
																__a       :     Tuple								=	collection[j - gap]
																j -= gap
												if j != i:
																__a       :     Dict								=	insert_value
				return collection


if __name__ == "__main__":
					from doctest import testmod

					testmod()
					__SCREAMING_SNAKE_CASE		:  Any        =      input('Enter numbers separated by a comma:\n').strip()
					__SCREAMING_SNAKE_CASE		:  Optional[int]        =      [int(item) for item in user_input.split(',')]
					print(shell_sort(unsorted))