Task: Program Execution
Input (English): G, 9487, 23, 843, f, P
Output (English): 9487, 23, 843