Task: Program Execution
Input (English): 5, 5, ['8479', '2995', '3627', '2391', '8645', 'P']
Output (English): 8645