#include<iostream>
using namespace std;
int main()
{
  int n;cin>>n;
  string s[n];
  for(int i=0;i<n;++i)
    cin>>s[i];
  int a[4]={0};
  for(int i=0;i<n;++i)
  {
    if(s[i]==AC) a[0]++;
    if(s[i]==WA) a[1]++;
    if(s[i]==TLE) a[2]++;
    else a[3]++;
  }
  cout<<"AC x "<<a[0]<<endl;
   cout<<"WA x "<<a[1]<<endl;
   cout<<"TLE x "<<a[2]<<endl;
   cout<<"RE x "<<a[3]<<endl;
  return 0;
}