local length = io.read()
local data = {AC = 0, WA = 0, TLE =0, RE = 0}

for i = 1, length do 
    local key = io.read()
    if data[key] then
        data[key] = data[key] + 1
    end
end

print("AC X".." "..data["AC"])
print("WA X".." "..data["WA"])
print("TLE X".." "..data["TLE"])
print("RE X".." "..data["RE"])