{"scoring":null,"notes":"","legend":"The most challenging exam for the students of the Recreational Mathematics Department is the exam in numeric shifts. Every year problems in this subject become more and more difficult. For the latest exam Professor Numberski has prepared something unbelievable. \r\n\r\nThe decimal notation of a certain number begins from a group of digits which will be denoted as $B$. In other words, the initial number is $BX$. If we multiply this number by $A$, the result of multiplication will be a number obtained by rewriting the group of digits $B$ from the beginning to the end of the initial number, which means the final result of multiplication is $XB$.\r\n\r\nThe task of students is to find the minimal possible initial number $BX$ based on given $A$ and $B$.","authorLogin":"sergm55","language":"english","timeLimit":1000,"output":"The only number~--- solution of the task, or \\texttt{-1} if there is no solution.","inputFile":"stdin","outputFile":"stdout","input":"The only line contains two integers $A$ and $B$ $(2 \\le A \\le 9$, $1 \\le B \\le 10^6)$.","authorName":"Mikhaylin Sergey","sampleTests":[{"output":"-1","input":"5 1\r\n","inputFile":"example.01","outputFile":"example.01.a"},{"output":"142857","input":"3 1\r\n","inputFile":"example.02","outputFile":"example.02.a"}],"name":"Numbers (Div-2 only!)","interaction":null,"memoryLimit":268435456,"tutorial":null}