{"trustable":false,"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\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eSetsuna 快没钱了!所以,她总是想办法一夜暴富。 \u003c/p\u003e\n\u003cp\u003e她发现买彩票是个不错的选择,她决定用自己的幸运号码作为彩票号码。\u003c/p\u003e\n\u003cp\u003eSetsuna 使用一些独特的方法来挑选她的幸运数字。她将首先选择 $n$ 魔法卡。每张卡片都写有$0$ 和$9$ 之间的数字。然后她会用一些卡片来构造一个数字。她认为自己能构造的最大能被4整除的数就是她的幸运数。\u003c/p\u003e\n\u003cp\u003e没必要把所有的牌都用完,有可能不存在这样的幸运数字。\u003c/p\u003e\n\u003cp\u003e因为她做着发家致富的白日梦,只有你能帮她找到这个幸运数字。\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e输入由多个测试用例组成。 \u003c/p\u003e\n\u003cp\u003e第一行包含一个整数$$$t(1 \\leq t \\leq 3 \\times 10^5)$$$,表示测试用例的数量。\u003c/p\u003e\n\u003cp\u003e接下来的每一行 $$$t$$$ 包含 $$$10$$$ 个整数 $$$c_0,c_1,\\cdots,c_{9}(0 \\leq c_i \\leq 10^5,\\sum_ {i\u003d0}^9 c_i \u003e 0)$$$,其中$c_i$表示写有$i$的牌张数。\u003c/p\u003e\n\u003cp\u003e保证所有测试用例的$\\sum_{i\u003d0}^9 c_i$之和不超过$3 \\times 10^5$。\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e对于输入中给出的每个测试用例,如果幸运数字不存在,则打印幸运数字(不带前导零)或 $$$-1$$$。\u003c/p\u003e"}},{"title":"Example","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e6\n0 1 1 0 0 0 0 0 0 0\n0 0 0 0 1 0 0 0 0 0\n1 0 0 2 0 0 0 0 0 0\n2 1 1 1 1 1 1 1 1 1\n1 1 1 1 1 1 1 1 1 1\n0 1 1 1 1 1 1 1 1 1\n\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e12\n4\n0\n98765432100\n9876543120\n987654312\n\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}}]}