Task: Program Execution
Input (English): S, n, q, B, 5319, 4111, X, s, 5681, i, 4845
Output (English): 19, 14, 17, 2, 5319, 4111, 24, 19, 5681, 9, 4845