{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv\u003e\u003cp\u003eGiven two positive integers \u003ci\u003en\u003c/i\u003e and \u003ci\u003ek\u003c/i\u003e, you are asked to generate a new integer, say \u003ci\u003em\u003c/i\u003e, by changing some (maybe none) digits of \u003ci\u003en\u003c/i\u003e, such that the following properties holds:\u003c/p\u003e\u003col\u003e\u003cli\u003e\u003ci\u003em\u003c/i\u003e contains no leading zeros and has the same length as \u003ci\u003en\u003c/i\u003e (We consider \u003ci\u003ezero\u003c/i\u003e itself a one-digit integer without leading zeros.)\u003c/li\u003e\u003cli\u003e\u003ci\u003em\u003c/i\u003e is divisible by \u003ci\u003ek\u003c/i\u003e\u003c/li\u003e\u003cli\u003eamong all numbers satisfying properties 1 and 2, \u003ci\u003em\u003c/i\u003e would be the one with least number of digits different from \u003ci\u003en\u003c/i\u003e\u003c/li\u003e\u003cli\u003eamong all numbers satisfying properties 1, 2 and 3, \u003ci\u003em\u003c/i\u003e would be the smallest one\u003c/li\u003e\u003c/ol\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThere are multiple test cases for the input. Each test case consists of two lines, which contains \u003ci\u003en\u003c/i\u003e(1≤\u003ci\u003en\u003c/i\u003e≤10\u003csup\u003e100\u003c/sup\u003e) and \u003ci\u003ek\u003c/i\u003e(1≤\u003ci\u003ek\u003c/i\u003e≤10\u003csup\u003e4\u003c/sup\u003e, \u003ci\u003ek\u003c/i\u003e≤\u003ci\u003en\u003c/i\u003e) for each line. Both \u003ci\u003en\u003c/i\u003e and \u003ci\u003ek\u003c/i\u003e will not contain leading zeros.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eOutput one line for each test case containing the desired number \u003ci\u003em\u003c/i\u003e.\u003c/p\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n2\r\n619103\r\n3219\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n119103\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}