#include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;

int main() {
  unordered_map<string, int> u_map;
  u_map["AC"] = 0;
  u_map["WA"] = 0;
  u_map["TLE"] = 0;
  u_map["RE"] = 0;
  
  int N;
  string s;
  
  cin >> N;
  
  for (int i = 0; i < N; ++i) {
    cin >> s;
    u_map[s]++;
  }
  
  print_times("AC", u_map);
  print_times("WA", u_map);
  print_times("TLE", u_map);
  print_times("RE", u_map);
  
  return 0;
}

void print_times(string s, unordered_map<string, int> &u_map) {
  cout << s << " x " << u_map[s] << endl;
}