Task: Program Execution
Input (English): M, 2599, 8515, G, x, N, 2661
Output (English): 2, 3, 7