{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cpre\u003e给你两个四位的素数 $a,b$ 。\n $a$ 可以改变某一位上的数字变成 $c$ ,但只有当 $c$ 也是四位的素数时才能进行这种改变。\n请你计算 $a$ 最少经过多少次上述变换才能变成 $b$ 。\n例如:1033 -\u003e 8179 \n1033 \n1733 \n3733 \n3739 \n3779 \n8779 \n8179\n最少变换了6次。\u003c/pre\u003e\n"}},{"title":"输入格式","value":{"format":"HTML","content":"\u003cpre\u003e第一行输入整数 $T$ ,表示样例数。 $(T \\le 100)$\n每个样例输入两个四位的素数 $a, b$ 。(没有前导零) \u003c/pre\u003e\n"}},{"title":"输出格式","value":{"format":"HTML","content":"\u003cpre\u003e对于每个样例,输出最少变换次数,如果无法变换成 $b$ 则输出\"Impossible\"。\u003c/pre\u003e\n\u003cb\u003e注意:仅对于此题,输出时每行末尾的多余空格,不影响答案正确性。\u003c/b\u003e\n"}},{"title":"输入样例","value":{"format":"HTML","content":"\u003cpre\u003e3\n1033 8179\n1373 8017\n1033 1033\u003c/pre\u003e"}},{"title":"输出样例","value":{"format":"HTML","content":"\u003cpre\u003e6\n7\n0\u003c/pre\u003e"}}]}