Task: Program Execution
Input (English): 3, 3, ['8571', 'S', '3175']
Output (English): 3175