#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define MOD 1000000007
#define ll long long
#define int long long 
# define INF 2e5+5
#define ar array
# define fr first
# define sc second
#define wt(x) int x;cin>>x;while(x--)
#define watch(x) cerr << "\n" << (#x) << " is " << (x) << endl
//#define cerr if(false)cerr
typedef tree<pair<int,int>,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update> pbds;

void  c_p_c(){
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
 
#ifndef ONLINE_JUDGE
  freopen("input1.txt","r",stdin);
  freopen("output1.txt","w",stdout);
#endif
 }
 
int power(int a,int b,int mod){
    a=a%mod;
    if(a==0){
        return 1;
    }
    int res=1;
    while(b){
        if(b&1){
            res=(res*a)%mod;
        }
        b>>=1;
        a=(a*a)%mod;
    }
    return res;
 }
 
int  MMI(int p){
    return power(p,MOD-2,MOD);
}


int32_t main()
{
    
    c_p_c();
   
         int n;
         cin>>n;
        vector<int>v(4,0);
         for(int i=0;i<n;i++){
            string s;
            cin>>s;
            if(s=="AC")v[0]++;
            if(s=="WA")v[1]++;
            if(s=="TLE")v[2]++;
            if(s=="RA")v[3]++;
         }
         cout<<"AC x "<<v[0]<<"\n";
         cout<<"WA x "<<v[1]<<"\n";
         cout<<"TLE x "<<v[2]<<"\n";
         cout<<"RA x "<<v[3]<<"\n";

         


             
     return 0;
}
 
