{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eA prime number (or a prime) is a natural number greater than $1$ that cannot be formed by multiplying two smaller natural numbers.\u003c/p\u003e\u003cp\u003eNow lets define a number $N$ as the \u003cstrong\u003esupreme number\u003c/strong\u003e if and only if each number made up of an non-empty \u003cstrong\u003esubsequence\u003c/strong\u003e of all the numeric digits of $N$ must be either a prime number or $1$.\u003c/p\u003e\u003cp\u003eFor example, $17$ is a supreme number because $1$, $7$, $17$ are all prime numbers or $1$, and $19$ is not, because $9$ is not a prime number.\u003c/p\u003e\u003cp\u003eNow you are given an integer $N\\ (2 \\leq N \\leq 10^{100})$, could you find the maximal \u003cem\u003esupreme number\u003c/em\u003e that does not exceed $N$?\u003c/p\u003e\u003ch3\u003eInput\u003c/h3\u003e\u003cp\u003eIn the first line, there is an integer $T\\ (T \\leq 100000)$ indicating the numbers of test cases.\u003c/p\u003e\u003cp\u003eIn the following $T$ lines, there is an integer $N\\ (2 \\leq N \\leq 10^{100})$.\u003c/p\u003e\u003ch3\u003eOutput\u003c/h3\u003e\u003cp\u003eFor each test case print \u003ccode\u003e\"Case #x: y\"\u003c/code\u003e, in which $x$ is the order number of the test case and $y$ is the answer.\u003c/p\u003e"}},{"title":"Sample 1","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\n6\n100\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase #1: 5\nCase #2: 73\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr /\u003e"}}]}