Problem:
 Score : 200 points    Problem Statement 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.      Constraints  1 \leq N \leq 10^5  S_i is AC , WA , TLE , or RE .         Input Input is given from Standard Input in the following format:  N  S_1  \vdots  S_N       Output Let C_0 , C_1 , C_2 , and C_3 be the numbers of test cases for which the verdict is AC , WA , TLE , and RE , respectively. Print the following:  AC x C_0 WA x C_1 TLE x C_2 RE x C_3         Sample Input 1 6
AC
TLE
AC
AC
WA
TLE      Sample Output 1 AC x 3
WA x 1
TLE x 2
RE x 0  We have 3 , 1 , 2 , and 0 test case(s) for which the verdict is AC , WA , TLE , and RE , respectively.       Sample Input 2 10
AC
AC
AC
AC
AC
AC
AC
AC
AC
AC      Sample Output 2 AC x 10
WA x 0
TLE x 0
RE x 0

Solution (Python):
import sys
def input():
    return sys.stdin.readline()[:-1]

import collections
def main():
    N = int(input())
    s = [input() for i in range(N)]
    c = collections.Counter(s)
    print('AC x ' + str(c['AC']))
    print('WA x ' + str(c['WA']))
    print('TLE x ' + str(c['TLE']))
    print('RE x ' + str(c['RE']))

    
if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())

dic={}
for item in ["AC","WA","TLE","RE"]:
    dic[item]=0

for _ in range(n):
    s=input()
    dic[s]+=1

for item in ["AC","WA","TLE","RE"]:
    print(item+" x "+str(dic[item]))

Solution (Python):
N = int(input())
AC = 0
WA = 0
TLE = 0
RE = 0

for i in range(N):
  s = input()
  if s == "AC":
    AC += 1
  elif s == "WA":
    WA += 1
  elif s == "TLE":
    TLE +=1
  else:
    RE += 1
    
print("AC x " + str(AC))
print("WA x " + str(WA))
print("TLE x " + str(TLE))
print("RE x " + str(RE))

Solution (Python):
n=int(input())
S=[0,0,0,0]
for i in range(n):
    now=str(input())
    if now=='AC':
        S[0]+=1
    elif now=='WA':
        S[1]+=1
    elif now=='TLE':
        S[2]+=1
    else:
        S[3]+=1
    
print('AC x {0}'.format(S[0]))
print('WA x {0}'.format(S[1]))
print('TLE x {0}'.format(S[2]))
print('RE x {0}'.format(S[3]))

Solution (Python):
N = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in range(N):
  A = input()
  if A == 'AC':
    ac += 1
  elif A == 'WA':
    wa += 1
  elif A == 'TLE':
    tle += 1
  else:
    re += 1
    
print('AC', 'x', ac)
print('WA', 'x', wa)
print('TLE', 'x', tle)
print('RE', 'x', re)

Solution (Python):
from collections import Counter

N = int(input())
S = []
for _ in range(N):
    S.append(input())

cnt = Counter(S)

print("AC x " + str(cnt["AC"]))
print("WA x " + str(cnt["WA"]))
print("TLE x " + str(cnt["TLE"]))
print("RE x " + str(cnt["RE"]))

Solution (Python):
a = int(input())
x = []
for i in range(a):
    x.append(input())
print("AC x " + str(x.count("AC")))
print("WA x " + str(x.count("WA")))
print("TLE x " + str(x.count("TLE")))
print("RE x " + str(x.count("RE")))

Solution (Python):
N=int(input())
S=[input() for i in range(N)]
AC=0
WA=0
TLE=0
RE=0
for i in S:
    if i =="WA":
        WA+=1
    elif i=="AC":
        AC+=1
    elif i=="TLE":
        TLE+=1
    else:
        RE+=1
print("AC x",str(AC))
print("WA x",str(WA))
print("TLE x",TLE)
print("RE x",RE)

Solution (Python):
n = int(input())
res=[0]*4
for _ in range(n):
    s = input()
    if s == "AC":
        res[0]+=1
    elif s == "WA":
        res[1]+=1
    elif s == "TLE":
        res[2]+=1
    else:
        res[3]+=1
print("AC x "+str(res[0]))
print("WA x "+str(res[1]))
print("TLE x "+str(res[2]))
print("RE x "+str(res[3]))

Solution (Python):
import itertools
N = int(input())
counter = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
for i in range(N):
    s = input()
    counter[s] += 1
