...the accountant would count the hats. Whichever color there were 49 of, he would know that that was his color. The next person would then know how many hats of each color were available, and would be able to figure out his own, and this would continue down the line. Simple but tedious.
Although I have to wonder why there was a knight in Hell.
And I'm not very good at cute things - that's more up my boyfriend's alley. But I've been assure that this is cute: