#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--;
 }
  
  for(auto &t : m){
  cout<<t->first<<" X "<<t->second<<endl;
  }
  
  
}