#include <bits/stdc++.h>

using namespace std;

int main() {
    long long int n;
    cin>>n;
    map<string,int> ma;
    map<string,int> ::iterator it;
    ma["AC"]=0;
    ma["TLE"]=0;
    ma["WA"]=0;
    ma["RE"]=0;
    for(int i=0;i<n;i++)
    {
        string s;
        cin>>s;
        ma[s]++;
    }
         cout<<"AC"<<" x "<<ma["AC"]<<endl;
         cout<<"WA"<<" x "<<ma["WA"]<<endl;
         cout<<"TLE"<<" x "<<ma["TLE"]<<endl;
         cout<<"RE"<<" x "<<ma["RE"]<<endl;
    
    return 0
}