Task: Program Execution
Input (English): 4, 4, ['1459', '247', '3217', '5085', '5405', 'V']
Output (English): 5805