Task: Program Execution
Input (English): M, Q, R, c, 7881, 583, c, 8909, 9177, 423, g, 2387, 1519, 3369, J, X, c, 3299, 1825
Output (English): 13, 17, 18, 3, 7881, 583, 3, 8909, 9177, 423, 7, 2387, 1519, 3369, 10, 24, 3, 3299, 1825