#include <iostream>
using namespace std;

int main(){
  int N; int c1=0;int c2=0;int c3=0;int c4=0; string s;
  cin>>N;
  for (int i=0; i<n-1;++i){
    cin>>s;
    while(s == "AC")++c1;
    while(s == "WA")++c2;
    while(s == "TLE")++c3;
    while(s == "RE")++c4;  
  }
  cout<<"AC "<<"x "<<c1<<endl;
  cout<<"WA "<<"x "<<c2<<endl;
  cout<<"TLE "<<"x "<<c3<<endl;
  cout<<"RE "<<"x "<<c4<<endl;
 return 0;
}