Task
Evil George has kidnapped the princess. Now Drogo the dragon comes to rescue her. George prefers challenging the dragon intellectually rather than fighting him, so he tells Drogo:
I will free the princess if you can solve the following puzzle. I tell you two positive numbers and , and you have to tell me two different positive -digit numbers and so that their greatest common divisor is .
Can you help the dragon to solve this challenge and save the princess? Beware, George might be so evil that there is no possible answer!
Note: the greatest common divisor of two positive integer numbers and is the greatest integer such that both and are multiples of .
Input
The input has two lines, both of them contain a single integer. The first line contains (), the second line contains ().
For test cases worth 8 points, .
For test cases worth 16 more points, .
For test cases worth 7 more points, .
For test cases worth 11 more points, .
Output
You need to write two different positive integers and separated by a space. Both and must have digits and their greatest common divisor must be . If there are no such numbers, you should write 0 0
to the output. If there are multiple possible solutions, you can print any of them.
Example 1
stdin
3
9
stdout
180 729
Explanation
Drogo has to tell two different -digit numbers whose greatest common divisor is . There are many possible solutions, e.g. and .
Example 2
stdin
6
666666
stdout
0 0
Explanation
There is only one -digit number which is divisible by , it is itself, which means that it is not possible to give two different -digit numbers whose greatest common divisor is .