sort-group: generate ids