{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eDo you think that analyzing bit strings is easy? This is not the case when you are in a dream. So you are in a dream. Unexpectedly, right? But... I am afraid it\u0027s not the dream you always wanted to be in. You have a string of bits in your dream, a long string of bits you are to deal with. And you clearly understand what you should do to leave this horrible dream right now: find the best \u003cem\u003especial \u003c/em\u003estring.\u003c/p\u003e\n\n\u003cp\u003eLuckily, you know that you read a book about the theory of special strings yesterday. You only managed to remember the strangest definition of special strings, though, which sounded as follows.\u003c/p\u003e\n\n\u003cp\u003eSuppose you have a string of bits \u003cstrong\u003eT\u003c/strong\u003e of length \u003cstrong\u003en\u003c/strong\u003e. Bits of \u003cstrong\u003eT\u003c/strong\u003e are referred to as \u003cstrong\u003eT_1\u003c/strong\u003e, \u003cstrong\u003eT_2\u003c/strong\u003e, ..., \u003cstrong\u003eT_n\u003c/strong\u003e. Let\u0027s denote \u003cstrong\u003eA\u003c/strong\u003e(\u003cstrong\u003ei\u003c/strong\u003e, \u003cstrong\u003ej\u003c/strong\u003e) and \u003cstrong\u003eB\u003c/strong\u003e(\u003cstrong\u003ei\u003c/strong\u003e, \u003cstrong\u003ej\u003c/strong\u003e) as the number of \u003cstrong\u003e0\u003c/strong\u003e-bits and \u003cstrong\u003e1\u003c/strong\u003e-bits among \u003cstrong\u003eT_i\u003c/strong\u003e, \u003cstrong\u003eT_\\{i+1\\\u003c/strong\u003e}, ..., \u003cstrong\u003eT_j\u003c/strong\u003e, correspondingly. String \u003cstrong\u003eT\u003c/strong\u003e is called special if for every \u003cstrong\u003ei \u003c/strong\u003ebetween \u003cstrong\u003e1\u003c/strong\u003e and \u003cstrong\u003en\u003c/strong\u003e, inclusive, both of the following conditions hold: \u003cstrong\u003eA\u003c/strong\u003e(\u003cstrong\u003e1\u003c/strong\u003e, \u003cstrong\u003ei\u003c/strong\u003e) ≥ \u003cstrong\u003eB\u003c/strong\u003e(\u003cstrong\u003e1\u003c/strong\u003e, \u003cstrong\u003ei\u003c/strong\u003e) and \u003cstrong\u003eA\u003c/strong\u003e(\u003cstrong\u003ei\u003c/strong\u003e, \u003cstrong\u003en\u003c/strong\u003e) ≤ \u003cstrong\u003eB\u003c/strong\u003e(\u003cstrong\u003ei\u003c/strong\u003e, \u003cstrong\u003en\u003c/strong\u003e).\u003c/p\u003e\n\n\u003cp\u003eBut you can\u0027t be satisfied with just any special string. You need the best special string. The dream was very strange and thus the rules to determine which of two strings was better were strange as well. Let \u003cstrong\u003eL_1\u003c/strong\u003e and \u003cstrong\u003eL_2\u003c/strong\u003e be the lengths of two strings, and \u003cstrong\u003eP_1\u003c/strong\u003e and \u003cstrong\u003eP_2\u003c/strong\u003e be their numbers of occurrences in the given string \u003cstrong\u003eS\u003c/strong\u003e as a substring, respectively. Then you know that first string is better than the second one if \u003cstrong\u003eL_1\u003c/strong\u003e ∙ \u003cstrong\u003eP_1\u003c/strong\u003e \u003e \u003cstrong\u003eL_2\u003c/strong\u003e ∙ \u003cstrong\u003eP_2\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003eSo your task is simple... or not? Find the best special string - a special string such that no other special string is better.\u003c/p\u003e\n\n\u003cp\u003e\u003ch2\u003eInput\u003c/h2\u003e\u003c/p\u003e\n\n\u003cp\u003eOnly one line that contains the string \u003cstrong\u003eS\u003c/strong\u003e (\u003cstrong\u003e2\u003c/strong\u003e ≤ |\u003cstrong\u003eS\u003c/strong\u003e| ≤ \u003cstrong\u003e2*10^5\u003c/strong\u003e) consisting of zeroes and ones.\u003c/p\u003e\n\n\u003cp\u003e\u003ch2\u003eOutput\u003c/h2\u003e\u003c/p\u003e\n\n\u003cp\u003eThe first line should contain the value of \u003cstrong\u003eL\u003c/strong\u003e ∙ \u003cstrong\u003eP\u003c/strong\u003e, where \u003cstrong\u003eL\u003c/strong\u003e is the length of the best special string and \u003cstrong\u003eP\u003c/strong\u003e is the number of its occurrences in \u003cstrong\u003eS\u003c/strong\u003e as a substring. The second line should contain the best special string itself. If there are several best special strings, you can choose any of them.\u003c/p\u003e\n\n\u003cp\u003eIt is guaranteed that at least one special string is a substring of \u003cstrong\u003eS\u003c/strong\u003e.\u003c/p\u003e\n\n"}},{"title":"Example","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\u003e00111001110101\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e8\n0011\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}