Task: Program Execution
Input (English): 2, 5, ['3949', 'S', 'd', 'M', '3449', '6091', '7789', 'r', 'K', '8231', 'r', 'k', '2941', 'c', '7289', 'D']
Output (English): S, d, M, 3449