Now sort the files by group IDs.