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

    int main() {
        
        long long int n;
        cin >> n;
        
        string s;
        long long int ct=0,st=0,at=0,rt=0;
        
       while(n--){
            cin>> s;
        
            if(s=="AC")
                ct++;
                
           else if(s=="WA")
                st++;
            
           else if(s=="TLE")
                at++;
           else if(s=="RE")
                rt++;
                
        
        }
        
        cout << "AC x " << ct;
        cout<< "WA x "<< st;
        cout << "TLE x "<<at
        cout << "RE x "<<rt;
        
       return 0; 
        
        }