Task: Program Execution
Input (English): 3, 4, ['D', '2901', 'Z', '1765', 'P', 'A']
Output (English): 5671Z