#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
ll gcd(ll a, ll b);
int main(){
cin.tie(0);
string k;
int n,result[4]={0,0,0,0};
  cin >>n;
  for(int i=1;i<=n;i++){
    cin >>k;
    if(k=="AC")result[0]++;
    else if(k=="WA")result[1]++;
    else if(k=="TLE")reslut[2]++;
    else if(k=="RE")result[3]++;
  }
cout <<"AC x "<<result[0]<<endl;
  cout <<"WA x "<<result[1]<<endl;
  cout <<"TLE x "<<result[2]<<endl;
  cout <<"RE x "<<result[3]<<endl;
return 0;
}






ll gcd(ll a, ll b){

   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }

}