Task: Program Execution
Input (English): 5, 5, ['J', 'I', '3977', 'A', '4979', 'O']
Output (English): 4979