#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>    // PBDS
#include <ext/pb_ds/tree_policy.hpp>        // PBDS

using namespace std;
using namespace __gnu_pbds;                 // PBDS

/* typedef starts */

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> PBDS_INT;               // PBDS for int
typedef tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> PBDS_LL;    // PBDS for long long

/* typedef ends */

/* macro starts */

#define PI acos(-1)
#define EPS 1e-9
#define fastIO ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define sinD(degree) sin((degree * PI) / 180.0)
#define cosD(degree) cos((degree * PI) / 180.0)
#define tanD(degree) tan((degree * PI) / 180.0)
#define cotD(degree) (1.0 / tanD(degree))
#define secD(degree) (1.0 / cosD(degree))
#define cosecD(degree) (1.0 / sinD(degree))
#define asinD(value) (asin(value) * 180.0) / PI
#define acosD(value) (acos(value) * 180.0) / PI
#define atanD(value) (atan(value) * 180.0) / PI
#define forn(i,n) for(int i=0;i<n;i++)
#define min(a,b) a<b ? a:b
#define max(a,b) a>b ? a:b
#define value_at_index(x) find_by_order(x)
#define index_of(x) order_of_key(x)
#define pb push_back
#define set0(add) memset(add,0,sizeof(add));

/* macro ends */

/* function starts */

/// calculates n-th (0-based) Gray Code
template<typename dataType>
dataType nthGrayCode(dataType n)
{
    return (n ^ (n >> 1));
}

/// generates all possible subsets for the given set
template<typename dataType>
void generateAllSubset(vector<dataType> &data)
{
    int i, j, n;
    n = data.size();

    for (i = 0; i < (1 << n); i++) {
        for (j = 0; j < n; j++) {
            if (i & (1 << j)) {
                cout << data[j] << " ";
            }
        }
        cout << "\n";
    }
}


void swap(int a, int b){
	int temp;
	temp=a;
	a=b;
	b=temp;
}

int fact(int n){
	if(n<=1)
		return 1;
	else 
	return n*fact(n-1);
}

bool compare(const pair<int,int> &a,const pair<int,int> &b){
	return (a.second<b.second);
}



int main()
{
    #ifndef ONLINE_JUDGE
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
    #endif

    fastIO;
    int a;
    cin >> a;
    
    int ac=0,wa=0,tle=0,re=0;
    forn(i,a){
    	string s;
    	cin >> s;
    	
    	if(s[0]=='A')ac++;
    	else if(s[0]=='W')wa++;
    	else if(s[0]=='T')tle++;
    	else if(s[0]=='R')re++;

    }
    cout << "AC X " << ac << endl;

   cout << "WA X " << wa << endl;

   cout << "TLE X " << tle << endl;
   cout << "RE X " << re << endl;
    
   return 0;
   
   
   	}
    
