Allan, Bertrand, and Cecil were caught stealing so the king sent them to the dungeon. But the king decided to give them a chance. He mad them stand in a line and put hats on their heads. He told them that if they answer a riddle, they could go free. Here is the riddle: "Each of you has a hat on your head. You do not know the color of the hat on your own head. If one of you can guess the color of the hat on your head, I will let you free. But before you answer you must keep staning in this line. You cannot turn around. Here are my only hints: there are only black and white hats. At least one hat is black. At least one hat is white." Allan couldn't see any hats. Bertrand could see Allan's hat but not his own. Cecil could see Bertrand's hat and Allan's hat, but not his own. After a minute nobody had solved the riddle. But then a short while later, one of them solved the riddle. Who was is and how did he know?
