# 35913
f = open('D:/35913.txt','r')
s = f.readlines()
a = [0] * 26
min = 100000000
maxi = 0
for i in range(len(s)):
    str = s[i]
    if str.count('N') < min:
        min = str.count('N')
        s1 = str
for i in range(len(s1) - 1):
    a[ord(s1[i]) - 65] += 1
for i in range(26):
    if a[i] >= maxi:
        maxi = a[i]
        index = i
print(chr(index + 65))