Task: Program Execution
Input (English): r, N, q, c, R, 8563
Output (English): 18, 14, 17, 3, 18, 8563