Comments

For colors other than g (which appears exactly a times), the positions of colors appearing a−1 times are unimportant: Since these colors appear only a−1 times in this column, they will never be selected for this column.

This seems somewhat unintutive for me