Task: Program Execution
Input (English): M, 3955, q, 3733, 885, M, f, 2775, 3179, 1971
Output (English): 1, 3, 6, 7