// 6/17/2026
// Solution to Kattis Problem: Ptice
// https://open.kattis.com/problems/ptice

using namespace std;
#include <bits/stdc++.h>

int main() {

    // Get data, use a string for the middle item.
    int n;
    string s;
    cin >> n >> s;

    // Just store one copy...
    string adrian = "ABC";
    string bruno = "BABC";
    string goran = "CCAABB";

    // Counters to see who has the most.
    int nA = 0, nB = 0, nG = 0;

    // Update each counter for each letter.
    for (int i=0; i<n; i++) {
        if (s[i] == adrian[i%adrian.size()]) nA++;
        if (s[i] == bruno[i%bruno.size()]) nB++;
        if (s[i] == goran[i%goran.size()]) nG++;
    }

    // Get the answer.
    int res = max(max(nA, nB), nG);

    // This is the answer.
    cout << res << endl;
    if (nA == res) cout << "Adrian" << endl;
    if (nB == res) cout << "Bruno" << endl;
    if (nG == res) cout << "Goran"  << endl;

    return 0;
}