for x in ['AC', 'WA', 'TLE', 'RE']:
    print('{} x {}'.format(x, counter[x]))

Solution (Python):
n = int(input())




ac=wa=tle=re=0

for i in range(n):
    a = input()
    if(a=='AC'):
        ac +=1
    elif(a=='WA'):
        wa += 1
    elif(a=='TLE'):
        tle +=1
    elif(a=='RE'):
        re+=1
print("AC x",ac)
print("WA x",wa)
print("TLE x",tle)
print("RE x",re)

Solution (Python):
from collections import Counter

N = int(input())
s = [input() for _ in range(N)]
c = Counter(s)
print('AC x {}'.format(c['AC']))
print('WA x {}'.format(c['WA']))
print('TLE x {}'.format(c['TLE']))
print('RE x {}'.format(c['RE']))

Solution (Python):
from collections import defaultdict

n = int(input())
d = defaultdict(int)
for _ in range(n):
    s = input()
    d[s] += 1
print('AC x '+str(d["AC"]))
print('WA x '+str(d["WA"]))
print('TLE x '+str(d["TLE"]))
print('RE x '+str(d["RE"]))

Solution (Python):
N = int(input())
D = [input() for j in range(N)]
a = D.count("AC")
w = D.count("WA")
t = D.count("TLE")
r = D.count("RE")
print("AC x "+str(a))
print("WA x "+str(w))
print("TLE x "+str(t))
print("RE x "+str(r))

Solution (Python):
from collections import Counter

n = int(input())
s = [input() for _ in range(n)]

c = Counter(s)

print('AC x ', c['AC'])
print('WA x ', c['WA'])
print('TLE x ', c['TLE'])
print('RE x ', c['RE'])

Solution (Python):
from collections import OrderedDict


def main():
    n = int(input())
    ans_dict = OrderedDict({
        'AC': 0,
        'WA': 0,
        'TLE': 0,
        'RE': 0,
    })
    for idx in range(n):
        s = input().strip('\n')
        ans_dict[s] += 1

    for k, v in ans_dict.items():
        print(f'{k} x {v}')


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
S = [input() for i in range(n)]
print("AC x "+str(S.count("AC")))
print("WA x "+str(S.count("WA")))
print("TLE x "+str(S.count("TLE")))
print("RE x "+str(S.count("RE")))

Solution (Python):
n = int(input())
cnt = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}
for _ in range(n):
    s = input()
    cnt[s] += 1
for s in cnt.keys():
    print(f"{s} x {cnt[s]}")

Solution (Python):
ans = {"AC":0, "WA":0, "TLE":0, "RE":0}

N = int(input())
for i in range(N):
    ans[input().strip()] += 1

for i in ["AC", "WA", "TLE", "RE"]:
    print("{} x {}".format(i, ans[i]))

Solution (Python):
N = int(input())

ans_dict = {
  "AC":0,
  "WA":0,
  "TLE":0,
  "RE":0
}

for i in range(N):
  S = str(input())
  ans_dict[S] = ans_dict.get(S,0) + 1

for key in ans_dict.keys():
  print("{} x {}".format(key,ans_dict[key]))

Solution (Python):
from collections import defaultdict as dd

n = int(input())
S = dd(int)
for i in range(n):
    S[input()] += 1

print("AC x", S["AC"])
print("WA x", S["WA"])
print("TLE x", S["TLE"])
print("RE x", S["RE"])

Solution (Python):
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate, product, combinations_with_replacement
import sys
import bisect
import string
import math
import time


def I(): return int(input())
def S(): return input()
def MI(): return map(int, input().split())
def MS(): return map(str, input().split())
def LI(): return [int(i) for i in input().split()]
def LI_(): return [int(i)-1 for i in input().split()]
def StoI(): return [ord(i)-97 for i in input()]
def ItoS(nn): return chr(nn+97)
def input(): return sys.stdin.readline().rstrip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def print_matrix(mat):
    for i in range(len(mat)):
        print(*['IINF' if v == IINF else "{:0=4}".format(v) for v in mat[i]])


yn = {False: 'No', True: 'Yes'}
YN = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**19
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
show_flg = False



def main():
    N = I()
    a = ['AC', 'WA', 'TLE', 'RE']
    cnt = defaultdict(int)

    for i in range(N):
        s = S()
        cnt[s] += 1

    for s in a:
        print("{} x {}".format(s, cnt[s]))


