generate IDs for examples, subgroups