Task: Program Execution
Input (English): 3, 3, ['w', '5357', '9971']
Output (English): 1799