
#include<bits/stdc++.h>
#define F first
#define S second
#define PB push_back
#define mp make_pair
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define MOD 1000000007
typedef long long ll;
using namespace std;

void FAST() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}

int main(){
	

	ll n; cin>>n; ll a;

map<string,int>mp;
ll counta,countb,countc,countd;
 counta=countb=countc=countd=0;
mp.insert({"AC",counta});
mp.insert({"TLE",countb});
mp.insert({"RE",countc});
mp.insert({"WA",countd});

string s;


REP(i,0,n){
  cin>>s;
if(s=="AC"){
	counta++;
	mp[s]=counta;
}

else if(s=="TLE"){
	countb++;
	mp[s]=countb;
}

else if(s=="RE"){
	countc++;
	mp[s]=countc;
}

else if(s=="WA"){
	countd++;
	mp[s]=countd;
}

}
/*
for(auto i:mp){
	cout<<i.first<<" "<<i.second<<endl;
}*/


cout<<"AC x "<<counta<<endl<<"WA x "<<countd<<endl<<"TLE x "<<countb<<endl<<"RE x "<<countc;
	//cerr<<a<<endl;
	
	