PROGRAMMING:Palindrome number (high precision addition)
If a number read from left to right is the same as a number read from right to left, we call it palindrome number. For example: given a decimal number 56, add 56 to 65 (that is, read 56 from right to left), and 121 is a palindrome number. For example, for the decimal number 87,
STEP1: 87+78= 165 STEP2: 165+561= 726
STEP3: 726+627=1353 STEP4:1353+3531=4884
One step here refers to the addition of n-ary system. In the above example, it takes at least 4 steps to get the palindrome number 4884.
Write a program, given a n (2 < n < = 10 or n = 16) base number M. find at least after a few steps can get palindrome number. If it is impossible to get palindrome number within 30 steps (including 30 steps), output "impossible".
###Input format:
Given an N and n (2 < n < = 10 or n = 16) base number m (m does not exceed 4000 bits)
###Output format:
At least a few steps. If it is impossible to get palindrome number within 30 steps (including 30 steps), output "impossible".
###Input example:
```in
10 87
```
###Output example:
The corresponding output is given here. For example:
```out
four
```
answer:If there is no answer, please comment
STEP1: 87+78= 165 STEP2: 165+561= 726
STEP3: 726+627=1353 STEP4:1353+3531=4884
One step here refers to the addition of n-ary system. In the above example, it takes at least 4 steps to get the palindrome number 4884.
Write a program, given a n (2 < n < = 10 or n = 16) base number M. find at least after a few steps can get palindrome number. If it is impossible to get palindrome number within 30 steps (including 30 steps), output "impossible".
###Input format:
Given an N and n (2 < n < = 10 or n = 16) base number m (m does not exceed 4000 bits)
###Output format:
At least a few steps. If it is impossible to get palindrome number within 30 steps (including 30 steps), output "impossible".
###Input example:
```in
10 87
```
###Output example:
The corresponding output is given here. For example:
```out
four
```
answer:If there is no answer, please comment