Task: Program Execution
Input (English): 9729, M, V, O, 3707, 1705, x, 5365, S, 2631
Output (English): 9729, 13, 22, 15, 3707, 1705, 24, 5365, 19, 2631