n = int(input()) a = list(map(int, input().split())) height = ["C4", "D4", "E4", "F4", "G4", "A4", "B4"] freq = [261.6, 294.3, 327.0, 348.8, 392.4, 436.0, 490.5] period = [int(n/v) for v in freq] diff = [0]*7 for i, v in enumerate(period): for j in range(n//v-1): diff[i] += abs(a[v*j]-a[v*(j+1)]) print(height[diff.index(min(diff))])