Task: Program Execution
Input (English): 2, ['8707', '9831', '1747', 'S']
Output (English): 8707, 1747