#include <iostream>
using namespace std;

int main() {
	int N,count[4]={0,0,0,0};
	cin>>N;
    for(int i=0;i<N;i++){
        string S;
        cin>>S;
        if(S=="AC")
            count[0]++;
        else if(S=="WA")
            count[1]++;
        else if(S=="TLE")
            count[2]++;
        else
            count[3]++;
    }
    
    cout<<"AC x "<<cout[0]<<endl;
    
    cout<<"WA x "<<cout[0]<<endl;
    
    cout<<"TLE x "<<cout[0]<<endl;
    
    cout<<"RE x "<<cout[0]<<endl;
    
	return 0;
}