Task: Program Execution
Input (English): 2, 2, ['G', '4565', 'd', '8117', '587', 'Q']
Output (English): 4565