Task: Program Execution
Input (English): 10, 12, ['3877', '2441', '6473', '1985', '1895', '3537', '1443', 'o', 'a', '2165', 'd', '1153', '3437', 'i', 'p', 'D']
Output (English): 3318