n = int(input()) A = list(map(int, input().split())) lst = [261.6, 294.3, 327.0, 348.8, 392.4, 436.0, 490.5] mi = float("inf") ans = -1 for l in lst: tmp = [] x = 44100 / l for i, a in enumerate(A): tmp.append((i % x, a)) tmp.sort() ma = -1 << 30 for i in range(44099): ma = max(ma, abs(tmp[i + 1][1] - tmp[i][1])) if ma < mi: mi = ma ans = l print(["C4", "D4", "E4", "F4", "G4", "A4", "B4"][lst.index(ans)])