A word and number arrangement machine rearranges an input line step by step, following a rule. Here is an illustration of the input and the steps:
| Step | Arrangement |
|---|---|
| Input | flag lion 98 13 88 ink |
| Step I | 13 flag lion 98 88 ink |
| Step II | 13 88 flag lion 98 ink |
| Step III | 13 88 98 flag lion ink |
Following the same rule, the machine is given this input: van 79 39 year 78 eagle
In Step I, which element is 6th from the right end?
Rule (from the illustration): In each step the smallest number not yet arranged moves to the left end, after the numbers already arranged; the words keep their order.
For the new input: Step I: 39 van 79 year 78 eagle; Step II: 39 78 van 79 year eagle; Step III: 39 78 79 van year eagle.
Answer: 39