#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <iostream>
#include <string>
#include <vector>
#include <map>

using namespace std;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int n;
    cin >> n;
    string tmp;
    map<string, int> cases;
    for(int i = 0; i < n; ++i){
        cin >> tmp;
        cases[tmp]++;
    }
    vector<string> outputs {"AC", "WA", "TLE", "RE"};
    for(auto&& key : outputs){
        cout << key << " x " << cases[key] << endl;
    }
    return 0;