{"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":"MD","content":"TXT 和她的朋友 FGH 与 WHR 在 ~~[数据删除]~~ 找到了一个密码箱,上面写着字符串 $s$ 。但是当 TXT 输入字符串 $s$ 时无事发生。聪明的 TXT 推测密码是字符串 $s$ 的某个子串 $t$ 。\n\nFGH 推测子字符串 $t$ 是字符串 $s$ 的前缀, WHR 推测子字符串 $t$ 应该是字符串 $s$ 的后缀,而 TXT 推测 $t$ 应该位于字符串 $s$ 的内部,也就是说,$t$ 既不是它的前缀,也不是它的后缀。\n\nTXT 选择子字符串 $t$ 以取悦所有的伙伴。此外,从所有可接受的答案中,TXT 选择了最长的一个(因为 TXT 喜欢长字符串)。当 TXT 输入字符串 $t$ 时,密码箱打开了。\n\n现在请你找出子字符串 $t$,或确定这样的子字符串不存在。"}},{"title":"输入格式","value":{"format":"MD","content":"你被给予一个字符串 $s$,其长度可以在 $1$ 到 $10^6$(包含)之间变化,由小写拉丁字母组成。"}},{"title":"输出格式","value":{"format":"MD","content":"打印字符串 $t$。如果不存在合适的 $t$ 字符串,那么打印 \"Just a legend\" 。"}},{"title":"样例 #1","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003e输入\u003c/th\u003e\n \u003cth\u003e输出\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003efixedprefixsuffix\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003efix\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"样例 #2","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003e输入\u003c/th\u003e\n \u003cth\u003e输出\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003eabcdabc\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eJust a legend\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}