



from math import factorial

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





def   __snake_case			(    _UpperCAmelCase       ):
    return sum(DIGIT_FACTORIAL[d] for d in str(_UpperCAmelCase       )       )





def   __snake_case			(    ):
    __a		 =       7 * factorial(9       ) + 1
    return sum(i for i in range(3     ,				_UpperCAmelCase       ) if sum_of_digit_factorial(_UpperCAmelCase       ) == i       )


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










__snake_case		:str   	=  [
    [0, 16, 13, 0, 0, 0],
    [0, 0, 10, 12, 0, 0],
    [0, 4, 0, 0, 14, 0],
    [0, 0, 9, 0, 0, 20],
    [0, 0, 0, 7, 0, 4],
    [0, 0, 0, 0, 0, 0],
]





def   __snake_case			(    _UpperCAmelCase     ,				_UpperCAmelCase     ,				_UpperCAmelCase     ,				_UpperCAmelCase       ):
    # Return True if there is node that has not iterated.
    __a		 =       [False] * len(_UpperCAmelCase       )
    __a		 =       [s]
    __a		 =       True

    while queue:
        __a		 =       queue.pop(0       )
        for ind in range(len(graph[u]       )       ):
            if visited[ind] is False and graph[u][ind] > 0:
                queue.append(_UpperCAmelCase       )
                __a		 =       True
                __a		 =       u

    return visited[t]





def   __snake_case			(    _UpperCAmelCase     ,				_UpperCAmelCase     ,				_UpperCAmelCase       ):
    __a		 =       [-1] * (len(_UpperCAmelCase       ))
    __a		 =       0
    __a		 =       []
    __a		 =       [i[:] for i in graph]  # Record original cut, copy.
    while bfs(_UpperCAmelCase     ,				_UpperCAmelCase     ,				_UpperCAmelCase     ,				_UpperCAmelCase       ):
        __a		 =       float('''Inf'''       )
        __a		 =       sink

        while s != source:
            # Find the minimum value in select path
            __a		 =       min(_UpperCAmelCase     ,				graph[parent[s]][s]       )
            __a		 =       parent[s]

        max_flow += path_flow
        __a		 =       sink

        while v != source:
            __a		 =       parent[v]
            graph[u][v] -= path_flow
            graph[v][u] += path_flow
            __a		 =       parent[v]

    for i in range(len(_UpperCAmelCase       )       ):
        for j in range(len(graph[0]       )       ):
            if graph[i][j] == 0 and temp[i][j] > 0:
                res.append((i, j)       )

    return res


if __name__ == "__main__":
 print(mincut(test_graph, source=0, sink=5))





