Three perfectly logical prisoners are in separate cells. The guard tells them, "I'll give each of you a red or blue hat.
At least one hat is red. You can see the other two's hats through the windows, but not your own.
When someone deduces with certainty the color of your hat, they shout out their color and everyone is free. If someone shouts out the wrong color, they all die." He puts red hats on all three of them.
After a minute of silence, one of them shouts "RED!" How did you deduce it?