def unfold(vc: set, folded_verts: list):
    """
    Compute final vc given the partial vc and list of folded vertices (unreversed)
    :param vc: partial vc as a set
    :param folded_verts: list of folded vertices as 3-tuples
    :return: final vertex cover as a set
    """
    final_vc = set(vc)
    for u, v, w in folded_verts[::-1]:
        if u in final_vc:
            final_vc.remove(u)
            final_vc.add(v)
            final_vc.add(w)
        else:
            final_vc.add(u)
    return final_vc