code: def consecutive_ones_property(sets, universe=None):
      
      if universe is None:
          universe = set()
          for S in sets:
              universe |= set(S)
      tree = PQ_tree(universe)
      try:
          for S in sets:
              tree.reduce(S)
          return tree.border()
      except IsNotC1P:
          return None
docs: Check the consecutive ones property.
  
      :param list sets: is a list of subsets of the ground set.
      :param groundset: is the set of all elements,
                  by default it is the union of the given sets
      :returns: returns a list of the ordered ground set where
                every given set is consecutive,
                or None if there is no solution.
      :complexity: O(len(groundset) * len(sets))
      :disclaimer: an optimal implementation would have complexity
                   O(len(groundset) + len(sets) + sum(map(len,sets))),
                   and there are more recent easier algorithms for this problem.