X X glued

For each registration number, print every run of two or more identical digits in the four-digit group, in left-to-right order.

Easy2StringImplementationSimulationNo attempts yetTime limit2sMemory limit512 MB

Problem

A car registration number in Benin is written as VY ABCD RB or Y ABCD RB, where V and Y are uppercase letters and ABCD are four digits. AC 2554 RB and X 6006 RB are both valid registration numbers.

Children in Benin play a game called X X glued on passing cars. The first child who finds two identical digits standing next to each other in the four digit group, calls them out and points at the car, wins.

You are given several registration numbers. For each one, find every block of identical digits standing next to each other. Only the four digit group counts, never the letters. A block counts once even when it is three or four digits long. 2000 holds one block made of 0, and 2233 holds two blocks, made of 2 and 3.

Input

The input has several lines. Each line holds one registration number, written as VY ABCD RB or Y ABCD RB. A line holding the single character # ends the input.

Output

Print one line for each registration number that holds at least one block. Write the blocks from left to right, each one as d d glued, where d is the digit of that block. When a registration number holds two blocks, write them on the same line with and between them, as in 2 2 glued and 3 3 glued. A registration number with no block prints no line at all, not even an empty one.