#include <bits/stdc++.h>
#define mod 1000000007
#define ll long long int
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;

bool isPrime(ll n) 
{ 
    if (n <= 1)  return false; 
    if (n <= 3)  return true; 
  
    if (n%2 == 0 || n%3 == 0) return false; 
  
    for (int i=5; i*i<=n; i=i+6) 
        if (n%i == 0 || n%(i+2) == 0) 
           return false; 
    return true; 
} 

ll power(ll x,ll y) 
{ 
	if(x == 0) 
        return 0; 
    if (y == 0) 
        return 1; 
    else if (y % 2 == 0) 
        return power(x, y / 2) * power(x, y / 2); 
    else
        return x * power(x, y / 2) * power(x, y / 2); 
} 

int main()
{
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
	#endif

    fastio
    ll t, i, j, n;
    cin>>n;
    string s;

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