The Generalized Fibonacci sequence is defined by the recurrence relation:
It turns out that , which contains digits, is the first Fibonacci number for which the last nine digits are pandigital (contain all the digits to , but not necessarily in order). And , which contains digits, is the first Fibonacci number for which the first nine digits are pandigital.
Given that is the first Generalized Fibonacci number for which the first digits AND the last digits are pandigital, find .
NOTE For this problem if you don't find a solution with in , print no solution.
First line of input contains , second line contains and the third line contains .
Print the value where is the required generalized fibonacci term.