Task: Program Execution
Input (English): 3, 3, ['2047', 'R', '6885', '1243', 'Z']
Output (English): 5886