Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.  The problem has N test cases.  For each test case i (1\leq i \leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is `AC`, `WA`, `TLE`, and `RE`, respectively.  See the Output section for the output format.
a = int(input())
s = []
for i in range(0,a) :
    d = input()
    s.append(d)
    

c1 = 0
c2 = 0
c3 = 0
c4 = 0

for i in range(0,len(s)) :
    if s[i] == "AC" :
        c1 += 1
    elif s[i] == "WA" :
        c2 += 1
    elif s[i] == "TLE" :
        c3 += 1
    elif s[i] == "RE" :
        c4 += 1
print("AC *",str(c1))
print("WA *",str(c2))
print("TLE *",str(c3))
print("RE *",str(c4))
a = int(input())
s = []
for i in range(0,a) :
    d = input()
    s.append(d)
    

c1 = 0
c2 = 0
c3 = 0
c4 = 0

for i in range(0,len(s)) :
    if s[i] == "AC" :
        c1 += 1
    elif s[i] == "WA" :
        c2 += 1
    elif s[i] == "TLE" :
        c3 += 1
    elif s[i] == "RE" :
        c4 += 1
print("AC x",str(c1))
print("WA x",str(c2))
print("TLE x",str(c3))
print("RE x",str(c4))