n = int(input())
k = {}
k['AC\r'] =0
k["TLE\r"]=0
k["WA\r"]=0
k["RE\r"]=0
for i in range(n):
    a = str(input())
    #print(a)
    if a in k:
        k[a]+=1
print("AC x {}".format(k['AC\r']))
print("WA x {}".format(k['WA\r']))
print("TLE x {}".format(k['TLE\r']))
print("RE x {}".format(k['RE\r']))