Task: Program Execution
Input (English): 4, 4, ['9791', '7271', '3777', '8259', 'Y']
Output (English): 8259