{"raw_statement":[{"iden":"problem statement","content":"You are given $N$ strings consisting of lowercase English letters. Let $S_i$ be the $i$\\-th $(i = 1, 2, \\dots, N)$ of them.\nFor two strings $x$ and $y$, $\\mathrm{LCP}(x, y)$ is defined to be the maximum integer $n$ that satisfies all of the following conditions:\n\n*   The lengths of $x$ and $y$ are both at least $n$.\n*   For all integers $i$ between $1$ and $n$, inclusive, the $i$\\-th character of $x$ and that of $y$ are equal.\n\nFind the following value for all $i = 1, 2, \\dots, N$:\n\n*   $\\displaystyle \\max_{i \\neq j} \\mathrm{LCP}(S_i, S_j)$"},{"iden":"constraints","content":"*   $2 \\leq N \\leq 5 \\times 10^5$\n*   $N$ is an integer.\n*   $S_i$ is a string of length at least $1$ consisting of lowercase English letters $(i = 1, 2, \\dots, N)$.\n*   The sum of lengths of $S_i$ is at most $5 \\times 10^5$."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$S_1$\n$S_2$\n$\\vdots$\n$S_N$"},{"iden":"sample input 1","content":"3\nabc\nabb\naac"},{"iden":"sample output 1","content":"2\n2\n1\n\n$\\mathrm{LCP}(S_1, S_2) = 2, \\mathrm{LCP}(S_1, S_3) = 1$, and $\\mathrm{LCP}(S_2, S_3) = 1$."},{"iden":"sample input 2","content":"11\nabracadabra\nbracadabra\nracadabra\nacadabra\ncadabra\nadabra\ndabra\nabra\nbra\nra\na"},{"iden":"sample output 2","content":"4\n3\n2\n1\n0\n1\n0\n4\n3\n2\n1"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}