Task: Program Execution
Input (English): 3117, 3561, q
Output (English): q, 3117, 3561