Task: Program Execution
Input (English): Q, 7183, 2559, 9997
Output (English): 2, 3, 4