#include<bits/stdc++.h>
#define endl "\n" 
#define pi acos(-1)
#define ll long long 
using namespace std;
void solve();
int main(){
	att();//sirra();
	int q=1;//cin>>q;
	while(q--){
		solve();
	}
}
void solve(){
	int n,ac(0),wa(0),tle(0),re(0);
  	string s1("AC"),s2("WA"),s3("TLE"),s4("RE"),s;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>s;
    if(s==s1)
      ac++;
    else if(s==s2)
      wa++;
    else if(s==s3)
      tle++;
    else
      re++;
  }
  cout<<s1<<" x "<<ac<<endl;
  cout<<s2<<" x "<<wa<<endl;
  cout<<s3<<" x "<<tle<<endl;
  cout<<s4<<" x "<<re<<endl;
}