Task: Program Execution
Input (English): 3, 5, ['8487', 'X', 'P', '7421', '5421', 'I', '6943']
Output (English): 54217421P