Three employees work at a company. Their names are Kangho (A), Jungyu (B), and Subin (C).
Exactly one employee comes to work each day. A three day record of "AAC" means A worked on the first two days and C worked on the third day.
A can work every day. B must rest on the day after working. C must rest on the next two days after working. So not every record is valid. For example, "BB" never appears, because it puts B at work on two days in a row.
You are given an attendance record S. Rearrange the letters of S and print the valid record that comes first in lexicographic order, comparing letters as A<B<C.