Task: Program Execution
Input (English): 6, 10, ['w', '4387', 'R', '5205', 'g', '917', 'r', '6053', 'B', '3177', '7935', 'l', 'w', '6569', 'd', '5403', '9421', 'O']
Output (English): 10147