#909
Bronze II
PTICE
시간 제한
1s
메모리 제한
32MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

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 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.

입력

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.

출력

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.

예제 입력 1

5
BAACC

예제 출력 1

3
Bruno

예제 입력 2

9
AAAABBBBB

예제 출력 2

4
Adrian
Bruno
Goran
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Bronze II1명 투표· 약 1개월 전
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.