Six persons A, B, C, D, E, and F were playing on the staircase of their school. The staircase had twenty steps, numbered 1–20 from bottom to top. No two persons were standing on the same step initially. Each child rolled a dice once in alphabetical order, i.e., A rolled first, and so on. Each child moved as per the number they rolled, following the rules below. No two persons rolled the same number.
The sum of the steps of B and D is two less than the step of A. E stands on a step that is a multiple of 7 but below A. Both B and D stand below E. There are more than two steps between B and E. There is an even square number of steps between B and D. The difference between the steps of E and D is 10 less than that of C. The number of steps above F equals the number of steps below C. A stands on a step with a prime number. F stands on stair number below 5.
Movement Rules:
The one who got 1: Swapped positions with the person who got 5.
The one who got 2: Moved 4 stairs below. If already taken, stay at the original position.
The one who got 3: Swapped positions with the person who got 2.
The one who got 4: Swapped positions with the person who got 1.
The one who got 5: Moved 6 stairs below. If not possible, move 4 stairs up.
The one who got 6: Remained in the original place.
Note: Each person gets numbers in alphabetical order such as A got 1, B got 2, and so on.