
"""simple docstring"""

from __future__ import annotations

UpperCamelCase     :    int       =			[]






def 							A						(    snake_case				:list[list[int]]    , snake_case				:int    , snake_case				:int		)				->     bool:
 for i in range(len(snake_case		)		):
  if board[row][i] == 1:
   return False
 for i in range(len(snake_case		)		):
  if board[i][column] == 1:
   return False
 for i, j in zip(range(snake_case    , -1    , -1		)    , range(snake_case    , -1    , -1		)		):
  if board[i][j] == 1:
   return False
 for i, j in zip(range(snake_case    , -1    , -1		)    , range(snake_case    , len(snake_case		)		)		):
  if board[i][j] == 1:
   return False
 return True






def 							A						(    snake_case				:list[list[int]]    , snake_case				:int		)				->     bool:
 if row >= len(snake_case		):
  solution.append(snake_case		)
  printboard(snake_case		)
  print()
  return True
 for i in range(len(snake_case		)		):
  if is_safe(snake_case    , snake_case    , snake_case		):
   __UpperCamelCase      =	1
   solve(snake_case    , row + 1		)
   __UpperCamelCase      =	0
 return False






def 							A						(    snake_case				:list[list[int]]		)				->     None:
 for i in range(len(snake_case		)		):
  for j in range(len(snake_case		)		):
   if board[i][j] == 1:
    print('Q'    , end=' '		)
   else:
    print('.'    , end=' '		)
  print()


# n=int(input("The no. of queens"))
UpperCamelCase     :    Optional[Any]       =			8
UpperCamelCase     :    List[Any]       =			[[0 for i in range(n)] for j in range(n)]
solve(board, 0)





print("The total no. of solutions are :", len(solution))





"""simple docstring"""

from math import factorial

UpperCamelCase     :    List[Any]       =			{str(d): factorial(d) for d in range(1_0)}






def 							A						(    snake_case				:int		)				->     int:
 return sum(DIGIT_FACTORIAL[d] for d in str(snake_case		)		)






def 							A						(    )				->     int:
 __UpperCamelCase      =	7 * factorial(9		) + 1
 return sum(i for i in range(3    , snake_case		) if sum_of_digit_factorial(snake_case		) == i		)


if __name__ == "__main__":
      print(f'''{solution() = }''')



