#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(){
  int b,a=0,w=0,t=0,r=0;
  cin>>b;
vector<string>a(b);
  for(int i=0;i<b;i++){
  cin>>a.at(i);
    if(a.at(i)=='AC'){
      a++;
  }
    else if(a.at(i)=='WA'){
    w++;
    }
    else if(a.at(i)=='TLE'){
     t++; 
    }
    else{
    r++;
    }
    cout<<"AC x "<<a<<endl;
    cout<<"WA x "<<w<<endl;
    cout<<"TLE x "<<t<<endl;
    cout<<"RE x "<<r<<endl;
    return 0;
}