using namespace std;
int main(void){
    // Your code here!
   int a,c= 0,s= 0,d = 0,o = 0;
   string b;
   cin >> a;
   for(int i = 0;i < a;i++){
       cin >> b;
       
       if(b == "AC") c += 1;
       if(b == "WA") s += 1;
       if(b == "TLE") d += 1;
       if(b == "RE") o += 1;
   }
   
   
   cout << "AC x "<<c<< endl;
   cout << "WA x "<<s<< endl;
   cout << "TLE x "<<d<< endl;
   cout << "RE x "<<o<< endl;
}
