Eight persons having numbers on their backs( 1 to 8) were standing randomely behind each other in a straight raw( so that the first person can see nothing,while the others,each one can see only the number of the person standing infront of him), each one has a mini cube in his hand containing one number,from 1 to 8 at random, no one of them know neither the number on his back nor the number inside his cube, but the number inside the cube for each person is either lager than or smaller than the number on his back by 1.

They have to enter another room,starting from the last one,,, in the other room there is a rectangular table drawn on it 8 squares in a straight raw, in each square there is a number, 1 to 8.

Each person when enters the room ,he should put his cube on the table( according to previous plan ),and get out through another door, and only the last person is allowed to put all the cubes inside the squares so that they should match each other,i.e. the 1st square should have number 1, 2nd square number 2...and so on.

Any kind of comunications between them is forbidden.

They are allowed to set a plan before starting the mission.

What is the PLAN ?