Hi,

Man 1 can see man 2 and man 3 but is not able to tell what color hat he wears because man 2 and man 3 wear different color hats. So man 1 will not shout out. Then from man 1's reaction, man 2 is able to tell that he (man 2) and man 3 wear different color hats. Since man 3 wears black color hat, so man 2 knows he himself wears white color hat.

Man 3 and man 4 are not able to tell what color hats they wear since they can see none of the others.

Thanks
Maneesh S.