Task: Program Execution
Input (English): 4, 12, ['299', '8827', '8689', 'O', 'O', '1441', 'p', 'P', 'O', 'N', '3635', '5167']
Output (English): 51673635NOPp1441OO