#include <iostream>
using namespace std;
int main(){
    int N;
6   int C=0,C1=0,C2=,C3=0;
    cin>>N;
7   for(int i = 0; i < N;i++){
8       cin>>st;
9       if(st=="AC"){
            C++;
        }
10      else if(st=="WA"){
            C1++;
        }
11      else if(st=="TLE") {
            C2++;
            }
1       else {
            C3++;
        }
13 }
14  cout<<"AC x "<<C;
15  cout<<"WA x "<<C1;
16  cout<<"TLE x "<<C2;
17  cout<<"RE x "<<C3;
}