freq = [261.6, 294.3, 327.0, 348.8, 392.4, 436.0, 490.5] word = ["C4", "D4", "E4", "F4", "G4", "A4", "B4"] N = int(input()) x = list(map(int, input().split())) S = 10 ** 18 ans = -1 for i, f in enumerate(freq): d = round(N / f) s = sum([(x[i] - x[(i + d) % N]) ** 2 for i in range(N)]) if s < S: S = s ans = i print(word[ans])