{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"Given two strings a and b we define a*b to be their concatenation. For example, if a \u003d \"abc\" and b \u003d \"def\" then a*b \u003d \"abcdef\". If we think of concatenation as multiplication, exponentiation by a non-negative integer is defined in the normal way: a^0 \u003d \"\" (the empty string) and a^(n+1) \u003d a*(a^n)."}},{"title":"Input","value":{"format":"HTML","content":"Each test case is a line of input representing s, a string of printable characters. The length of s will be at least 1 and will not exceed 1 million characters. A line containing a period follows the last test case."}},{"title":"Output","value":{"format":"HTML","content":"For each s you should print the largest n such that s \u003d a^n for some string a. "}},{"title":"Sample","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\u003eabcd\r\naaaa\r\nababab\r\n.\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\r\n4\r\n3\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"This problem has huge input, use scanf instead of cin to avoid time limit exceed."}}]}