tr=int(input())
word=input()
a=0
w=0
t=0
r=0
i=0
for i in range(1<=tr<=10*5):
    i+=1
    if word=='AC':
        a+=1
    elif word=='WA':
        w+=1
    elif word=='TLE':
        t+=1
    else:
        r+=1
print('AC*a')
print('WA*w')
print('TLE*t')
print('RE*r')