Task: Program Execution
Input (English): W, 3017, 1267, h, w, 8137, 7689, 1487, S, L
Output (English): 2, 3, 6, 7, 8