Task: Program Execution
Input (English): 6, 6, ['S', 'P', '1911', 'L', 'j', '5961', '7099', 'n', '5637', '335', 'q', 'Q']
Output (English): 5961