Task: Program Execution
Input (English): Q, 371, 2539, X, 5367, L, 4029, 7809
Output (English): 17, 371, 2539, 24, 5367, 12, 4029, 7809