threeWayPartition