#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

#define REP(i, init, n) for(int i = (int)(init); i < (int)(n); i++)
#define All(A) A.begin(), A.end()
#define rAll(A) A.rbegin(), A.rend()

#define vi vector<int>
#define vl vector<long>
#define vvi vector<vector<int>>
#define vvl vector<vector<long>>
#define pint pair<int, int>
#define plong pair<long, long>

int N;
vi A;

void solve() {
    vector<pair<string, long double>> freqs = {
        {"C4", 261.6}, 
        {"D4", 294.3},
        {"E4", 327.0},
        {"F4", 348.8},
        {"G4", 392.4},
        {"A4", 436.0},
        {"B4", 490.5}
    };
    string ans = "";
    long min_error = LONG_MAX;
    for(pair<string, long double> freq: freqs) {
        long error_sum = 0.0;
        int shift = 44100 / freq.second;
        REP(i, 0, 44100) {
            if(i - shift <= 0) continue;
            error_sum += abs(A[i] - A[i - shift]);
        }
        if(min_error > error_sum) {
            ans = freq.first;
        }
        // cout << error_sum << endl;
    }
    cout << ans << endl;
}

int main() {
    cin >> N;
    A.resize(N);
    REP(i, 0, N) {
        cin >> A[i];
    }
    solve();
}