import sys # sys.setrecursionlimit(10 ** 9) # Codeforcesでは350000程度に def input(): return sys.stdin.readline().strip() n = int(input()) A = list(map(int, input().split())) # f0 = open("1905_sample/01_sample_03.in", "r") # n = int(f0.readline()) # A = list(map(int, f0.readline().split())) B = [261.6, 294.3, 327.0, 348.8, 392.4, 436.0, 490.5] ANS = ["C4", "D4", "E4", "F4", "G4", "A4", "B4"] C = [0] * len(B) for i in range(len(B)): rb = n // round(B[i]) for k in range(200): A0 = A[k : rb + k] A1 = A[rb + k : rb * 2 + k] r = 0 for j in range(rb): r += abs(A0[j] - A1[j]) r //= rb C[i] += r # print(C) ind = C.index(min(C)) print(ANS[ind])