#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main()
{
    int n;
    cin >> n;
    vector<string> s(n);
    rep(i, n) cin >> s[i];
    int c0 = 0, c1 = 0, c2 = 0, c3 = 0;
    rep(i, n) {
        if (s[i] == "AC") c0++;
        if (s[i] == "WA") c1++;
        if (s[i] == "TLE") c2++;
        if (s[i] == "RE") c3++;
    }
    cout << "AC x " << c0 << endl;
    cout << "WA x " << c1 << endl;
    cout << "TLE x " << c2 << endl;
    cout << "RE x " << c3 << endl;
    return 0;