Task: Program Execution
Input (English): 3, 6, ['8101', 'X', 'H', 'P', '1907', 'M', 'n', '7997', '1603']
Output (English): M1907PH