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

int main(){
    int n;
    int ac=0;
    int wa=0;
    int tle=0;
    int re=0;
    cin>>n;
    vector<char>v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];

    }
    for(int i=0;i<n;i++){
        if(v[i]=="AC"){
            ac++;
        }
        if(v[i]=="WA"){
            wa++;
        }
        if(v[i]=="TLE"){
            tle++;
        }
        if(v[i]=="RE"){
            re++;
        }
    }
    cout<<"AC x "<<ac<<endl;
      cout<<"WA x "<<wa<<endl;
        cout<<"TLE x "<<tle<<endl;
          cout<<"RE x "<<re<<endl;

}