Task: Program Execution
Input (English): 5, 5, ['3671', '8015', '6547', '9453', '5809', 'N']
Output (English): 5809