#include <iostream>
#include <limits>
#include <numeric>
#include <string>
#include <algorithm>
#include <map>
using namespace std;
#define INF 100000000
int main(){
    int N;
    cin >> N;
    map<string, int> mp;

    REP(i, N){
        string str;
        cin >> str;
        mp[str]++;
    }

    cout << "AC" << " x " << mp["AC"] << endl;
    cout << "WA" << " x " << mp["WA"] << endl;
    cout << "TLE" << " x " << mp["TLE"] << endl;
    cout << "RA" << " x " << mp["RA"] << endl;

    return 0;
}