Task: Program Execution
Input (English): R, 19, B, 6387, R
Output (English): 18, 19, 2, 6387, 18