/**

author:	©LoneWolfDON
Git: MahinHossainMunna

**/
/*

*/
///...................................template starts.................................................///

/// headers ///

#include                        <bits/stdc++.h>
#include                        <climits>

///defined ///

#define     ll                  long long
#define     inf                 999999999
#define     MAX                 1000001
#define     fastIO;             ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define     pb                  push_back
#define     endl                '\n'
#define     OJ()                ll tc; cin>>tc; while(tc--)

///Read-Write///
#define	    READ;               freopen("input.txt","r",stdin);
#define     WRITE;              freopen("output.txt","w",stdout);

/// loops ///

#define fo(i,a,m)               for(ll i = a ; i < m ; i++)
#define refor(i,a,m)            for(ll i = a ; i > m ; i--)
#define foreq(i,a,m)            for(ll i = a ; i <= m ; i++)
#define revforeq(i,a,m)         for(ll i = a ; i >= m ; i--)

using namespace std;

///....................................................................................///

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

    return (y%2 == 0)? p : (x * p);
}
///....................................................................................///

int lcm(ll a, ll b)
{
    ll lar = max(a, b);
    ll small = min(a, b);
    for (ll i = lar; ; i += lar)
    {
    if (i % small == 0)
        return i;
    }
}
///....................................................................................///

int gcd(ll a,ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
///....................................................................................///

int bsearch(ll arr[],ll l,ll r,ll x)
{
    while (l <= r)
    {
    ll m = l + (r - l) / 2;
    if (arr[m] == x)
    {
        return m;
    }
    if (arr[m] < x)
    {
        l = m + 1;
    }
    else
        r = m - 1;
    }
    return -1;
}

///....................................................................................///

bool isPrime(ll n)
{
    // Corner cases
    if (n <= 1)  return false;
    if (n <= 3)  return true;

    // This is checked so that we can skip
    // middle five numbers in below loop
    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;
}

///....................................................................................///
struct cmp
{
        bool operator()(const int a, const int b)
        {
                return a > b;
        }
};

///....................................................................................///

void bfs(vector<ll>g[],ll dist[],bool v[],ll u)
{
    queue<ll> q;

    q.push(u);
    v[u] = true;
    dist[u]=0;

    while (!q.empty())
    {
        ll f = q.front();
        q.pop();

        // Enqueue all adjacent of f and mark them visited
        for (auto i = g[f].begin(); i != g[f].end(); i++)
        {
            if (!v[*i])
            {
                q.push(*i);
                v[*i] = true;
                dist[*i]=dist[f]+1;
            }
        }
    }
}

///....................................................................................///

void dfs(ll source,ll visited[],vector<ll>graph[],ll l)
{
    visited[source]=l;
    ll i;

    for(i=0;i<graph[source].size();i++)
    {
        if(visited[graph[source][i]]==-1)
            dfs(graph[source][i], visited, graph, l);
    }
}

///....................................................................................///

bool isPerfectSquare(long double x)
{

  long double sr = sqrt(x);

  return ((sr - floor(sr)) == 0);
}

///...................................template ends.................................................///

int main()
{
	fastIO;

    ll ac =0, tle =0, wa =0, re =0;
	OJ()
	{
	    string s;
	    cin>> s;


	    if(s[0] == 'A')
            ac++;
        else if(s[0] == 'T')
            tle++;
        else if(s[0] == 'W')
            wa++;
        else if(s[0] == 'R')
            re++;
	}
	printf("AC x %lld\nWA x %lld\nTLE x %lld\nRE x %lld\n",ac,wa,tle,re);
	return 0;

}


Measured memory_bytes: 3804