Task: Program Execution
Input (English): 4, 4, ['n', '7785', 'd', '7249', '4047', 't', 'G', '3071', '7475', '249']
Output (English): 9427