#include<iostream>
using namespace std;
int main(){
int a=0,b=0,c=0,d=0;
  int n;
  cin>>n;
  char q;
  while(n){
  
  cin>>q;
  if (q=="AC")
    a++;
  else if(q=="WA")
    b++;
  else if(q=="TLE")
    c++;
  else if (q=="RE")
    d++;
  n--;
  }

cout<<"AC x "<<a<<endl;
cout<<"WA x "<<b<<endl;
cout<<"TLE x "<<c<<endl;
cout<<"RE x "<<d<<endl;
return 0;
}
