def find_lowest_template(curr_node, d):
    """Function to find the lowest (most general) substructure/reaction rule in the tree.

    Parameters
    ----------
    curr_node: ehreact.diagram.diagram.Node
         Node for which to find the lowest template.
    d: ehreact.diagram.diagram.Diagram
         Hasse diagram.

    Returns
    -------
    lowest_template: str
        Name of the lowest template.
    """

    if curr_node.key == "":
        return ""
    while curr_node.edges_to_parent[0].parent_node.key != "":
        curr_node = curr_node.edges_to_parent[0].parent_node
    lowest_template = curr_node.key
    return lowest_template