B B W - if the person in the back (C) would understand he's wearing a white, since there are no blacks left, and he would shout white if this was the case.
B W W/B W B - The person in the middle knows that if he's wearing a black, person C would shout. When he notices he doesn't, person B understands he's wearing a white and would therefore shout.
W W W / W B W / W B B - The person C doesn't know whether he's wearing a black or a white hat and the same with person B, since there are both black and white hats to spare.. Though, person A sees the problem and realizes that the only way both B and C don't know their colour, is if he himself is wearing a white hat.
So person A must have a white hat.