if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
s=[0 for i in range(4)]

for i in range(n):
    ss=input()
    if("AC"==ss):s[0]+=1
    if("WA"==ss):s[1]+=1
    if("TLE"==ss):s[2]+=1
    if("RE"==ss):s[3]+=1

print("AC","x",s[0])
print("WA","x",s[1])
print("TLE","x",s[2])
print("RE","x",s[3])

Solution (Python):
def main():
    n = int(input())
    res = {
        'AC': 0,
        'WA': 0,
        'TLE': 0,
        'RE': 0,
    }
    for _ in range(n):
        res[input()] += 1
    for k,v in res.items():
        print('{} x {}'.format(k, v))

main()

Solution (Python):
N=int(input())
cAC=0
cWA=0
cTLE=0
cRE=0
for i in range(N):
    X=input()
    if X=="AC":
        cAC+=1
    elif X=="WA":
        cWA+=1
    elif X=="TLE":
        cTLE+=1
    else:
        cRE+=1

print("AC x "+str(cAC))
print("WA x "+str(cWA))
print("TLE x "+str(cTLE))
print("RE x "+str(cRE))

Solution (Python):




import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7
n=I()
lis=[SI() for i in range(n)]
c=Counter(lis)
print("AC x",end=" ")
print(c["AC"])
print("WA x",end=" ")
print(c["WA"])
print("TLE x",end=" ")
print(c["TLE"])
print("RE x",end=" ")
print(c["RE"])

Solution (Python):
from math import gcd, sqrt, pi, floor, ceil
from collections import defaultdict as d
from itertools import combinations as c
from string import ascii_lowercase as a

n = int(input())
dd = d(int)
for i in range(n):
	e = input()
	dd[e] += 1
print('AC x', dd['AC'])
print('WA x', dd['WA'])
print('TLE x', dd['TLE'])
print('RE x', dd['RE'])

Solution (Python):
n=int(input())
s=[input() for _ in range(n)]
c0=0
c1=0
c2=0
c3=0
for i in s:
  if i=="AC":
    c0+=1
  elif i=="WA":
    c1+=1
  elif i=="TLE":
    c2+=1
  elif i=="RE":
    c3+=1
print("AC"+" "+"x"+" "+str(c0))
print("WA"+" "+"x"+" "+str(c1))
print("TLE"+" "+"x"+" "+str(c2))
print("RE"+" "+"x"+" "+str(c3))

Solution (Python):
N= int(input())
S=[]
ac,tle,wa,re=0,0,0,0
for i in range(N):
    inp=input()
    if inp=="AC":
        ac+=1
    elif inp=="TLE":
        tle+=1
    elif inp=="WA":
        wa+=1
    elif inp=="RE":
        re+=1

print("AC x "+str(ac))
print("WA x "+str(wa))
print("TLE x "+str(tle))
print("RE x "+str(re))

Solution (Python):
import sys, io, os, re
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from pprint import pprint
from math import sin, cos, pi, radians, sqrt, floor, ceil
from copy import copy, deepcopy
from collections import deque
from fractions import gcd
from functools import reduce
from itertools import groupby
from heapq import heapify, heappush, heappop



n1 = lambda: int(sys.stdin.readline().strip())
nn = lambda: list(map(int, sys.stdin.readline().strip().split()))
f1 = lambda: float(sys.stdin.readline().strip())
fn = lambda: list(map(float, sys.stdin.readline().strip().split()))
s1 = lambda: sys.stdin.readline().strip()
sn = lambda: list(sys.stdin.readline().strip().split())
nl = lambda n: [n1() for _ in range(n)]
fl = lambda n: [f1() for _ in range(n)]
sl = lambda n: [s1() for _ in range(n)]
nm = lambda n: [nn() for _ in range(n)]
fm = lambda n: [fn() for _ in range(n)]
sm = lambda n: [sn() for _ in range(n)]

def array1(n, d=0): return [d] * n
def array2(n, m, d=0): return [[d] * m for x in range(n)]
def array3(n, m, l, d=0): return [[[d] * l for y in xrange(m)] for x in xrange(n)]
def linc(A, d=1): return map(lambda x: x + d, A)
def ldec(A, d=1): return map(lambda x: x - d, A)

N = n1()
S = sl(N)

C = array1(4)

