COCI 2008/2009, Contest #1

Task PTICE

Adrian, Bruno and Goran wanted to join the bird lovers' club. However, they did not know that all applicants must pass an entrance exam. The exam consists of N questions, each with three possible answers: A, B and C.

Unfortunately, they couldn't tell a bird from a whale (they are only interested in the cute girls in the club) so they are trying to guess the correct answers. Each of the three boys has a theory of what set of answers will work best:

Adrian claims that the best sequence is: A, B, C, A, B, C, A, B, C, A, B, C ...
Bruno is convinced that this is better: B, A, B, C, B, A, B, C, B, A, B, C ...
Goran laughs at them and will use this sequence: C, C, A, A, B, B, C, C, A, A, B, B ...

Write a program that, given the correct answers to the exam, determines who of the three was right — whose sequence contains the most correct answers.

Input

The first line contains an integer N (1 ≤ N ≤ 100), the number of questions on the exam.
The second line contains a string of N letters 'A', 'B' and 'C'. These are, in order, the correct answers to the questions in the exam.

Output

On the first line, output M, the largest number of correct answers one of the three boys gets.
After that, output the names of the boys (in alphabetical order) whose sequences result in M correct answers.

Examples

Input

5
BAACC

Output

3
Bruno

Input

9
AAAABBBBB

Output

4
Adrian
Bruno
Goran

All Submissions
Best Solutions


Point Value: 5
Time Limit: 1.00s
Memory Limit: 32M
Added: Oct 18, 2008

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

It's quiet in here...