"use strict";

function main(arg) {
    const input = arg.split("\n")
    let N = Number(input[0])
    input.shift()
    let S = input
    //console.log(N)
    //console.log(S)
    
    let sums = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
    for(let i=0;i < N; i++) {
        if(S[i]==='AC') {
            sums['AC'] ++
        } else if(S[i]==='WA') {
            sums['WA'] ++
            
        }else if(S[i]==='TLE') {
            sums['TLE'] ++
            
        }else if(S[i]==='RE') {
            sums['RE'] ++
            
        }
    }
    Object.keys(sums).forEach(x=>{
        console.log(`${x} x ${sums[x]}`)
    })


}

main(require("fs").readFileSync("/dev/stdin", "utf8"));