

def       snake_case__    (       lowerCAmelCase_      ):





     """simple docstring"""







     SCREAMING_SNAKE_CASE										=       [list(lowerCAmelCase_      ) for row in matrix]
     if matrix and isinstance(lowerCAmelCase_,   lowerCAmelCase_      ):
          if isinstance(matrix[0],   lowerCAmelCase_      ):
               SCREAMING_SNAKE_CASE										=       0
               for row in matrix:
                    if prev_len == 0:
                         SCREAMING_SNAKE_CASE										=       len(lowerCAmelCase_      )
                         SCREAMING_SNAKE_CASE										=       True
                    else:
                         SCREAMING_SNAKE_CASE										=       prev_len == len(lowerCAmelCase_      )
          else:
               SCREAMING_SNAKE_CASE										=       True
     else:
          SCREAMING_SNAKE_CASE										=       False

     return result







def       snake_case__    (       lowerCAmelCase_      ):





     """simple docstring"""







     if check_matrix(lowerCAmelCase_      ) and len(lowerCAmelCase_      ) > 0:
          SCREAMING_SNAKE_CASE										=       [list(lowerCAmelCase_      ) for row in a]
          SCREAMING_SNAKE_CASE										=       len(lowerCAmelCase_      )
          if isinstance(a[0],   lowerCAmelCase_      ):
               SCREAMING_SNAKE_CASE										=       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]      )
          SCREAMING_SNAKE_CASE										=       [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       snake_case__    (       lowerCAmelCase_      ):





     """simple docstring"""







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


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

 doctest.testmod()

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




def       snake_case__    (       lowerCAmelCase_,   lowerCAmelCase_,   lowerCAmelCase_      ):





     """simple docstring"""







     if power < 0:
          return -1
     base %= mod
     SCREAMING_SNAKE_CASE										=1

     while power > 0:
          if power & 1:
               SCREAMING_SNAKE_CASE										=(result * base) % mod
          SCREAMING_SNAKE_CASE										=power >> 1
          SCREAMING_SNAKE_CASE										=(base * base) % mod

     return result







def       snake_case__    (       ):





     """simple docstring"""







     print(modular_exponential(3,   200,   13      )      )


if __name__ == "__main__":
 import doctest

 doctest.testmod()

 main()

