Task: Program Execution
Input (English): M, Q, 5631, 8231, l, d, c, Q, 2477, 7335, 1367, 9399, 7333, 9839, 9815, l, 1923, W, 8609
Output (English): 3, 4, 9, 10, 11, 12, 13, 14, 15, 17, 19