peterverebics/CodeNet_Python_118 huggingface dataset:
#A - Payment
N = int(input())
a = N % 1000
if N < 1000 :
    ans = 1000- a
elif a < 500:
    ans = 1000 - a
else:
    ans = 1000-a

print(ans)
import sys
read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    N = int(readline())
    ans = 1000-N
    print(ans)

if __name__ == '__main__':
    main()
#商品の値段を入力させる
n = int(input())
 
r_othuli = int()
for x in range (0 , 10000 , 1000):
    if n <= x :
        r_othuli += x-n
        print(r_othuli)
        exit()
N = float(input())
otsuri = N%1000
print(otsuri)
n = int(input())
satu = n//1000
print(n-1000*satu)
N=int(input())
quotient=N//1000
for i in range(quotient+1):
    N=N-1000
print(abs(N))
N = int(input())
ot = N//1000
print((ot+1)*1000 - N)
N = int(input())
d = N % 1000

if 1000 - d == 0:
    print(0)
else:
    print(1000 - d)
N=int(input())
if N>1000:
  print(1000-N%1000)
else:
  print(1000-N)
n = int(input())

m =n% 1000
if m==0:
    print(0)
else:
    print(1000 % (m))
n = int(input())
t = str(n)[0]
print((int(t) + 1) * 1000 - n if not n % 1000 == 0 else '0')
import math
n = int(input())

print(n-math.floor(n/1000)*1000)
n = int(input())
if n >= 1000:
    num = n / 1000
    num = round(num) * 1000
    print(abs(num - n))
else:
    print(1000-n)
n = int(input())
t = str(n)[0]
result = 1000 * (int(t) + 1) - n
print(result)
N = int(input())
if N >=1000:
	a = 1000 - (N % 1000)
	print(a)
else:
	print(1000 - N)
N= int(input())
mod = N%1000

if N < 1000:
    print(1000-N)
    exit()

elif mod > 500:
    mod = 1000-mod
print(mod)
N=int(input())
if N%1000==0:
  print(0)
 
else:
  print(N%1000)
#!/usr/bin/python
# -*- Coding: utf-8 -*-

n = int(input())

if n >= 1000:
    print(n%1000)
else:
    print(n)
import sys

n = int(input())

if n % 1000 == 0:
    print(0)
    sys.exit()

while n > 1000:
    n -= 1000

print(n)
class Main():
  def otsuri(N):
    while N < 1000 * i:
      otsuri = 1000 * i - N
    
    return otsuri
n = int(input())
m = n//1000
print(n-(m*1000))
def main():
    N = int(input())
    a = N % 1000
    if a > 500:
        print(1000 - a)
    else:
        print(a)

if __name__ == '__main__':
    main()
