Black and white hats, version 2
A king had 3 advisors and he wanted to find out who was the smartest. So he devised a test for them. He said that he had 3 white hats and 2 black hats. After seating the three men facing each other, he told them that he would randomly pick 3 hats, which would be placed on their heads so that they could each see the other 2 men's hats but not their own. Unbeknownst to them, the king tossed away the two black hats and only used the three white hats. After staring at each other for a while, one of the wise men figured it out and shouted, "I know! My hat is white!" How did he do it?