#include <bits/stdc++.h>
#include <complex.h>
#include <math.h>
#include <iostream>
#include <ext/pb_ds/assoc_container.hpp> //required
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
using namespace std;
#define int ll
// fendwick tree
//#include <ext / pb_ds / assoc_container.hpp> //required
//#include <ext/pb_ds/tree_policy.hpp>         //required
using namespace __gnu_pbds; //required
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

ordered_set<int> s;
ordered_set<int>::iterator itr;
// fendwick tree
/*
ll ans[200005];
void fun(ll a, ll b, ll c)
{
    //ll val = 1;

    while (a <= b)
    {
        ans[a] += c;
        ll p = -a;
        a += (a & p);
    }
}
ll find1(ll a)
{
    ll sum = 0;
    while (a != 0)
    {
        sum += ans[a];
        ll p = -a;
        a -= (a & p);
    }
    return sum;
}*/
int fastexpo(int a, int b, int m)
{
    int ans = 1;
    while (b)
    {
        if (b & 1)
            ans = (ans * a) % m;
        b = b / 2;
        a = (a * a) % m;
    }
    return ans;
}
int32_t main()
{
    int n;
    cin >> n;
    int a[4] = {0};
    for (int i = 0; i < n; i++)
    {
        string temp;
        cin >> temp;
        if (temp == "AC")
        {
            a[0]++;
        }
        if (temp == "TLE")
        {
            a[1]++;
        }
        if (temp == "WA")
        {
            a[2]++;
        }
        if (temp == "RE")
        {
            a[3]++;
        }
    }
    cout << "AC * " << a[0] << "\n";
    cout << "WA * " << a[2] << "\n";
    cout << "TLE * " << a[1] << "\n";
    cout << "RE * " << a[3] << "\n";
    return 0;
}
//ACx10