{"trustable":false,"sections":[{"title":"","value":{"format":"MD","content":"You are given a string s consisting only of upper case letters **A** and **B**. For an integer $k$, a pair of indices $i$ and $j$ $(1 ≤ i \u003c j ≤ n)$ is called a $k$-inversion if and only if $s[i] \u003d$ **B**, $s[j] \u003d$ **A** and $j − i \u003d k$.\n\nConsider the string **BABA**. It has two 1-inversions and one 3-inversion. It has no 2-inversions.\n\n\nFor each $k$ between $1$ and $n - 1$ (inclusive), print the number of $k$-inversions in the string $s$.\n"}},{"title":"Input","value":{"format":"MD","content":"Each input will consist of a single test case. Note that your program may be run multiple times on different inputs. The input will consist of a single line with a string s, which consists of only upper case **A**s and **B**s. The string s will be between 1 and 1,000,000 characters long. There will be no spaces."}},{"title":"Output","value":{"format":"MD","content":"Output $n − 1$ lines, each with a single integer. The first line’s integer should be the number of $1$-inversions, the second should be the number of $2$-inversions, and so on.\n"}},{"title":"","value":{"format":"MD","content":"\u003ctable class\u003d\"vjudge_sample\"\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\u003eBABA\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n0\n1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n \n\u003ctable class\u003d\"vjudge_sample\"\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\u003eBBBBBAAAAA\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n2\n3\n4\n5\n4\n3\n2\n1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n "}}]}