#include <bits/stdc++.h>
using namespace std;

int main() {
  int a,b,c,d,e;
  cin >> a ;
  for(i=0;i<a;i++)
{
string f;
cin >>f;
if(f=="AC")
{
b+=1;
}
if(f=="WA")
{
c+=1;
}
if(f=="TLE")
{
d+=1;
}
if(f=="RA")
{
e+=1;
}
}
cout<<"AC x "<<b<<endl;
　cout<<"WA x "<<c<<endl;
cout<<"TLE x "<<d<<endl;
cout<<"RE x "<<e<<endl;
}