Task: Program Execution
Input (English): 6851, Q, X, 907, 3123, 177, L, 7977, 4953, 4931, R, 3327
Output (English): 6851, 17, 24, 907, 3123, 177, 12, 7977, 4953, 4931, 18, 3327