#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
#define setbits(x)      __builtin_popcountll(x)
#define mod             1000000007
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll              long long 
#define inf          1e18
#define pre(y,x)        fixed<<setprecision(y)<<x
#define debug(x)        cerr << "[" << #x << ": " << (x) << "]\n";
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

int main()
{
		FIO;
//		ll t; cin>>t;
//		while(t--)
//		{
			int n; cin>>n;
			map<string,int> mp{{"AC",0},{"WA",1 }, {"TLE",2 },{"RE",3} };
			int c[4]={};
			for(int i=0;i<n;i++){
				string s; cin>>s;
				c[mp[s]]++;
			}
			for(int i=0;i<4;i++){
				for(auto a:mp)
					if(i == a.second)
						cout<<a.first;
		
				cout<<" X "<<c[i]<<endl;
			}
//		}
		return 0; 
}