{"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\u003eThere are \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e phone numbers in Kirito\u0027s phone. Each number is a 9-digit integer, starting with a digit different from \n\u003cspan class\u003d\"tex-span\"\u003e0\u003c/span\u003e. The Phone numbers are distinct \u003c/p\u003e\n\u003cp\u003eThe latest version of alfheim OS is installed on Kirito\u0027s phone. If some number is entered, it shows up all the numbers in the contacts for which there is a substring equal to the entered sequence of digits. For example, there are three phone numbers in Kirito\u0027s contacts: \u003cspan class\u003d\"tex-span\"\u003e123456788\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e110014533\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e100123466\u003c/span\u003e, then :\u003c/p\u003e\n\u003cul\u003e \n \u003cli\u003e Suppose he enters \u003cspan class\u003d\"tex-span\"\u003e45\u003c/span\u003e, two numbers will show up: \u003cspan class\u003d\"tex-span\"\u003e123456788\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e110014533\u003c/span\u003e \u003c/li\u003e\n\n\n\u003cp\u003eFor each phone number in Kirito\u0027s contacts, find the minimum in length sequence of digits such that if Kirito enters this sequence, alfheim shows that phone number only.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains single integer \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003en\u003c/i\u003e ≤ 70000\u003c/span\u003e) — the total number of phone contacts in Kirito\u0027s contacts.\u003c/p\u003e\n\u003cp\u003eThen, n different phone numbers follow , where each digit is between \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003e to \u003cspan class\u003d\"tex-span\"\u003e9\u003c/span\u003e(inclusive). All the numbers are distinct.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint exactly \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e lines: the \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/span\u003e-th of them should contain the shortest non-empty sequence of digits, such that if Kirito enters it, the alfheim OS shows up only the \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/span\u003e-th number from the contacts. If there are several such sequences, print any of them.\u003c/p\u003e"}},{"title":"Examples","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\u003e4\n123456789\u003cbr\u003e193456789\u003cbr\u003e134567819\u003cbr\u003e934567891\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\u003e2\u003cbr\u003e193\u003cbr\u003e81\u003cbr\u003e91\u003c/pre\u003e\n "}}]}