Task: Program Execution
Input (English): M, 8703, 4679, 6383, 9905, x, m, w, 4009, U
Output (English): 1, 6, 7, 8, 10