Problem: etrouble

Problem IDetrouble
Difficulty level (0..10)5
Maximum runtime1 minute

D is a digit from 1 up to 9 and M is a number from 1 to 9. Given D and M, you should find an integer X which ends in D and if D is moved to the start of the number, the number becomes exactly M times bigger. X should be the smallest possible.

i.e. D=6 M=6
X=1016949152542372881355932203389830508474576271186440677966

Input will be lines (ended by EOF) containing D and M (in that order) Output should be the according X. Sample input:

6 6
1 4

Sample output:

1016949152542372881355932203389830508474576271186440677966
025641