#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

typedef  long long int  ll;
typedef long double ld;
ll N;
ll ac,wa,tle,re;
string str;
void solve()
{
    cin>>N;
    ac=0,wa=0,tle=0,re=0;
    while(N--)
    {
        cin>>str;
        if(str=="AC")
        ac++;
        else if(str=="WA")
        wa++;
        else if(str=="TLE")
        tle++;
        else
        {
            re++;
        }
    }
    cout<<"AC"<<" "<<"x"<<ac<<"\n";
    cout<<"WA"<<" "<<"x"<<wa<<"\n";
    cout<<"TLE"<<" "<<"x"<<tle<<"\n";
    cout<<"RE"<<" "<<"x"<<re<<"\n";
    
}
signed main() 
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    solve();
}