Suppose you have an element with groups A=a, B=b, C=c.

Use the formula x = (a-1)*6 + (b-1)*3 + (c-1) to make an identifier x between 0 and 17.

This is unique: To recover (a,b,c) from x, first divide x by 6 with remainder, x = 6z+y. Then a = z+1. Next divide y by 3 with remainder, y = 3t+r. Then b = t+1 and c = r+1.

Example: A-group = 2, B-group = 1, C-group = 3. Then a = 1, b = 0, c = 2, and x = 6 + 2 = 8. To recover a, b, and c, you can compute

8 = 1*6 + 2, so a = 1+1 = 2.

2 = 0*3 + 2, so b = 0+1 = 1 and c = 2+1 = 3.