gcd

Time limit: 0.5s Memory limit: 64MB Input: Output:

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 NN and DD, and you have to tell me two different positive NN-digit numbers AA and BB so that their greatest common divisor is DD.

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 AA and BB is the greatest integer kk such that both AA and BB are multiples of kk.

Input

The input has two lines, both of them contain a single integer. The first line contains NN (1N181 \le N \le 18), the second line contains DD (1D1091 \le D \le 10^9).

For test cases worth 8 points, 1N31 \le N \le 3.

For test cases worth 16 more points, 1N71 \le N \le 7.

For test cases worth 7 more points, D=1D = 1.

For test cases worth 11 more points, D100D \le 100.

Output

You need to write two different positive integers AA and BB separated by a space. Both AA and BB must have NN digits and their greatest common divisor must be DD. 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 33-digit numbers whose greatest common divisor is 99. There are many possible solutions, e.g. 180180 and 729729.

Example 2

stdin

6
666666

stdout

0 0

Explanation

There is only one 66-digit number which is divisible by 666666666666, it is 666666666666 itself, which means that it is not possible to give two different 66-digit numbers whose greatest common divisor is 666666666666.

Log in or sign up to be able to send submissions!