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.
n = int(input())
s = [input() for i in range(n)]

c_AC = 0
c_WA = 0
c_TLE = 0
c_RE = 0

for i in s:
  if i == 'AC':
    c_AC += 1
  elif i == 'WA':
    c_WA += 1
  elif i == 'TLE':
    c_TLE += 1
  else:
    c_RE += 1
    
print("AC "+"× "+str(c_AC))
print("WA "+"× "+str(c_WA))
print("TLE "+"× "+str(c_TLE))
print("RE "+"× "+str(c_RE))
n = int(input())
ans_ac = 0
ans_wa = 0
ans_tle = 0
ans_re = 0

for i in range(n):
    s = input()
    if s == 'AC':
        ans_ac += 1
    elif s == 'WA':
        ans_wa += 1
    elif s == 'TLE':
        ans_tle += 1
    else:
        ans_re += 1
        
print('AC x '+str(ans_ac))
print('WA x '+str(ans_wa))
print('TLE x '+str(ans_tle))
print('RE x '+str(ans_re))