Task: Program Execution
Input (English): 1851, 6873, q, P, V, 5171, 3181, 4697
Output (English): 1851, 6873, 17, 16, 22, 5171, 3181, 4697