Task: Program Execution
Input (English): 3, 3, ['2831', '9041', '8385', '6441', 'M', 'x']
Output (English): 8385