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

#define ll long long int

int main()
{
  ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    ll n;
    cin >> n;
    map <string,int>m;
   while(n--)
   {
     string s;
     cin>>s;
     m[s]++;
   }
   cout<<"AC x "<<m[AC]<<endl;
    cout<<"WA x "<<m[WA]<<endl;
     cout<<"TLE x "<<m[TLE]<<endl;
      cout<<"RE x "<<m[RE]<<endl;
}
