Task: Program Execution
Input (English): 2917, N, 3059, q, t, R, T, 6741
Output (English): 12717