#include<iostream> 
#include<stdio.h>
#include<string>
#include<iomanip> 
#include<vector> 
#include<map> 
#include<set> 
#include<algorithm> 
#include<numeric> 
#include<limits> 
#include<bitset> 
#include<functional> 
#include<type_traits> 
#include<queue> 
#include<stack> 
#include<array> 
#include<random> 
#include<utility> 
#include<cstdlib> 
#include<ctime>
//#define _LIBCPP_DEBUG 0
//#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define all(a) (a).begin(),(a),end()
#define rep(i,n) for (int i = 0; i < (n); ++i)	
//setprecision(16)

void outi(int x) { cout << x << endl; }
void outl(ll x) { cout << x << endl; }
void outs(string x) { cout << x << endl; }
ll max(ll a, ll b) {
	ll max;
	if (a > b) max = a;
	else max = b;
	return max;
}
ll min(ll a, ll b) {
	ll min;
	if (a < b) min = a;
	else min = b;
	return min;
}
int gcd(int x, int y) {
	/*最大公約数 O(log MAX_X)*/
	if (y == 0) return x;
	return gcd(y, x % y);
}
//---------------------------------------------------------------

int main() {

	int n;
	cin >> n;
	string s;
	rep(i, n) {
		cin >> s[i];
	}

	int countAC = 0;
	int countWA = 0;
	int countTLE = 0;
	int countRE = 0;

	rep(i, n) {
		if (s[i] == "AC") {
			countAC++;
		}
		if (s[i] == "WA") {
			countWA++;
		}
		if (s[i] == "TLE") {
			countTLE++;
		}
		if (s[i] == "RE") {
			countRE++;
		}
	}
	cout << "AC x " << countAC <<endl;
	cout << "WA x " << countWA << endl;
	cout << "TLE x " << countTLE << endl;
	cout << "RE x " << countRE << endl;
}