reverse sort permute