#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(a) (long long)((a).size())
const double pi = 3.14159265358979323846;

int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);

    ll n;
    cin>>n;
    ll i,j;
    vector<string> s(n);
    map<string,ll> mp;
    for(i=0;i<n;i++) cin>>s[i], mp[s[i]]++;
    cout<<"AC X "<<mp["AC"]<<"\n";
    cout<<"WA X "<<mp["WA"]<<"\n";
    cout<<"TLE X "<<mp["TLE"]<<"\n";
    cout<<"RE X "<<mp["RE"]; 
}