000 - 001 002 010 - 011 012 020 - 021 022 100 - 101 102 110 - 111 112 120 - 121 122 200 - 201 202 210- 211 212 220- 221 222 000 001 010 011 100 101 110 111 move left to right up to the first not max-value digit, increase it, if it is now max-value then reset all previous digits to the lowest value.