#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef vector<int> vi;
const int MX = 2e5 + 5;
#define f(i, x, n) for (int i = x; i < n; i++)
#define int long long
#define w(t)  \
    int t;    \
    cin >> t; \
    while (t--)
#define pb push_back
#define endl "\n"
#define yes cout << "YES" << endl
#define no cout << "NO" << endl

int32_t main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    // online submission
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int t, a, b, c = 0, d = 0, e = 0, f = ­0;
    cin >> t;
    while (t--)
    {
        string s;
        cin >> s;
        if (s == "AC")
            c++;
        else if (s == "WA")
            d++;
        else if (s == "TLE")
            e++;
        else
            f++;
    }
    cout << "AC x " << c << endl;
    cout << "WA x " << d << endl;
    cout << "TLE x " << e << endl;
    cout << "RE x " << f << endl;

    return 0;
}