N = int(input())
print(min(N % 1000, abs(N - (N // 1000 + 1) * 1000)))
n = int(input())
a = n % 1000
if a == 1000 & n == 0:
    ans = 0
else:
    ans = 1000 - a
print(ans)
n = int(input())

num = n%1000
ans = 1000-num
print(ans)
import math
n=int(input())
print(1000*math.ceil(n//1000)-n+1000)
N = int(input())

if N % 1000 == 0:
    print(N // 1000)
else:
    print(N // 1000 + 1)
N=int(input())
while N>=1000:
    N-=1000
print(N)
N = int(input())
if N % 1000 == 0:
    print(0)
print(1000 - N % 1000)
from sys import stdin


def readline_from_stdin() -> str:
    return stdin.readline().rstrip


if __name__ == '__main__':
    N = int(input())
    print(1000 - N % 1000)
N = int(input())
ans = N % 1000
print(1000-ans)
N=int(input(""))

A = N % 1000

if A > 1:
      B=1000-A
      print(B)
else:
      print(A)
x = int(input())
while x<=0:
  x -=1000
print(abs(x))
N=int(input())
if N>1000:
    print(1000-N%1000)
else:
    print(1000-N)
import math
a = input()
b = int(a)
c = 1000
if len(a) < 5:
  print(c-b)
else:
  if a[-4] != '0':
    b = int(a[-5:])
    print(c-b)
  elif a[-3] != '0':
    b = int(a[-4:])
    print(c-b)
  elif a[-2] != '0':
    b = int(a[-3:])
    print(c-b)
  else:
    print(int(0))
#!/usr/bin/env python3
import os
from sys import stdin, stdout


def solve(tc):
  n = int(stdin.readline().strip())
  print(1000 - (n%1000))


tcs = 1
tc = 1
while tc <= tcs:
  solve(tc)
  tc += 1
N = int(input())
while N >= 1000:
  N -= 1000
print(N)
import sys
import math
import numpy as np
import functools
import operator
import collections
import itertools
N=int(input())
print(N%1000)
a=input()

if len(a)==(4 or 5):
  b=a[1:]
  c=1000-int(b)
  if c==1000 :
    print('0')
  else:
    print(c)
  
else:
  print(1000-int(a))
def solver(N):
    return N % 1000
print(solver(int(input())))
N = int(input())
ans = []
for i in range(10):
    ans.append(abs((i*1000)-N))
print(min(ans))
N = int(input())

if N%1000 == 0:
  print(N/1000 * 1000 - N)
else:
  print(((N/1000) + 1)*1000 - N)
N=int(input())
N%=1000
print(min(N,1000-N))
n = int(input())
if n >= 1000:
    num = n % 1000
else:
    num = 1000 - n
print(int(num))
a=int(input())
if a/1000==type(int):
    print(0)
else:
    b=a%1000
    c=1000-b
    print(c)
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
#import numpy as np
def main():
    n = int(input())
    if n % 1000:
        print(n // 1000 + 1)
    else:
        print(n // 1000)

if __name__ == '__main__':
    main()
N = int(input())
a = N//1000
print((a+1)*1000-N)
N = int(input())
otsuri = N % 1000
print(otsuri)
if not otsuri == 0:
    otsuri = 1000 - otsuri
print(otsuri)
def main():
    A = int(input())

    s = A % 1000

    print(1000-s)




if __name__ == '__main__':
    main()
n=input()
t=len(n)
if t<4:
  print(1000-int(n))
else:
  k=int(n[0])
  if int(n)>k*1000:
    print((k+1)*1000-int(n))
  else:
    print(0)
n = int(input())
n = n % 1000
print(1000-n)
N=int(input())

if N>=1000:
  print(N%1000)

elif N<1000:
  print(1000-N)
n = int(input())

a = 1000

for i in range(n):
  if  n <= a*i :
    c = a*i - n
    print(c)  
    break
n = int(input())
payment = abs(n - round(n / 1000) * 1000)
print(payment)
n = int(input())
print(n - (-n // 1000) * 1000)
n = int(input())
d = n//1000+1
print(d*1000-n)
# -*- coding: utf-8 -*-
"""
Created on Sun Jul  5 21:00:39 2020

@author: NEC-PCuser
"""

N = int(input())

print(N % 1000)
n = int(input())
if n <= 1000:
    print(1000 - n)
else:
    m = n // 1000 + 1
    print(m * 1000 - n)
n = int(input()) - 1
k = list(str(n))
kk = int(k[0])
print((kk + 1)*1000 - n - 1)
n =int(input())
n = n%1000
print(1000- n)
N = int(input())
n = 1000
while N > n:
    n += 1000
print(N - n)
a = int(input())
b = a % 1000
ans = 1000 - b 
print(ans)
n = int(input())
if n % 1000 == 0 :
	print(n / 1000)
else :
	tmp = n // 1000
	print(1000 * (tmp + 1) - n)
N=int(input())
money=0
for i in range(8):
    if(money>N):
        break
    money=1000*i

print(money-N)
N = int(input())
if N%1000==0:
    print(0)
elif N<1000:
    print(N)
else:
    print(1000-N%1000)
S = int(input())
A = S % 1000
print(1000 - A)
Y=int(input())
def payment(Y):
    if 1000-Y>-2000:
        print(((Y-2000)*-1))
payment(Y)
input1 = input()
print(1000 - int(input1) % 1000)
n = int(input())
print(1000*((n//1000)+1) - n)
# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/
#
# lang: Python3 (3.8.2)

import math
import statistics
import numpy as np
import queue
import itertools
import functools 

n = int(input())
print(0 if n == 1000 else 1000 - (n % 1000))
i = int(input())
a = 1000-(i%1000)
print(a)
N= input()
x=int(N)
if x<1000:
    print(1000-x)
if x > 999:   
    while True: #0 1 2 4 5が出力される
	    x -= 1000
	    if x <= 1000:
		    break      
    print(1000-x)
n=int(input())
c=n%1000
if c>=500:
    print(1000-c)
else:
    print(c)
amount = int(input())
if(amount % 1000 == 0):
  print(0)
else:
  change = (amount / 1000 + 1) * 1000 - amount
  print(change)
'''
.append(要素) リストに要素を追加
.extend(リスト) リストを連結する
.insert(場所,要素) 指定した場所に要素追加
del 配列名[場所]
-1で末尾で末尾から一つ前
sort()
sorted(reverse=true)
配列の初期化
配列名=[a]*n+[b]*m
Decimal()
'''

from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import bisect
import copy
import math
from functools import reduce
from operator import mul
from collections import Counter
import itertools
import fractions
import sys
print(1000-int(stdin.readline().rstrip()) % 1000)
N=int(input())
if N>1000:
  if N%2==0:
  	print(0)
  else:
    print(1000-N%1000)
else:
  print(1000-N)
N = int(input())
a = 1000-N%1000
print(a)
N=int(input())
x=N%1000
if x==1000:
  print(0)
else:
  print(1000-x)
n = int(input())

for i in range(1000,10001,1000):
  if i > n:
    print(i-n)
    break
N = int(input())

if N >=1000:
    N2 = round(N,-3)
else:
    N2 = 1000

print(N2-N)
def main():
  N = input()
  if len(N)<4:
    print(int(N))
  else:
    print(int(N[len(N)-2:]))

if __name__ == "__main__":
    main()
n = int(input())

a = n%1000

if a == 1000:
    print(0)
else:
    print(1000-a)
n = int(input())
print(min(n % 1000, (-n % 1000)))
n = int(input())

if n < 1000:
    print(1000-n)
elif 1000< n <=2000:
    print(2000-n) 
elif 2000< n <=3000:
    print(3000-n)
elif 3000< n <=4000:
    print(4000-n)
elif 4000< n <=5000:
    print(5000-n)
elif 5000< n <=6000:
    print(6000-n)
elif 6000< n <=7000:
    print(7000-n)
elif 7000< n <=8000:
    print(8000-n)
elif 8000< n <=9000:
    print(9000-n)
elif 9000< n <=10000:
    print(10000-n)
n=input()
t=len(n)
if t<4:
  print(1000-int(n))
else:
  k,p=int(n[0]),int(n[1])
  if p!=0:
    print((k+1)*1000-int(n))
  else:
    print(0)
lists = [input() for i in range(int(input()))]
dct = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
for lst in lists:
    if lst in dct:
        dct[lst] += 1

for k, v in dct.items():
    print(k,'x',v)
N = int(input())
S = []
for _ in range(N): S.append(input())

print('AC x', S.count('AC'))
print('WA x', S.count('WA'))
print('TLE x', S.count('TLE'))
print('RE x', S.count('RE'))
# -*- coding: utf-8 -*-
"""
Created on Sun Jul  5 21:05:16 2020

@author: asaka
"""

N = int(input())
ans = [0]*4

for n in range(N):
    h = input()
    if h == "AC":
        ans[0] += 1
    elif h == "WA":
        ans[1] += 1
    elif h == "TLE":
        ans[2] += 1
    elif h == "RE":
        ans[3] += 1
        
print("AC x ", ans[0])
print("WA x ", ans[1])
print("TLE x ", ans[2])
print("RE x ", ans[3])
dic = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
N = int(input())
for i in range(N):
  dic[input()] += 1
for i in dic:
  print(i, 'x', dic[i])
N = int(input())

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

print("AC x " + str(A))
print("WA x " + str(W))
print("TLE x " + str(T))
print("RE x " + str(R))
n = int(input())
array = []
for i in range(n):
    array.append(input())
ac = 0
wa =0
tle = 0
re = 0

for s in array:
    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))
N = int(input())
S = [input() for i in range(N)]
 
c0 = 0
c1 = 0
c2 = 0
c3 = 0
 
for i in range(N):
  if S[i] == 'AC':
    c0 += 1
  elif S[i] == 'WA':
    c1 += 1
  elif S[i] == 'TLE':
    c2 += 1
  elif S[i] == 'RE':
    c3 += 1
 
print('AC x %d' %c0)
print('WA x %d' %c1)
print('TLE x %d' %c2)
print('RE x %d' %c3)
n=int(input())
ac=0
wa=0
tle=0
re=0
for i in range(n):
  st=input()
  if st=='AC':
    ac+=1
  elif st=="WA":
    wa+=1
  elif st=="TLE":
    tle+=1
  elif st=="RE":
    re+=1
print('AC x '+ str(ac))
print("WA x "+ str(wa))
print("TLE x "+ str(tle))
print("RE x "+ str(re))
n=int(input())
c0,c1,c2,c3=0,0,0,0

for i in range (n):
    s=input()
    if(s=='AC'):
        c0=c0+1
    if (s=='WA'):
        c1+=1
    if(s=='TLE'):
        c2+=1
    if(s=='RE'):
        c3+=1
print("AC x ",c0)
print("\nWA x ",c1)
print("\nTLE x ",c2)
print("\nRE x ",c3)
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))
def JudgeStatusSummary():

    num = int(input())

    list_result = []

    for n in range(num):
        result = str(input())
    
        list_result.append(result)
    
    print('AC x ', list_result.count('AC'))
    print('WA x ', list_result.count('WA'))
    print('TLE x ', list_result.count('TLE'))
    print('RE x ', list_result.count('RE'))


if __name__ == '__main__':
    JudgeStatusSummary()
import sys
input = sys.stdin.readline

N = int(input())
S_list = [input() for _ in range(N)]

AC_c = 0
WA_c = 0
TLE_c = 0
RE_c = 0
for S in S_list:
    if S == "AC\n":
        AC_c += 1
    elif S == "WA\n":
        WA_c += 1
    elif S == "TLE\n":
        TLE_c += 1
    else:
        RE_c += 1
print("AC x " + str(AC_c))
print("WA x " + str(WA_c))
print("TLE x " + str(TLE_c))
print("RE x " + str(RE_c))
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",AC)
print("WA x",WA)
print("TLE x",TLE)
print("RE x",RE)
N = int(input())
ac, re, wa, tle = 0,0,0,0
for i in range(N):
  line = input()
  if line == "AC":
    ac += 1
  elif line == "TLE":
    tle += 1
  elif line == "WA":
    wa += 1
  elif line == "RE":
    re += 1
print("AC x " + str(ac))
print("WA x " + str(wa))
print("TLE x " + str(tle))
print("RE x " + str(re))
len = int(input())

dict = {}

for i in range(len):
    result = input()

    if result in dict:
        dict[result] += 1
    else:
        dict[result] = 1

keys = ['AC', 'WA', 'TLE', 'RE']
for k in keys:
    cnt = 0
    if k in dict:
        cnt = dict[k]
    print("{0} x {1}".format(k, cnt))
import sys
import numpy as np

A = int(input())
AC = 0
WA = 0
TLE = 0
RE = 0

for i in range(A):
    s = str(input())
    if s == 'AC':
        AC += 1
    elif s == 'WA':
        WA += 1
    elif s == 'TLE':
        TLE += 1
    elif s == 'RE':
        RE += 1

print('AC x', AC)
print('WA x', WA)
print('TLE x', TLE)
print('RE x', RE)
N = int(input())
strng = [input() for i in range(N)]

counts = [0]*4
for i in range(N):
    if strng[i] == 'AC':
        counts[0] += 1
    elif strng[i] == 'WA':
        counts[1] += 1
    elif strng[i] == 'TLE':
        counts[2] += 1
    elif strng[i] == 'RE':
        counts[3] += 1

print('AC x ' + str(counts[0]))
print('WA x ' + str(counts[1]))
print('TLE x ' + str(counts[2]))
print('RE x ' + str(counts[3]))
n = int(input())
a = [0] * 4
for loop in range(n):
    s = input()
    if s == 'AC':
        a[0] += 1
    if s == 'WA':
        a[1] += 1
    if s == 'TLE':
        a[2] += 1
    if s == 'RE':
        a[3] += 1
s = ['AC', 'WA', 'TLE', 'RE']
for i in range(4):
    print(s[i], 'x', a[i])
n = int(input())
ans = [0]*4
for i in range(n):
    s = input()
    if s=='AC':
        ans[0]+=1
    elif s=='WA':
        ans[1]+=1
    elif s=='TLE':
        ans[2]+=1
    else:
        ans[3]+=1
print('AC x {0}'.format(ans[0]))
print('WA x {0}'.format(ans[1]))
print('TLE x {0}'.format(ans[2]))
print('RE x {0}'.format(ans[3]))
n = int(input())
ac_cnt = 0
wa_cnt = 0
tle_cnt = 0
re_cnt = 0
for i in  range(n):
    s = input()
    if s == 'AC':
        ac_cnt += 1
    elif s == 'WA':
        wa_cnt += 1
    elif s == 'TLE':
        tle_cnt += 1
    elif s == 'RE':
        re_cnt += 1
print('AC x ' + str(ac_cnt))
print('WA x ' + str(wa_cnt))
print('TLE x ' + str(tle_cnt))
print('RE x ' + str(re_cnt))
test = int(input())

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


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

    if n == "AC":
        ac += 1

    if n == "WA":
        wa += 1

    if n == "TLE":
        tle += 1

    if n == "RE":
        re += 1




print(f"AC x {ac}")
print(f"WA x {wa}")
print(f"TLE x {tle}")
print(f"RE x {re}")
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
    else:
        re+=1
print("AC x",ac)
print("WA x",wa)
print("TLE x",tle)
print("RE x",re)
q= int(input())
ac,wa,tle,re = 0,0,0,0
for _ in range(q):
    q = input()
    if q == "AC": ac+=1
    elif q == "WA": wa+=1
    elif q == "TLE": tle+=1
    else : re+=1
print("AC x",ac)
print("WA x",wa)
print("TLE x",tle)
print("RE x",re)
def main():
    N = int(input())
    di = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}

    for _ in range(N):
        di[input()] += 1

    for k, v in di.items():
        print(f"{k} x {v}")


if __name__ == "__main__":
    main()
n = int(input())
ans = [0,0,0,0]
for _ in range(n):
  s = input()
  if s == 'AC':
    ans[0] += 1
  elif s == 'WA':
    ans[1] += 1
  elif s == 'TLE':
    ans[2] += 1
  else:
    ans[3] += 1
print('AC x ' + str(ans[0]))
print('WA x ' + str(ans[1]))
print('TLE x ' + str(ans[2]))
print('RE x ' + str(ans[3]))
n  = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in range(n):
    tmp = input()
    if tmp == 'AC':
        ac +=1
    elif tmp == 'WA':
        wa  +=1
    elif tmp == '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))
def judge_status_summary():
    N = int(input())
    res = {"AC":0,"WA":0,"TLE":0,"RE":0}
    for i in range(N):
        res[input()] += 1
    
    for k in res:
        print("{} x {}".format(k,res[k]))
        
judge_status_summary()
c=open(0).read().count
for s in'AC','WA','TLE','RE':print(s,'x',c(s))
N = int(input())
s = [input() for i in range(N)]
for v in ['AC', 'WA', 'TLE', 'RE']:
    print('{} x {}'.format(v, s.count(v)))
N = int(input())
l = []
for i in range(N):
    l.append(input())
AC = l.count('AC')
WA = l.count('WA')
TLE = l.count('TLE')
RE = l.count('RE')
print("AC x {}".format(AC))
print("WA x {}".format(WA))
print("TLE x {}".format(TLE))
print("RE x {}".format(RE))
n = int(input())

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

for i in range(n):
	if s[i] == 'AC':
		ac += 1
	elif s[i] == 'WA':
		wa += 1
	elif s[i] == 'TLE':
		tle += 1
	elif s[i] == 'RE':
		re += 1

print("AC x " + str(ac))
print("WA x " + str(wa))
print("TLE x " + str(tle))
print("RE x " + str(re))
n = int(input())
d = {
	'AC': 0,
	'WA': 0,
	'TLE': 0,
	'RE': 0
}

for i in range(n):
  	d[input()] += 1

print('{} x {}'.format('AC', d['AC']))
print('{} x {}'.format('WA', d['WA']))
print('{} x {}'.format('TLE', d['TLE']))
print('{} x {}'.format('RE', d['RE']))
n = int(input())
counts = {'AC': 0, 'TLE': 0, 'WA': 0, 'RE': 0}
for i in range(n):
  s = input()
  counts[s] += 1
print("AC x "+str(counts['AC']))
print("WA x "+str(counts['WA']))
print("TLE x "+str(counts['TLE']))
print("RE x "+str(counts['RE']))
f = {"AC":0, "WA":0, "TLE":0,"RE":0}
for i in range(int(input())):
    s = input()
    f[s]+=1
for i in f:
    print(i,"x", f[i])
import sys
from collections import Counter
import math

counts = Counter(line.strip() for line in sys.stdin)

for key in ["AC", "WA", "TLE", "RE"]:
  if key not in counts:
    print("{} x 0".format(key))
  else:
    print("{} x {}".format(key, counts[key]))
import sys
input=sys.stdin.readline
n=int(input())
ac,wa,tle,re=0,0,0,0
for _ in range(n):
    s=input().rstrip()
    if s=='AC':
        ac+=1
    elif s=='WA':
        wa+=1
    elif s=='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)
from collections import Counter

n = int(input())
c = Counter(input() for _ in range(n))
print("AC x", c["AC"])
print("WA x", c["WA"])
print("TLE x", c["TLE"])
print("RE x", c["RE"])
n = int(input())
s = [input() for _ in range(n)]
#print(s)

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')))
N = int(input())
AC = 0
WA = 0
TLE = 0
RE = 0
for i in range(N):
    temp = input()
    if temp == "AC":
        AC = AC + 1
    if temp == "WA":
        WA = WA + 1
    if temp == "TLE":
        TLE = TLE + 1
    if temp == "RE":
        RE = RE + 1
print("AC x " + str(AC))
print("WA x " + str(WA))
print("TLE x " + str(TLE))
print("RE x " + str(RE))
N = int(input())
S = [input() for _ in range(N)]

D = {}
D['AC'] = 0
D['WA'] = 0
D['TLE'] = 0
D['RE'] = 0

for k in range(N):
  D[S[k]] += 1

print('AC x',D['AC'])
print('WA x',D['WA'])
print('TLE x',D['TLE'])
print('RE x',D['RE'])
N= int(input())

flaga=0
flagw=0
flagt=0
flagr=0


for _ in range(N):
    K = str(input())

    if(K=='AC'):
        flaga+=1

    if(K=='WA'):
        flagw+=1

    if(K=='TLE'):
        flagt+=1

    if(K=='RE'):
        flagr+=1

print("AC x "+str(flaga))
print("WA x "+str(flagw))
print("TLE x "+str(flagt))
print("RE x "+str(flagr))
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 15 17:00:46 2020

@author: saito
"""

# %% import phase

# %% define phase

# %% input phase
N = int(input())
S = [0]*N
for i in range(N):
    S[i] = input()

# %% process phase
C = [0]*4
rslt = ['AC', 'WA', 'TLE', 'RE']
for i in range(4):
    C[i] = S.count(rslt[i])

# %%output phase
for i in range(4):
    print(rslt[i]+' '+'x'+' '+str(C[i]))
n = int(input())

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

for i in range(n):
    s = str(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))
n=int(input())
lis=['AC', 'WA', 'TLE', 'RE']
ans=[0,0,0,0]
for _ in range(n):
    s=input()
    ans[lis.index(s)]+=1

for i in range(4):
    print(lis[i]+' x '+str(ans[i]))
n = int(input())
l = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
for _ in range(n):l[input()] += 1
for k in l.keys():print(k+' x '+str(l[k]))
import sys
import math
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def make_grid(h, w, num): return [[int(num)] * w for _ in range(h)]


def main():
    N = NI()
    D = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}
    for i in range(N):
        D[SI()] += 1
    for x, y in D.items():
        print("{0} x {1}".format(x, y))


if __name__ == "__main__":
    main()
n=int(input())
l=[0,0,0,0]
for _ in range(n):
	s=input()
	if(s=='AC'):
		l[0]+=1
	elif(s=='WA'):
		l[1]+=1
	elif(s=='TLE'):
		l[2]+=1
	elif(s=='RE'):
		l[3]+=1
print("AC x",l[0])
print("WA x",l[1])
print("TLE x",l[2])
print("RE x",l[3])
N = int(input())
results = ['AC', 'WA', 'TLE', "RE"]
d = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}

for _ in range(N):
	r = input()
	d[r] += 1

for i in range(4):
	print(results[i] + ' x ' + str(d[results[i]]))
n = int(input())

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

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

print('AC x {}\nWA x {}\nTLE x {}\nRE x {}\n'.format(d['AC'], d['WA'], d['TLE'], d['RE']))
N=int(input())

list=[]
ac=0
wa=0
re=0
tlc=0

for i in range(N):
 list.append(input())

for i in range(N):
 if list[i]=="AC":
  ac+=1
 elif list[i]=="WA":
  wa+=1
 elif list[i]=="RE":
  re+=1
 else:
  tlc+=1

print("AC  x "+str(ac))
print("WA x "+str(wa))
print("TLE x "+str(tlc))
print("RE x "+str(re))
N = int(input())
dic = {"AC":0,"WA":0,"TLE":0,"RE":0}

for i in range(N):
    s = input()
    dic[s] += 1
    

for k, v in dic.items():
    print(k+" x "+str(v))
from collections import Counter
n = int(input())
s = [input() for _ in range(n)]
cnt = Counter(s)
for s in ["AC","WA","TLE","RE"]:
	print("{} x {}".format(s,cnt[s]))
from collections import Counter
import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10**8)


def geta(fn=lambda s: s.decode()):
    return map(fn, readline().split())


def gete(fn=lambda s: s.decode()):
    return fn(readline().rstrip())


def main():
    n = gete(int)
    s = []
    for _ in range(n):
        s.append(gete())

    c = Counter(s)

    for v in ['AC', 'WA', 'TLE', 'RE']:
        print(v, "x", c[v])


if __name__ == "__main__":
    main()
from collections import *

# def solve():


# for _ in range(int(input())):
#     solve()
n = int(input())
l = []
for i in range(n):
    l.append(input())

print("AC x",l.count("AC"))
print("WA x",l.count("WA"))
print("TLE x",l.count("TLE"))
print("RE x",l.count("RE"))
n = int(input())
t = {"AC":0, "WA":1, "TLE":2, "RE":3}
u = ["AC", "WA", "TLE", "RE"]
ans = [0]*4
for _ in range(n):
    ans[t[input()]] += 1
for i in range(4):
    print(u[i], "x", ans[i])
#!python3

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


def main():
    l = ["AC", "WA", "TLE", "RE"]
    d = {x: 0 for x in l}
    for s in S:
        d[s] += 1
    for x in l:
        ans = "{} x {}".format(x, d[x])
        print(ans)


if __name__ == "__main__":
    main()