for s in S:
    if s == "AC": C[0] += 1
    if s == "WA": C[1] += 1
    if s == "TLE": C[2] += 1
    if s == "RE": C[3] += 1

print("AC x {}".format(C[0]))
print("WA x {}".format(C[1]))
print("TLE x {}".format(C[2]))
print("RE x {}".format(C[3]))

Solution (Python):
N = int(input())

A = 0
W = 0
T = 0
R = 0

for i in range(N):
    S = input()
    if S == "AC":
        A+=1
    elif S == "WA":
        W+=1
    elif S == "TLE":
        T+=1
    elif S == "RE":
        R+=1

print("AC x " + str(A))
print("WA x " + str(W))
print("TLE x " + str(T))
print("RE x " + str(R))

Solution (Python):
n = int(input())
AC = 0
WA = 0
TLE = 0
RE = 0
for _ in range(n):
    i = input()
    if i == 'AC':
        AC += 1
    elif i == 'WA':
        WA += 1
    elif i == 'TLE':
        TLE += 1
    else:
        RE += 1
print('AC x ' + str(AC))
print('WA x ' + str(WA))
print('TLE x ' + str(TLE))
print('RE x ' + str(RE))

Solution (Python):
N=int(input())
a=0
b=0
c=0
d=0
for _ in range(N):
    S=input()
    if S=='AC':
        a+=1
    elif S=='WA':
        b+=1
    elif S=='TLE':
        c+=1
    else:
        d+=1
print('AC x '+str(a))
print('WA x '+str(b))
print('TLE x '+str(c))
print('RE x '+str(d))

Solution (Python):
def resolve():
    '''
    code here
    '''
    import collections
    N = int(input())
    S = [input() for _ in range(N)]
    dict1 = collections.Counter(S)

    print('AC x', dict1['AC'])
    print('WA x', dict1['WA'])
    print('TLE x', dict1['TLE'])
    print('RE x', dict1['RE'])

if __name__ == "__main__":
    resolve()

Solution (Python):
N = int(input())
ac, wa, tle, re = 0, 0, 0, 0

for i in range(N):
    s = input()
    if s == "AC":
        ac += 1
    elif s == "WA":
        wa += 1
    elif s == "TLE":
        tle += 1
    elif s == "RE":
        re += 1

print("AC x "+str(ac))
print("WA x "+str(wa))
print("TLE x "+str(tle))
print("RE x "+str(re))

Solution (Python):
N=int(input())
a,b,c,d=0,0,0,0
for i in range(N):
  s=input()
  if s=='AC': a+=1
  elif s=='WA': b+=1
  elif s=='TLE': c+=1
  elif s=='RE': d+=1
  pass
print('AC x {}'.format(a))
print('WA x {}'.format(b))
print('TLE x {}'.format(c))
print('RE x {}'.format(d))

Solution (Python):
def _run(n, ss):
    result = {}
    for s in ss:
        result.setdefault(s, []).append(1)
    for key in ["AC", "WA", "TLE", "RE"]:
        print("{} x {}".format(key, len(result.get(key, []))))


def _main():
    n = int(input())
    ss = [str(input()) for i in range(n)]

    _run(n, ss)


if __name__ == "__main__":
    _main()

Solution (Python):
n=int(input())
ac=0
wa=0
tle=0
re=0
for i in range(n):
    a=input()
    if a=='AC':
        ac+=1
    elif a=='WA':
        wa+=1
    elif a=='TLE':
        tle+=1
    else:
        re+=1
print('AC x '+str(ac))
print('WA x '+str(wa))
print('TLE x '+str(tle))
print('RE x '+str(re))

Solution (Python):
n = int(input())

s = [input() for i in range(n)]

d = {'AC':0,'WA':0,'TLE':0,'RE':0}

for i in s:
  d[i] += 1

for i in d:
  x = i + ' x ' + str(d[i])
  print (x)

Solution (Python):
N = int(input())

ans = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}
for _ in range(N):
    S = input()
    ans[S] += 1

for key, value in ans.items():
    print(key, "x", value)

Solution (Python):
n = int(input()) 
s = [input() for _ in range(n)]
tmp = ["AC", "WA", "TLE", "RE"]
count = [s.count(c) for c in tmp]

for i in range(len(tmp)):
    print("{0} x {1}".format(tmp[i], count[i]))

