





from math import factorial

snake_case__					:							Optional[Any]													=     {str(d): factorial(d) for d in range(10)}



def _a				(	lowerCamelCase:   int )	->						int:







      '''simple docstring'''






      return sum(DIGIT_FACTORIAL[d] for d in str(lowerCamelCase ) )



def _a				(	)	->						int:







      '''simple docstring'''






      __A          =				7 * factorial(9 ) + 1
      return sum(i for i in range(3					,				lowerCamelCase ) if sum_of_digit_factorial(lowerCamelCase ) == i )


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












def _a				(	lowerCamelCase:   dict )	->						bool:







      '''simple docstring'''






      __A          =				set()
      # To detect a back edge, keep track of vertices currently in the recursion stack
      __A          =				set()
      return any(
          node not in visited and depth_first_search(lowerCamelCase					,				lowerCamelCase					,				lowerCamelCase					,				lowerCamelCase )
          for node in graph )



def _a				(	lowerCamelCase:   dict					,				lowerCamelCase:   int					,				lowerCamelCase:   set					,				lowerCamelCase:   set )	->						bool:







      '''simple docstring'''






      visited.add(lowerCamelCase )
      rec_stk.add(lowerCamelCase )

      for node in graph[vertex]:
            if node not in visited:
                  if depth_first_search(lowerCamelCase					,				lowerCamelCase					,				lowerCamelCase					,				lowerCamelCase ):
                        return True
            elif node in rec_stk:
                  return True

    # The node needs to be removed from recursion stack before function ends
      rec_stk.remove(lowerCamelCase )
      return False


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

       testmod()





