#include<bits/stdc++.h>
#define rep(i, x, n) for(int i = x; i < n; i++)
#define repr(i, x, n) for(int i = x; i > n; i--)
#define pii pair<int,int>
#define ll long long
const long long iinf = 1e18;
const int inf = 1e9;
const int MOD = (1e6+3);
int dir4[4][2] = {{1,0},{-1,0},{0,1},{0,-1}};
int knight[8][2] = {{2,1},{2,-1},{-2,1},{-2,-1},{1,2},{-1,2},{1,-2},{-1,-2}};

using namespace std;

void solve()
{
    int n; cin >> n;
    map<string, n> mp;
    for(int i = 1; i <= n; i++){
        string s; cin >> s;
        mp[s]++;
    }
    cout << "AC x " << mp["AC"] << "\n";
    cout << "WA x " << mp["WA"] << "\n";
    cout << "TLE x " << mp["TLE"] << "\n";
    cout << "RE x " << mp["RE"] << "\n";
    
}
//new line is printed in main()

int main()
{
    int t = 1;
        // cin >> t; // comment out if no test case is required
    int i = 1;
    while(t--){
        //cout << "Case " << i++ << ": ";
        solve();
        // printf("\n");
    }
    return 0;
}
