#include <bits/stdc++.h>
struct Vector {
  double x, y;
};
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
using namespace std;
int main() {
  int N, i;
  string S;
  cin >> N;
  vector<int> result = {0, 0, 0, 0};
  vector<string> judge = {"AC", "WA", "TLE", "RE"};
  for (int i = (int)(0); i < (int)(N); i++) {
    cin >> S;
    if ("AC" == S) result[0] += 1;
    if ("WA" == S) result[1] += 1;
    if ("TLE" == S) result[2] += 1;
    if ("RE" == S) result[3] += 1;
  }
  for (int i = (int)(0); i < (int)(4); i++)
    cout << judge[i] << " " << result[i] << endl;
  return 0;
}
