Task: Program Execution
Input (English): M, 5587, 4423, A, 8267, 8165, 1263
Output (English): 2, 3, 5, 6, 7