





'''simple docstring'''

from __future__ import annotations





def lowerCamelCase						(     __lowerCamelCase :    int = 4    )						->list[list[int]]:
    _SCREAMING_SNAKE_CASE									=			abs(__lowerCamelCase    ) or 4
    return [[1 + x + y * row_size for x in range(__lowerCamelCase    )] for y in range(__lowerCamelCase    )]





def lowerCamelCase						(     __lowerCamelCase :    list[list[int]]    )						->list[list[int]]:
    return reverse_row(transpose(__lowerCamelCase    )    )
    # OR.. transpose(reverse_column(matrix))





def lowerCamelCase						(     __lowerCamelCase :    list[list[int]]    )						->list[list[int]]:
    return reverse_row(reverse_column(__lowerCamelCase    )    )
    # OR.. reverse_column(reverse_row(matrix))





def lowerCamelCase						(     __lowerCamelCase :    list[list[int]]    )						->list[list[int]]:
    return reverse_column(transpose(__lowerCamelCase    )    )
    # OR.. transpose(reverse_row(matrix))





def lowerCamelCase						(     __lowerCamelCase :    list[list[int]]    )						->list[list[int]]:
    _SCREAMING_SNAKE_CASE									=			[list(__lowerCamelCase    ) for x in zip(*__lowerCamelCase    )]
    return matrix





def lowerCamelCase						(     __lowerCamelCase :    list[list[int]]    )						->list[list[int]]:
    _SCREAMING_SNAKE_CASE									=			matrix[::-1]
    return matrix





def lowerCamelCase						(     __lowerCamelCase :    list[list[int]]    )						->list[list[int]]:
    _SCREAMING_SNAKE_CASE									=			[x[::-1] for x in matrix]
    return matrix





def lowerCamelCase						(     __lowerCamelCase :    list[list[int]]    )						->None:
    for i in matrix:
        print(*__lowerCamelCase    )


if __name__ == "__main__":
      lowercase_					= make_matrix()
      print("""\norigin:\n""")
      print_matrix(matrix)
      print("""\nrotate 90 counterclockwise:\n""")
      print_matrix(rotate_aa(matrix))

      lowercase_					= make_matrix()
      print("""\norigin:\n""")
      print_matrix(matrix)
      print("""\nrotate 180:\n""")
      print_matrix(rotate_aaa(matrix))

      lowercase_					= make_matrix()
      print("""\norigin:\n""")
      print_matrix(matrix)
      print("""\nrotate 270 counterclockwise:\n""")
      print_matrix(rotate_aaa(matrix))











def 				lowerCamelCase__      (    __lowerCamelCase			:     Tuple  ,		__lowerCamelCase			:     Union[str, Any]		):
  __UpperCAmelCase							:	Tuple           =  [1]
  for i in range(2  ,		__lowerCamelCase		):
    factorials.append(factorials[-1] * i		)
  assert 0 <= k < factorials[-1] * n, "k out of bounds"

  __UpperCAmelCase							:	Optional[Any]           =  []
  __UpperCAmelCase							:	str           =  list(range(__lowerCamelCase		)		)

  # Find permutation
  while factorials:
    __UpperCAmelCase							:	Any           =  factorials.pop()
    __UpperCAmelCase      , __UpperCAmelCase							:	Optional[Any]           =  divmod(__lowerCamelCase  ,		__lowerCamelCase		)
    permutation.append(elements[number]		)
    elements.remove(elements[number]		)
  permutation.append(elements[0]		)

  return permutation


if __name__ == "__main__":
       import doctest

       doctest.testmod()