Solution (Python):
d={'AC':0,'WA':0,'TLE':0,'RE':0}
n=int(input())
for i in range(n):
  s=input()
  d[s]+=1
for i in list(d):
  print(i,'x',d[i])

Solution (Python):
def resolve():
    n = int(input())
    dict = {"AC":0, "WA": 0, "TLE":0, "RE":0}
    for i in range(n):
        s = input()
        dict[s] += 1
    print("AC x {}".format(dict["AC"]))
    print("WA x {}".format(dict["WA"]))
    print("TLE x {}".format(dict["TLE"]))
    print("RE x {}".format(dict["RE"]))

resolve()

Solution (Python):
n = int(input())
apple = []
for i in range(n):
    apple.append(str(input()))
print("AC x " + str(apple.count("AC")))
print("WA x " + str(apple.count("WA")))
print("TLE x " + str(apple.count("TLE")))
print("RE x " + str(apple.count("RE")))

Solution (Python):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0

N = k()
a = []
for i in range(N):
    x = input()
    a.append(x)
AC = 0
TLE = 0
WA = 0
RE = 0


y = []
for i in a:
    if i == "AC":
        AC += 1
    elif i == "WA":
        WA += 1
    elif i == "TLE":
        TLE += 1
    elif i == "RE":
        RE += 1

y.append(AC)
y.append(WA)
y.append(TLE)
y.append(RE)


z = ["AC","WA","TLE","RE"]

for i,j in zip(z,y):
    print("{} x {}".format(i,j))

Solution (Python):
n = int(input())
a = [input() for i in range(n)]

c0 = str(a.count("AC"))
c1 = str(a.count("WA"))
c2 = str(a.count("TLE"))
c3 = str(a.count("RE"))

print("AC x " + c0)
print("WA x " + c1)
print("TLE x " + c2)
print("RE x " + c3)

Solution (Python):
N = int(input())
Sli = {"AC":0,"WA":0,"TLE":0,"RE":0}

for i in range(N):
  S = input()
  Sli[S] += 1
  
print("AC x "+str(Sli["AC"]))
print("WA x "+str(Sli["WA"]))
print("TLE x "+str(Sli["TLE"]))
print("RE x "+str(Sli["RE"]))

Solution (Python):
import sys
def input():
    return sys.stdin.readline().rstrip('\n')
    

def calc(N, S):
    j = 'AC,WA,TLE,RE'.split(',')
    d = {key: 0 for key in j}
    for s in S:
        d[s] += 1
    return '\n'.join(["{0} x {1}".format(key, d[key]) for key in j])



N = int(input())
S = [input() for s in range(N)]
print(calc(N, S))

Solution (Python):
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from math import factorial, sqrt, ceil, gcd
from functools import lru_cache, reduce
from decimal import Decimal
INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def dijkstra_heap(s, edge, n):
    
    d = [10**20] * n
    used = [True] * n 
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


def lcm(x, y):
    return (x * y) // gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm, numbers, 1)


def gcd_list(numbers):
    return reduce(gcd, numbers)


def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True



def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P


def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret



n = int(input())
ac = 0
wa = 0
tle = 0
re = 0
s = ["" for i in range(n)]
for i in range(n):
    s[i] = input()
for i in range(n):
    if s[i] == "AC":
        ac += 1
    elif s[i] == "WA":
        wa += 1
    elif s[i] == "TLE":
        tle += 1
    else:
        re += 1
print("AC x %d" % ac)
print("WA x %d" % wa)
print("TLE x %d" % tle)
print("RE x %d" % re)

Solution (Python):
n = int(input())
n_ac = 0
n_wa = 0
n_tle = 0
n_re = 0
for i in range(n):
    temp = input()
    if temp == "AC":
        n_ac += 1
    elif temp == "WA":
        n_wa += 1
    elif temp == "TLE":
        n_tle += 1
    else :
        n_re += 1
print("AC x "+str(n_ac))
print("WA x "+str(n_wa))
print("TLE x "+str(n_tle))
print("RE x "+str(n_re))

Solution (Python):
N= int(input())
res = {}
res['AC'] = 0
res['WA'] = 0
res['TLE'] = 0
res['RE'] = 0
for i in range(N):
    S = input()
    res[S] += 1
print('AC x ' + str(res['AC']))
print('WA x ' + str(res['WA']))
print('TLE x ' + str(res['TLE']))
print('RE x ' + str(res['RE']))

