B.
YetnotherrokenKeoard
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Polycarp has a problem — his laptop keyboard is broken.
Now, when he presses the 'b' key, it acts like an unusual backspace: it deletes the last (rightmost) lowercase letter in the typed string. If there are no lowercase letters in the typed string, then the press is completely ignored.
Similarly, when he presses the 'B' key, it deletes the last (rightmost) uppercase letter in the typed string. If there are no uppercase letters in the typed string, then the press is completely ignored.
In both cases, the letters 'b' and 'B' are not added to the typed string when these keys are pressed.
Consider an example where the sequence of key presses was "ARaBbbitBaby". In this case, the typed st