Task: Program Execution
Input (English): 1, ['5871', '9841', '2575', '5729', '9387', 'Q']
Output (English): 5871