Task: Program Execution
Input (English): 2, 2, ['m', '7761', '6411', 'T', '3151', 'N', 'E', 'q', 'M']
Output (English): 7761