Task: Program Execution
Input (English): d, q, i, 171, 109, v, 401, 7
Output (English): 0, 1, 4, 7, 9