{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"zzy,lglg是两个素数,位数是4。\u003cbr\u003e\nzzy可以改变某一位上的数字变成另一个4位素数tyl,。\u003cbr\u003e\n请你计算zzy最少经过多少次变换才能变成lglg。\u003cbr\u003e\n例如:3779-\u003e 8179 \u003cbr\u003e\n3779 \u003cbr\u003e\n8779 \u003cbr\u003e\n8179\u003cbr\u003e\n最少变换了2次。\u003cbr\u003e"}},{"title":"Input","value":{"format":"HTML","content":"第一行输入整数T,表示样例数。 (T \u003c\u003d 100) \u003cbr\u003e\n每个样例输入两个四位的素数zzy,lglg。(没有前导零) \u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"对于每个样例,输出最少变换次数,如果无法变换成b则输出\"Impossible\"。"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e3\n1033 8179\n1373 8017\n1033 1033\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e6\n7\n0\u003c/pre\u003e"}}]}