#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  int a=0,b=0,c=0,d=0;
  while(n--){
   string c;
    cin>>c;
    if(c=="AC"){
      a++;}
    else if(c=="WA"){
    b++;
    }
    else if(c=="TLE"){
    c++;
    }
    else if(c=="RE"){
    d++;
    }
  }
  cout<<"AC"<<" "<<'x'<<" "<<a<<endl;
  cout<<"WA"<<" "<<'x'<<" "<<b<<endl;
  cout<<"TLE"<<" "<<'x'<<" "<<c<<endl;
  cout<<"RE"<<" "<<'x'<<" "<<d<<endl;
  return 0;
}