Task: Program Execution
Input (English): q, 347, p, f, 487
Output (English): 3, 4, 7, 8