Task: Program Execution
Input (English): 117, 321, q, 3
Output (English): 1, 2, 3, 7