An unknown number of prisoners( more than 14)were told a day before their execution, that they are going to be blind folded, and a colored paper(either.. yellow,green,red or blue) will be glued on forehead of each one of them( no one can see his own paper), then they should inter a big hall one by one to make 4 raws in this order( Yellow,Green,Red,Blue)i.e. a raw of Yallows, a raw of Greens etc.,each one will be unfolded when he inters the hall.No one of them is allowed to arrenge the others,each one should himslf choose where to stay, once he did,he can not change his place( only the first 2 prisoners can change their minds only once).Any kind of comunication between them is not allowed. If any one of them stands in a wrong raw, all of them will die!
All colores were used.
They should make a plane which saves all of them, can you help them?