Task: Program Execution
Input (English): 5, 5, ['2927', 'M', '5407', '3991', '387', 'b']
Output (English): 387