Programming Problem #26
"Conway Sequences"

The mathematician John Conway (inventor of Life) spent some time analyzing the following sequence of digit strings.
1
11
21
1211
111221
312211
13112221
1113213211
31131211131221
...
Each string beginning with the second is a 'description' of the preceding string. The second string, '11', describes the first: it contains one 1. The third string, '21', describes the second: it contains two 1's. The sixth string, '312211', describes the fifth: it contains three 1's followed by two 2's followed by one 1. Conway discovered a number of interesting properties of this sequence, including the fact that it will never contain any digits other than 1, 2, and 3.

This sequence can obviously be generalized to begin with any string of digits. For this problem the input will consist of one or more lines, each of which begins with an integer N (0 < N < 100) followed by a space and a string of consecutive digits that is to be used as the starting point for a Conway sequence. For each line of the input, output the Nth string in the sequence. The initial string is number 1. You may assume that starting strings will have no more that 50 digits, will not contain a zero, and will not contain more than nine of the same digit consecutively.

Input must be read from the file "prob26.in", and output must be written to the file "prob26.out". All output to the screen will be ignored.


Example Input

<BOF>
7 1
5 8265292675
8 321
<EOF>

Example Output

13112221
132118132112132116132115132112132119132112132116132117132115
1321133112132112311311123113112211

Dr. Eric Shade