Task: Program Execution
Input (English): 497, 21, 239, 487, 149, q
Output (English): 1, 2, 3, 4, 7, 8, 9