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:
Input: sun 72 75 lion 79 vest jug 77
Step I: 72 sun 75 lion 79 vest jug 77
Step II: 72 75 sun lion 79 vest jug 77
Step III: 72 75 77 sun lion 79 vest jug
Step IV: 72 75 77 79 sun lion vest jug
Following the same rule, the machine is given this input: van 76 84 bird umbrella 31 ship 41
Which step is the last step for this input?
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: 31 van 76 84 bird umbrella ship 41; Step II: 31 41 van 76 84 bird umbrella ship; Step III: 31 41 76 van 84 bird umbrella ship; Step IV: 31 41 76 84 van bird umbrella ship.
Answer: Step IV