fn main(){
    let count:i32 = read();
    
    let mut judge:Vec<i32> = vec![0,0,0,0];
    for _i in 0..count{
        let data:String = read();
        if data == String::from("AC"){
            judge[0] += 1; 
        }else if data == String::from("WA"){
            judge[1] += 1;
        }else if data == String::from("TEL"){
            judge[2] += 1;   
        }else{
            judge[3] += 1;
        }
    }
    println!("AC x {}", judge[0]);
    println!("WA x {}", judge[1]);
    println!("TEL x {}", judge[2]);
    println!("RE x {}", judge[3]);
}

fn read<T: std::str::FromStr>() -> T{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}