#include <bits/stdc++.h>
using namespace std;
 
main () {
    int n; cin >> n;
    int ans[4] = {};

    string temp;
    while (n--){
        cin >> temp;
        switch (temp){
        case "AC":
            a[0]++;
            break;
        
        case "WA":
            a[1]++;
            break;

        case "TLE":
            a[2]++;
            break;
        
        default:
            a[3]++;
            break;
        }
    }
    cout << "AC x " << a[0] << endl;
    cout << "WA x " << a[1] << endl;
    cout << "TLE x " << a[2] << endl;
    cout << "RE x " << a[3];
}