Task: Program Execution
Input (English): D, w, 3651, 789, W, d, T, 497, 2749, 2465
Output (English): 10151