Task: Program Execution
Input (English): 2, 2, ['7873', '9413', 'P', 'a']
Output (English): 3149