Files
kattis/ptice.py
2023-07-18 21:51:43 +02:00

24 lines
554 B
Python

ADRIAN = "ABC" * 34
BRUNO = "BABC" * 25
GORAN = "CCAABB" * 17
n = int(input())
answers = input()
adrian_score = bruno_score = goran_score = 0
for i in range(n):
if answers[i] == ADRIAN[i]:
adrian_score += 1
if answers[i] == BRUNO[i]:
bruno_score += 1
if answers[i] == GORAN[i]:
goran_score += 1
max_score = max((adrian_score, bruno_score, goran_score))
print(max_score)
if adrian_score == max_score:
print("Adrian")
if bruno_score == max_score:
print("Bruno")
if goran_score == max_score:
print("Goran")