#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n,ca=0,ct=0,cw=0,cr=0;
  cin>>n;
  while(n--)
  {
    string s;
    cin>>s;
    if(s=="AC")
      ca++;
    if(s=="WA")
      cw+;
    if(s=="TLE")
      ct++;
    if(s=="RE")
      cr++;
  }
  cout<<"AC x "<<ca<<endl;
  cout<<"WA x "<<cw<<endl;
  cout<<"TLE x "<<ct<<endl;
  cout<<"RE x "<<cr<<endl;
return 0;
}