Task: Program Execution
Input (English): A, 7599, 545, 7977, M, X, m, T, b, M
Output (English): A, M, X, m, T, b, M