Task: Program Execution
Input (English): 3, 3, ['1231', '1065', '4963', 'K', '7887']
Output (English): 3694