use proconio::input;

fn main() {
    input! {
        n: usize,
        s: [String; n],
    }

    let ac = 0;
    let wa = 1;
    let tle = 2;
    let re = 3;
    let mut ans = vec![0i64; 4];
    for s_i in s {
        match s_i.as_str() {
            "AC" => ans[ac] += 1,
            "WA" => ans[wa] += 1,
            "TLE" => ans[tle] += 1,
            "RE" => ans[tle] += 1,
            _ => unreachable!(),
        }
    }

    println!("AC x {}", ans[ac]);
    println!("WA x {}", ans[wa]);
    println!("TLE x {}", ans[tle]);
    println!("RE x {}", ans[re]);
}
