#include<iostream>
using namespace std;
int main(){
  int n,c=0,c1=0,c2=0,c3=0;
  string str;
  cin>>n;
  for(int i=1;i<=n;i++){
    getline(cin,str);
    if(str=="AC")
      c++;
    else if(str=="WA")
      c1++;
    else if(str=="TLE")
      c2++;
    else if(str=="RE")
      c4++;
    str.clear();
  }
  cout<<"AC" "x" c<<"\n";
  cout<<"WA" "x" c1<<"\n";
  cout<<"TLE" "x" c2<<"\n";
  cout<<"RE" "x" c3<<"\n";
}