Use longest set instead of cartesian.