let fold_fold f g init_f init_g = S.fold (fun c l acc -> f acc c (List.fold_left g init_g !l)) init_f