Task: Program Execution
Input (English): 3, 6, ['9487', 'O', '5387', '2315', '305', 'A', 'f', 'T', 'G', '8983', 'v', 'M', 'I', '1207']
Output (English): 8007