UVA11956 Brainfuck

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=229&page=show_problem&problem=3107 [PDF](https://uva.onlinejudge.org/external/119/p11956.pdf) Recently your friend Bob has bought a new brainfuck programmable LED display. However executing a program directly on LED display takes huge amount of time. Because of this, now Bob decided to write the interpreter of display instruction set in order to test and debug all his programs on his PC and only after that execute his code on LED display. However Bob knows only one programming language — its certainly brainfuck (otherwise he would not have bought this LED display). So he asks you to write him an interpreter. A display's program is a sequence of commands executed sequentially. The commands of the display processor is a subset of brainfuck language commands. The commands that processor was capable to execute were `>`, `` | Increment the pointer (to point to the next cell to the right). | | `

Input Format

There is a number of tests $T$ ($T \leq 100$) on the first line. After $T$ tests follow. Each test case is a sequence of display processor commands on a separate line. You can assume that line length is less than $100000$.

Output Format

For each test output a single line $\texttt{Case }T\texttt{: }D$. Where $T$ is the test number (starting from $1$) and $D$ is display's memory dump in hexademical numeration system after executing given brainfuck program. Every byte must be separated exactly by one space character. See examples for clarification. Please note, that the sample input and output is divided into several lines only for convenience.