import sys from sys import stdin import math N = int(stdin.readline()) A = list(map(int,stdin.readline().split())) DF = [294.3, 327.0, 348.8, 392.4, 436.0, 490.5] DN = ["C4", "D4", "E4", "F4", "G4", "A4", "B4"] S = [] for freq in DF: ONE = N / freq now = 0 for i in range(1,N+1): TIME = i/N if TIME > ONE*50: now /= i-1 break if (TIME // ONE) % 2 == 0: now += A[i-1] else: now -= A[i-1] S.append( abs(now) ) MI = min(S) for i in range(6): if S[i] == MI: print (DN[i]) break