Task: Program Execution
Input (English): 5, 5, ['p', 'l', '2987', '6103', '4741', '8331']
Output (English): 4741