import Foundation
var r = Int(readLine()!)!
var ac = 0
var wa = 0
var tle = 0
var re = 0
for _ in 0 ..< r {
   let arr=readLine()!
    if arr == "AC" {
        ac += 1
    }
    if arr == "WA" {
           wa += 1
    }
    if arr == "TLE" {
           tle += 1
       }
    if arr == "RE" {
           re += 1
       }
}
print("AC x "+String(ac))
print("WA x "+String(wa))
print("TLE x "+String(tle))
print("RE x "+String(re))