Man 2 will shout first.
Man 3 and Man 4 will not be able to tell what colour hats they are wearing since they cannot see the other men.
Man 1 can see Man 2 and Man 3 but is not able to tell what colour hat he is wearing as Man 2 and Man 3 are wearing different colour hats. So Man 1 will not shout out.
Then based on Man 1’s silence, Man 2 is able to interpret that he (Man 2) and Man 3 are wearing different colour hats. Since Man 3 is wearing a black colour hat, so Man 2 knows that he is wearing a white colour hat.