{"raw_statement":[{"iden":"problem statement","content":"You are given a string $S$ of length $3N$, containing exactly $N$ letters `A`, $N$ letters `B`, and $N$ letters `C`.\nLet's call a string $T$ consisting of letters `A`, `B`, and `C` **good**, if the following conditions hold:\n\n*   The length of $T$ is divisible by $3$. Let's denote it by $3K$.\n*   $T_1 = T_2 = \\ldots = T_K$\n*   $T_{K+1} = T_{K+2} = \\ldots = T_{2K}$\n*   $T_{2K+1} = T_{2K+2} = \\ldots = T_{3K}$.\n*   Letters $T_1, T_{K+1}$ and $T_{2K+1}$ are different from each other.\n\nExamples of good strings are `ABC`, `BBAACC`, and `AAACCCBBB`.\nFind a way to split $S$ into **at most $6$** (not necessarily contiguous) subsequences so that the letters from each subsequence form a good string.\nIt can be proved that, under the constraints of the problem, it's always possible."},{"iden":"constraints","content":"*   $1 \\le N \\le 2\\cdot 10^5$\n*   The string $S$ contains $N$ letters `A`, $N$ letters `B`, and $N$ letters `C`."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$S$"},{"iden":"sample input 1","content":"2\nABCCBA"},{"iden":"sample output 1","content":"111222\n\n$S$ is split into subsequences `ABC` and `CBA`, and each of them is a good string."},{"iden":"sample input 2","content":"4\nAABCBCAACBCB"},{"iden":"sample output 2","content":"111211241244\n\nPositions of $1$ form a subsequence `AABBCC`, positions of $2$ form a subsequence `CAB`, and positions of $4$ form a subsequence `ACB`. All of these strings are good."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}