#include<iostream>
using namespace std;
 
int main(){
  int N;
  cin >> N;
  
  int ans[N];
  for(int i = 0; i < N; i++) cin >> ans[i];
  
  int count_ac, count_wa, count_tle, count_re;
  count_ac=0;
  count_wa=0;
  count_tle=0;
  count_re=0;
  
  for(int i = 0; i < N; i++){
    if(ans[i] == "AC"){
      count_ac++;
    }
    if(ans[i] == "WA"){
      count_wa++;
    }
    if(ans[i] == "TLE"){
      count_tle++;
    }
    if(ans[i] == "RE"){
      count_re++;
    }
  }
  
  cout << "AC" << "x" << count_ac << endl;
  cout << "WA" << "x" << count_wa << endl;
  cout << "TLE" << "x" << count_tle << endl;
  cout << "RE" << "x" << count_re << endl;
  return 0;
}