Tag - Prisoners and hats puzzle