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

using namespace std;
using namespace __gnu_pbds;
 
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
 
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef long double ld; 
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	int n; cin>>n;
	map<string,int> ma;
	while(n--)
	{
		string s; cin>>s; ma[s]++;
	}
	cout<<"AC x "<<ma["AC"]<<'\n';
	cout<<"WA x "<<ma["WA"]<<'\n';
	cout<<"TLE x "<<ma["TLE"]<<'\n';
	cout<<"RTE x "<<ma["RTE"]<<'\n';
}
