func main() {
    let maxQuestion = Int(readLine()!)!
    var resultOfQuestions = [String]()
    while let result = readLine() {
        resultOfQuestions.append(result)
    }
    var resultSet = "AC WA TLE RE".split(separator: " ")
    var counts = [Int](repeating: 0, count: 4)
    for str in resultOfQuestions {
        switch str {
        case String(resultSet[0]):
            counts[0] += 1
        case String(resultSet[1]):
            counts[1] += 1
        case String(resultSet[2]):
            counts[2] += 1
        case String(resultSet[3]):
            counts[3] += 1
        default:
            counts[4] += 1
        }
    }
    for index in 0...3 {
        print(resultSet[index], "x", counts[index])
    }
    return
}

main()
