Task: Program Execution
Input (English): 4741, n, q, 8307, 8983, 1571, R, G, d, B
Output (English): 4741, 8307, 8983, 1571