#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
  cin>>n;
  map<string,int>m;
  m["AC"]=0;
  m["WA"]=0;
  m["TLE"]=0;
  m["RE"]=0;
  string s;
  while(n){
    cin>>s;
    m[s]++;
  n--;
 }
  
 cout<<"AC X "<<m[AC]<<endl;
 cout<<"WA X "<<m[WA]<<endl;
 cout<<"TLE X "<<m[TLE]<<endl;
 cout<<"RE X "<<m[RE]<<endl;
  
  
}
