/**
 *    author: gxfireball       
**/
#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); 
using namespace std;

void solve(){
   int n;
   cin>>n;
   string str;
   int c0=0,c1=0,c2=0,c3=0;
   while(n--){
       cin>>str;
       if(str == "AC"){
           c0++;
       }
       if(str=="WA"){
           c1++;
       }
       if(str=="TLE"){
           c2++;
       }
       if(str=="RE"){
           c3++;
       }
   }

   cout<<"AC x "<<c0<<endl;
   cout<<"WA x "<<c1<<endl;
   cout<<"TLE x "<<c2<<endl;
   cout<<"RE x "<<c3<<endl;

}

int main(){
    fastio;
    int t;
    t = 1;
    //cin>>t;
    while(t--){
    	solve();