Pea Pattern
문제
Do you see the pattern in the following sequence of numbers?
Each term describes the makeup of the previous term in the list. For example, the term indicates that the previous term consisted of three 's (that's the in ) and one (that's the in ). The next term after indicates that it contains two 's, one and one . This is an example of a pea pattern.
A pea pattern can start with any number. For example, if we start with the number the sequence would proceed , , , and so on. Note that digits with no occurrences in the previous number are skipped in the next element of the sequence.
We know what you're thinking. You're wondering if appears in the sequence starting with . Well, this is your lucky day because you're about to find out.
입력
Input consists of a single line containing two positive integers and , where is the starting value for the sequence and is a target value. Both values will lie between and .
출력
If appears in the pea pattern that starts with , display its position in the list, where the initial value is in position . If does not appear in the sequence, display Does not appear. We believe that all of these patterns converge on a repeating sequence within numbers, but if you find a sequence with more than numbers in it, display I'm bored.
예제
예제 1
1 3112
5
예제 2
1 3113
Does not appear
예제 3
20902 101011213141516171829
10