# Arup Guha
# 12/11/2024
# Solution to UCF HS Online Div 2 Problem: DNA Sequences

# Gets base 4 equivalent value of first 8 letters of mydna
# mydna must be lower case with a,c,g,t only and 8 or more characters long.
def getval(mydna):
    res = 0
    for i in range(8):
        res = 4*res + mymap[mydna[i]]
    return res

# Returns the 8 letter code corresponding to this base 4 value
def getdna(num):

    # Will help us.
    code = "ACGT"

    # Store answer here.
    res = ""

    # Peel off base 4 values and convert to letters.
    for i in range(8):
        res = code[num%4] + res
        num = num//4

    return res
    

# Get input.
toks = input().split()
n = int(toks[0])
k = int(toks[1])

# Helps me view input strings in base 4.
mymap = {}
mymap['A'] = 0
mymap['C'] = 1
mymap['G'] = 2
mymap['T'] = 3

# Frequency array for first 8 letters.
freq = []
for i in range(1<<16):
    freq.append(0)

# Read through items.
for i in range(n):

    # Update frequency array stating that we have a string with one of the starting codes.
    s = input().strip()
    freq[getval(s)]+= 1

# Now find a code we don't have. There's guaranteed to be a bunch since 50,000 < 65536 (4 to the 8)
mycode = -1
for i in range(1<<16):
    if freq[i] == 0:
        mycode = i
        break

# Gotta love string multiplication in Python!
print(getdna(mycode) + (k-8)*"A")




