You're typing a long text with a broken keyboard. Well it's not so badly broken. The only problem with the keyboard is that sometimes the "home" key or the "end" key gets automatically pressed (internally).
Furthermore, "Backspace" and "Delete" also get triggered unknowingly from time to time.
You're not aware of this issue, since you're focusing on the text and did not even turn on the monitor! After you finished typing, you can see a text on the screen (if you turn on the monitor). In Chinese, we can call it Beiju. Your task is to find the Beiju text.
There are several test cases. Each test case is a single line containing at least one and at most $10,000,000$ letters, underscores and two special characters '[' and ']'. '[' means the "Home" key is pressed internally, and ']' means the "End" key is pressed internally.
In addittion, '-' represents "Backspace" key down while '|' indicates "Delete" key being triggered. The input is terminated by end-of-file (EOF).
For each case, print the Beiju text on the screen.
vector, list 的費時，相差高達
137964 KB 為 vector 的 11 倍。以空間換取時間，非常划算喇！！