Task: Program Execution
Input (English): A, 7391, B, 1839, L, 2631, 4311, 7951, 7743, p, q, Q, 8499, 597, 5513, 1781, i, d
Output (English): 1, 3, 5, 10, 11, 12, 17, 18