import numpy as np
if __name__ == "__main__":
    N=input()
    N=int(N)
    strs=["AC","WA","TLE","RE"]
    cnt=np.zeros(4,dtype=np.uint8)
    for i in range(N):
        b=input()
        for j,s in enumerate(strs):
            if s==b:
                cnt[j]+=1
    for i,s in enumerate(strs):
        print(s+" x "+str(cnt[i]))