Task: Program Execution
Input (English): 3, 3, ['M', '5011', '3409', 'K', 'K']
Output (English): 9043