The people are lined up in alternating colored hats.
Congratulations, everybody dies.
i don't see how this would happen. second person is not to say the color of the hat of the one ahead of him. this is only for the first one. the second will just say what he heard. if he heard black, then his hat color is black and vice versa.