Solution (Python):
from collections import defaultdict
N = int(input())
d = defaultdict(int)
for _ in range(N):
    s = str(input())
    d[s] += 1
print('AC x {}'.format(d['AC']))
print('WA x {}'.format(d['WA']))
print('TLE x {}'.format(d['TLE']))
print('RE x {}'.format(d['RE']))

Solution (Python):
n=int(input())
s=[input() for _ in range(n)]
a=["AC", "WA","TLE","RE"]

from collections import Counter
c=Counter(s)

for i in a:
    print(i,"x",c[i])

Solution (Python):
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for _ in range(n):
    s = input()
    if s == 'AC':
        ac+=1
    elif s == 'WA':
        wa+=1
    elif s=='TLE':
        tle +=1
    elif s=='RE':
        re += 1

print('AC x '+str(ac))
print('WA x '+str(wa))
print('TLE x '+str(tle))
print('RE x '+str(re))

Solution (Python):

n = int(input())
s = [input() for _ in range(n)]
ac = 0
wa = 0
tle = 0
re = 0

for i in s:
    if i == "AC":
        ac += 1
    if i == "WA":
        wa += 1
    if i == "TLE":
        tle += 1
    if i == "RE":
        re += 1

print('AC x' , ac)
print('WA x' , wa)
print('TLE x' , tle)
print('RE x' , re)

Solution (Python):


from collections import defaultdict
from heapq import heappush, heappop
import sys

sys.setrecursionlimit(10**6)
input = sys.stdin.buffer.readline
INF = 10 ** 9 + 1  


def debug(*x):
    print(*x, file=sys.stderr)


def solve(SOLVE_PARAMS):
    "void()"
    pass


def main():
    from collections import Counter
    N = int(input())
    XS = Counter([input().strip().decode("ascii") for i in range(N)])
    for key in "AC WA TLE RE".split():
        v = XS.get(key, 0)
        print(f"{key} x {v}")


T1 = """
6
AC
TLE
AC
AC
WA
TLE
"""


def test_T1():
    """
    >>> as_input(T1)
    >>> main()
    AC x 3
    WA x 1
    TLE x 2
    RE x 0

    """


def _test():
    import doctest
    doctest.testmod()


def as_input(s):
    "use in test, use given string as input file"
    import io
    global read, input
    f = io.StringIO(s.strip())

    def input():
        return bytes(f.readline(), "ascii")

    def read():
        return bytes(f.read(), "ascii")


USE_NUMBA = False
if (USE_NUMBA and sys.argv[-1] == 'ONLINE_JUDGE') or sys.argv[-1] == '-c':
    print("compiling")
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('solve', solve.__doc__.strip().split()[0])(solve)
    cc.compile()
    exit()
else:
    input = sys.stdin.buffer.readline
    read = sys.stdin.buffer.read

    if (USE_NUMBA and sys.argv[-1] != '-p') or sys.argv[-1] == "--numba":
        
        
        from my_module import solve  
    elif sys.argv[-1] == "-t":
        _test()
        sys.exit()
    elif sys.argv[-1] != '-p' and len(sys.argv) == 2:
        
        input_as_file = open(sys.argv[1])
        input = input_as_file.buffer.readline
        read = input_as_file.buffer.read

    main()

Solution (Python):
from collections import Counter

N = int(input())
S = [input() for i in range(N)]

C = Counter(S)

print('AC x',C['AC'])
print('WA x',C['WA'])
print('TLE x',C['TLE'])
print('RE x',C['RE'])

Solution (Python):
def solution(A):
	print('AC x ', A.count('AC'))
	print('WA x ', A.count('WA'))
	print('TLE x ', A.count('TLE'))
	print('RE x ', A.count('RE'))

if __name__ == "__main__":
	t = int(input())
	A = []
	for _ in range(t):
		A.append(input())
	solution(A)

Solution (Python):
n = int(input())
s = []
for i in range(n):
  s_ = input()
  s.append(s_)
  
res = ['AC', 'WA', 'TLE', 'RE']
for i in res:
  print(i,'x', s.count(i))

Solution (Python):
N = int(input())
dict = {}
dict['AC'] = 0
dict['WA'] = 0
dict['TLE'] = 0
dict['RE'] = 0

for i in range(N):
  s = input()
  dict[s] += 1
  
