#include <iostream>
#include <vector>
using namespace std;

int main() {
 int N;
 string seged;
 vector <string> pls_kill_me;
 cin >> N;
 for(int i=0;i<N;i++){
  cin >> seged;
  pls_kill_me.push_back(seged);
 }
 int AC=0;
 int WA=0;
 int TLE=0;
 int RE=0;
 for(int i=0;i<N;i++){
   if(pls_kill_me[i]=="AC"){
     AC+=1;
   }else if(pls_kill_me[i]=="WA"){
   WA+=1;}
 }else if(pls_kill_me[i]=="TLE"){
   TLE+=1;
 }else if(pls_kill_me[i]=="RE"){
   RE+=1;
 }
 cout << "AC x "<<AC<<endl ;
 cout << "WA x "<<WA<<endl ;
 cout << "TLE x "<<TLE<<endl ;
 cout << "RE x "<<RE<<endl ;
	return 0;
}
