Zombdar

No attempts yetTime limit2sMemory limit128 MB

Problem

You are reading data from a zombie sensor. The sensor scans the area around it and counts the zombies nearby. As it scans, it writes log entries into its buffer. An entry is one of three strings: Zombies: <integer>;, No Zombies;, or RUN;, and the last one appears when the sensor is overloaded. Nothing else ever goes into the buffer.

The sensor's serial port emits one line every second. Each line carries whatever bytes were sitting in the buffer at that moment, so a line can cut an entry in half, can hold several entries at once, and can be empty. Concatenating every line of a data set in order, with the newlines dropped, reproduces exactly what the sensor wrote.

Suppose the sensor writes Zombies: 5; and then Zombies: 1;. The serial port may emit that as the four lines Zom, bies:, 5;Zombies: 1, ;. The first entry becomes complete at second 3, the second one at second 4.

An entry is complete the moment its closing semicolon arrives. Bytes still left in the buffer when a data set ends never become an entry.

Reading the serial port data correctly is what keeps you alive.

Input

The first line contains the number of data sets N (1 ≤ N ≤ 50).

Each data set is the raw data emitted by the serial port, one line per second, followed by a line containing only END OF CASE. The first line of a data set is read after 1 second, the second line after 2 seconds, and so on. An empty line still costs one second. The END OF CASE line marks the end of the data set and is not sensor data.

Output

For every complete log entry, print one line in the form timestamp: entry. The timestamp is the number of seconds between the start of that entry's data set and the moment the entry finished arriving. The entry includes its closing semicolon. Timestamps restart at 1 for each data set. Print entries in the order they complete, and print the data sets one after another with no blank line or header between them.