{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eYou are given an integer $$$n$$$. You have to change the minimum number of digits in it in such a way that the resulting number \u003cspan class\u003d\"tex-font-style-bf\"\u003edoes not have any leading zeroes\u003c/span\u003e and \u003cspan class\u003d\"tex-font-style-bf\"\u003eis divisible by $$$7$$$\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eIf there are multiple ways to do it, print any of them. If the given number is already divisible by $$$7$$$, leave it unchanged.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains one integer $$$t$$$ ($$$1 \\le t \\le 990$$$) — the number of test cases.\u003c/p\u003e\u003cp\u003eThen the test cases follow, each test case consists of one line containing one integer $$$n$$$ ($$$10 \\le n \\le 999$$$).\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case, print one integer without any leading zeroes — the result of your changes (i. e. the integer that is divisible by $$$7$$$ and can be obtained by changing the minimum possible number of digits in $$$n$$$).\u003c/p\u003e\u003cp\u003eIf there are multiple ways to apply changes, print any resulting number. If the given number is already divisible by $$$7$$$, just print it.\u003c/p\u003e"}},{"title":"Examples","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\u003e3\n42\n23\n377\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e42\n28\n777\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first test case of the example, $$$42$$$ is already divisible by $$$7$$$, so there\u0027s no need to change it.\u003c/p\u003e\u003cp\u003eIn the second test case of the example, there are multiple answers — $$$28$$$, $$$21$$$ or $$$63$$$.\u003c/p\u003e\u003cp\u003eIn the third test case of the example, other possible answers are $$$357$$$, $$$371$$$ and $$$378$$$. Note that you \u003cspan class\u003d\"tex-font-style-bf\"\u003ecannot\u003c/span\u003e print $$$077$$$ or $$$77$$$.\u003c/p\u003e"}}]}