Task: Program Execution
Input (English): 3, 5, ['w', 'B', 'N', 'D', 'm']
Output (English): NDm