Task: Program Execution
Input (English): 2, 5, ['X', 'M', 'J', 'F', '3889', 'm', 'K', '8851']
Output (English): 3889