#include <bits/stdc++.h>
using namespace std;
#define io ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ll long long int

int main()
{
  io;
  ll n ;
  cin >> n ;
  string s[n];
  unordered_map<string,int> mp;
  for(ll i=0;i<n;i++) {
    cin >> s[i];
    mp[s[i]]++;
  }
  cout <<"AC x " << mp[AC] <<"\n";
  cout <<"WA x " << mp[WA] <<"\n";
  cout <<"TLE x " << mp[TLE] <<"\n";
  cout <<"RE x " << mp[RE] ;
    
}