Task: Program Execution
Input (English): 3, 3, ['W', 'h', '6305', 'S', '1759', 'h', 'N', 'f', 'j']
Output (English): 6305