def METHOD_NAME(ast_node):
    if isinstance(ast_node.inf_type, TypeFail):
        return ast_node
    else:
        for child in ast_node.get_children():
            child_res = METHOD_NAME(child)
            if child_res is not None:
                return child_res
    return None