#P2562. [AHOI2002] Kitty猫基因编码

    ID: 3372 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 显示难度普及− 上传者: 标签>字符串2002各省省选递归安徽

[AHOI2002] Kitty猫基因编码

Problem Description

Xiao Keke took an elective course in basic genetics. The professor told the class that on the planet Super Samuel, the lengths of Kitty cats’ genes are all positive integer powers of 22, and they consist of two different gene units. These two different gene units are denoted as 0 and 1, so a Kitty cat’s gene can be written as a 01 string.

To facilitate analysis and reduce storage, the professor invented the ABC encoding rule. This encoding repeatedly rewrites the Kitty cat gene’s 01 string according to

until it is finally rewritten into a string containing only the characters "A", "B", and "C".

Please write a program to help Xiao Keke compute the ABC encoding of a Kitty cat gene to assist the professor’s research.

Input Format

The file contains one line, which is a 01 string representing a Kitty cat gene.

Output Format

Output one line containing the ABC encoding of this Kitty cat gene.

00
A
01001011
CCCABACCBAB

Hint

The given 01 string length satisfies Len256Len \leq 256.

Translated by ChatGPT 5