Task: Program Execution
Input (English): 5, 5, ['p', '8063', '4065', 'N', '4999', '8693', '3195', 'i', 'v', '7903', '2081', '5407', 'O']
Output (English): 4999