N = int(input()) A = list(map(int,input().split())) dat = ["C4","D4","E4","F4","G4","A4","B4"] l = [261.6, 294.3, 327.0, 348.8, 392.4, 436.0, 490.5] _min = 10 ** 18 ans = "" for i in range(len(dat)): h = l[i] delta = int(N / h) tmp = 0 for i in range(80): tmp += abs(A[i] - A[i + delta]) if tmp < _min: _min = tmp ans = dat[i] print(ans)