def main(n,si):
    results = ['AC','WA','TLE','RE']
    res_num =[0,0,0,0]

    for index in range(0,n):
        if (si[0:2]==results[0]):
            res_num[0] += 1
            si=si.replace(results[0],'',1)
            print(si)
        if (si[0:2] ==results[1]):
            res_num[1] += 1
            si=si.replace(results[1],'',1)
            print(si)
        if (si[0:3] ==results[2]):
            res_num[2] += 1
            si=si.replace(results[2],'',1)
            print(si)
        if (si[0:2] ==results[3]):
            res_num[3] += 1
            si=si.replace(results[3],'',1)
            print(si)
    print(res_num)