from bisect import bisect_left n = int(input()) a = list(map(int, input().split())) l = sorted(a)[-500] p = [] for i, v in enumerate(a): if v > l and (not p or p[-1] < i-50): p.append(i) d = [p[i+1]-p[i] for i in range(len(p)-1)] m = len(d)//3 c = n/(sum(sorted(d)[m:2*m])/m) h = ["C4", "D4", "E4", "F4", "G4", "A4", "B4"] f = [261.6, 294.3, 327.0, 348.8, 392.4, 436.0, 490.5] i = bisect_left(f, c) if i > 5: i = 5 print(h[i] if abs(c-f[i]) < abs(c-f[i+1]) else h[i+1])