The wisest men of the kingdom are called upon by the king to his court. One of them is to be chose for the advisor rank and thus they shall prove their worth in the test. The king places hat on each of their hats. Each one of them can see other two hats but can't see his own. The hats are either white or black.

For a hint, the king tells them that at least one of them is wearing a black hat. Also the king declares that the test is totally fair for each one of them. Now the first one from them who is able to deduce the color of hat he is wearing will be designated as the advisor. After a few minutes, one of them was able to deduce the color of his own hat. How ?

Suppose that there is just one black hat. In such a scenario, the person wearing it will see the other two hats as white and then as the king had announced, he will be easily able to judge that he is wearing a black hat himself. But the other two men will see a black hat and a white hat and will not be able to judge. Thus this will be an unfair situation, so we can rule it out.

Now suppose that there are two black hats. Then, both the person will see a white hat and a black hat. And they have already realized that there must be two black hats, thus they can easily deduce that they are also wearing a black hat. But the one wearing white hat will see two black hats and thus he will not be able to identify on a sure note. Thus the competition will not be fair.

Thus the only situation where the competition can be fair is when all the hats are black. The first one who recognize the fact will stand up and say black.