print('AC x',dict['AC'])
print('WA x',dict['WA'])
print('TLE x',dict['TLE'])
print('RE x',dict['RE'])

Solution (Python):
n = int(input())
l = [input() for _ in range(n)]

a = ["AC", "WA", "TLE", "RE"]
b = []

for s in a:
    b.append(l.count(s))

d = ["AC x ", "WA x ", "TLE x ", "RE x "]

for i, di in enumerate(d):
    print("{}{}".format(d[i], b[i]))

Solution (Python):
n=int(input())
a=0
b=0
c=0
d=0
for i in range(n):
    s=input()
    if s=='AC':
        a+=1
    elif s=='WA':
        b+=1
    elif s=='TLE':
        c+=1
    else:
        d+=1
print('AC x',a)
print('WA x',b)
print('TLE x',c)
print('RE x',d)

Solution (Python):
N = int(input())
d = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
for _ in range(N):
    S = input()
    d[S] += 1
print('AC x ' + str(d['AC']))
print('WA x ' + str(d['WA']))
print('TLE x ' + str(d['TLE']))
print('RE x ' + str(d['RE']))

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    res=[]
    ac=0
    wa=0
    tl=0
    re=0
    for i in range(n):
        s=STR()
        if s=='AC':
            ac+=1
        elif s=='WA':
            wa+=1
        elif s=='TLE':
            tl+=1
        else:
            re+=1
    print('AC x '+str(ac))
    print('WA x '+str(wa))
    print('TLE x '+str(tl))
    print('RE x '+str(re))
    
if __name__ == '__main__':
    do()

Solution (Python):
from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
S = Counter(S)
for key in ['AC', 'WA', 'TLE', 'RE']:
    if key not in S:
        print(f'{key} x 0')
    else:
        print(f'{key} x {S[key]}')

Solution (Python):
if __name__ == "__main__":
    N = int(input())
    num_dict = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}
    for i in range(N):
        num_dict[input()] += 1
    for k, v in num_dict.items():
        print(f'{k} x {v}')

Solution (Python):
from sys import stdin
from collections import Counter
N = int(stdin.readline().rstrip())
S = []
for i in range(N):
    s = (stdin.readline().rstrip())
    S.append(s)

c = Counter(S)
print("AC x " + str(c["AC"]))
print("WA x " + str(c["WA"]))
print("TLE x " + str(c["TLE"]))
print("RE x " + str(c["RE"]))

Solution (Python):
N = int(input())
S = [input() for i in range(N)]
ans = {'AC':0, 'WA': 0, 'TLE':0, 'RE': 0,}

for i in S:
    ans[i] += 1

for i, j in zip(ans.keys(), ans.values()):
    print(i + ' x ' + str(j))

Solution (Python):
n = int(input())
s = [input() for _ in range(n)]

import collections
cnt = collections.Counter(s)
for t in ['AC', 'WA', 'TLE', 'RE']:
    print(t, 'x', cnt[t])

Solution (Python):
N = int(input())
result = [0, 0, 0, 0]
for _ in range(N):
    S = input()
    if S == "AC":
        result[0] += 1
    elif S == "WA":
        result[1] += 1
    elif S == "TLE":
        result[2] += 1
    elif S == "RE":
        result[3] += 1
tag = ["AC", "WA", "TLE", "RE"]
for i in range(4):
    print("{0} x {1}".format(tag[i], result[i]))

Solution (Python):
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos,sin,tan,sqrt
import cmath as cma
import copy as cp
import sys
import re
import bisect as bs
sys.setrecursionlimit(10**7)
EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf
MOD = 10**9 + 7

def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def barr(n): return [False for _ in range(n)]
def adj(n): return [[] for _ in range(n)]

n = iinput()
arr = [sinput() for i in range(n)]
cnt = col.Counter(arr)
print("AC x",cnt["AC"])
print("WA x",cnt["WA"])
print("TLE x",cnt["TLE"])
print("RE x",cnt["RE"])

Solution (Python):
n = int(input())

ac = 0
wa = 0
tle = 0
re = 0

for i in range(n):
    s = input()

    if s == 'AC':
        ac += 1
    elif s == 'WA':
        wa += 1
    elif s == 'TLE':
        tle += 1
    elif s == 'RE':
        re += 1

print('AC x ' + str(ac))
print('WA x ' + str(wa))
print('TLE x ' + str(tle))
print('RE x ' + str(re))