#include<bits/stdc++.h>
using namespace std;


#define endl "\n"

#define rks ios_base::sync_with_stdio(false); cin.tie(NULL);





int main (){

int x;cin>>x;
string arr[x]={};

for(int i=0;i<x;i++){
    cin>>arr[i];
}
int ac,tle,wa,re;
for(int i=0;i<x;i++){
    if(arr[i]=="AC"){
        ac++;
    }else if(arr[i]=="WA"){
        wa++;
    }else if(arr[i]=="TLE"){
        tle++;
    }else{
        re++;
    }
}
cout<<"AC"<<" "<<"x"<<" "<<ac<<endl;
cout<<"WA"<<" "<<"x"<<" "<<wa<<endl;
cout<<"TLE"<<" "<<"x"<<" "<<tle<<endl;
cout<<"RE"<<" "<<"x"<<" "<<re<<endl;
}










