Task: Program Execution
Input (English): 6, 10, ['v', '7231', '2321', 'D', '9749', '4143', '5175', '2125', 'D', 'x', 'J']
Output (English): x, D, 2125, 5175, 4143