output_description: Print one longest subsequence that satisfies the conditions. If multiple
  solutions exist, any of them will be accepted.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      S
attempt: s = []
  print(s)
  
problem_description: Statement
  
  Given is a string S consisting of `A`,`B`, and `C`.
  
  Consider the (not necessarily contiguous) subsequences x of S that satisfy all
  of the following conditions:
  
    * `A`, `B`, and `C` all occur the same number of times in x.
    * No two adjacent characters in x are the same.
  
  Among these subsequences, find one of the longest. Here a subsequence of S is
  a string obtained by deleting zero or more characters from S.
samples: [{"input": "ABBCBCAB", "output": "ACBCAB\n    \n\nConsider the subsequence `ACBCAB` of S. It satisfies the conditions and is one\nof the longest with these properties, along with `ABCBCA`. On the other hand,\nthe subsequences `ABCBCAB` and `ABBCCA` do not satisfy the conditions.\n\n* * *"}, {"input": "ABABABABACACACAC", "output": "BABCAC\n    \n\n* * *"}, {"input": "ABCABACBCBABABACBCBCBCBCBCAB", "output": "ACABACABABACBCBCBCBCA\n    \n\n* * *"}, {"input": "AAA", "output": "It is possible that only the empty string satisfies the condition."}]