#include <iostream>
#include <string>
using namespace std;
int main(){
  int n; cin >> n;
  map<string, int> re;
  while(n--){
    string s; cin >> s;
    ++re[s];
  }
  cout << "AC x " <<re["AC"] << "\n"; 
  cout << "WA x " <<re["WA"] << "\n";
  cout << "TLE x " <<re["TLE"] << "\n";
  cout << "RE x " <<re["RE"] << "\n";
}