#include <bits/stdc++.h>
typedef struct infomation {
  std::string S;
  int count;
} judg;
int main() {
  int N, i, j;
  std::string S;
  std::vector<judg> ans = {{"AC", 0}, {"WA", 0}, {"TLE", 0}, {"RE", 0}};
  std::cin >> N;
  for (i = 0; i < N; i++) {
    std::cin >> S;
    j = -1;
    while (S != ans.at(++j).S)
      ;
    ans.at(j).count++;
  }
  for (i = 0; i < 4; i++) {
    std::cout << ans.at(i).S << " × " << ans.at(i).count << std::endl;
  }
  return 0;
}
