Task: Program Execution
Input (English): q, q, 141, 327, 411, d
Output (English): 1, 2, 3, 4, 7