Task: Program Execution
Input (English): W, 5231, q, q, k, v, 3803, 4697, 3353, 7341, 9677, 4573
Output (English): 38675