Task: Program Execution
Input (English): B, Q, q, 9489, 699, A, M, m
Output (English): 9489, 699