{"problem":{"name":"Best Representation","description":{"content":"Let $x$ be a string of length at least $1$. We will call $x$ a _good_ string, if for any string $y$ and any integer $k (k \\geq 2)$, the string obtained by concatenating $k$ copies of $y$ is different ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc060_d"},"statements":[{"statement_type":"Markdown","content":"Let $x$ be a string of length at least $1$. We will call $x$ a _good_ string, if for any string $y$ and any integer $k (k \\geq 2)$, the string obtained by concatenating $k$ copies of $y$ is different from $x$. For example, `a`, `bbc` and `cdcdc` are good strings, while `aa`, `bbbb` and `cdcdcd` are not.\nLet $w$ be a string of length at least $1$. For a sequence $F=(\\,f_1,\\,f_2,\\,...,\\,f_m)$ consisting of $m$ elements, we will call $F$ a _good representation_ of $w$, if the following conditions are both satisfied:\n\n*   For any $i \\, (1 \\leq i \\leq m)$, $f_i$ is a good string.\n*   The string obtained by concatenating $f_1,\\,f_2,\\,...,\\,f_m$ in this order, is $w$.\n\nFor example, when $w=$`aabb`, there are five good representations of $w$:\n\n*   $($`aabb`$)$\n*   $($`a`$,$`abb`$)$\n*   $($`aab`$,$`b`$)$\n*   $($`a`$,$`ab`$,$`b`$)$\n*   $($`a`$,$`a`$,$`b`$,$`b`$)$\n\nAmong the good representations of $w$, the ones with the smallest number of elements are called the _best representations_ of $w$. For example, there are only one best representation of $w=$`aabb`: $($`aabb`$)$.\nYou are given a string $w$. Find the following:\n\n*   the number of elements of a best representation of $w$\n*   the number of the best representations of $w$, modulo $1000000007 \\, (=10^9+7)$\n\n(It is guaranteed that a good representation of $w$ always exists.)\n\n## Constraints\n\n*   $1 \\leq |w| \\leq 500000 \\, (=5 \\times 10^5)$\n*   $w$ consists of lowercase letters (`a`\\-`z`).\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$w$\n\n## Partial Score\n\n*   $400$ points will be awarded for passing the test set satisfying $1 \\leq |w| \\leq 4000$.\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc060_d","tags":[],"sample_group":[["aab","1\n1"],["bcbc","2\n3\n\n*   In this case, there are $3$ best representations of $2$ elements:\n    *   $($`b`$,$`cbc`$)$\n    *   $($`bc`$,$`bc`$)$\n    *   $($`bcb`$,$`c`$)$"],["ddd","3\n1"]],"created_at":"2026-03-03 11:01:14"}}