This problem is a programming version of Problem 62 from projecteuler.net
The cube, , can be permuted to produce two other cubes: and .
In fact, is the smallest cube which has exactly three permutations of its digits which are also cube.
You are given , find the smallest cube for which exactly permutations of its digits are cube of some number which is . If there are multiple sets, print the minimal element of each in sorted order.
Input Format
Input contains two space separated integers and .
Constraints
Output Format
Print the answer corresponding to the test case. If there are more than one number, print them on separate lines.
Sample Input
1000 3
Sample Output
41063625