#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int C0, C1, C2, C3;
  C0 = C1 = C2 = C3 = 0;
  cin >> N;
  vector<string> S(N);
  for (int i = 0; i < N; i++) {
    cin >> S.at(i);
  }
  for (int j = 0; j < N; j++) {
    if (S.at(j) == "AC") {
      C0 = C0 + 1;
    } else if (S.at(j) == "WA") {
      C1 = C1 + 1;
    } else if (S.at(j) == "TLE") {
      C2 = C2 + 1;
    } else if (S.at(j) == "WA") {
      C3 = C3 + 1;
    }
  }
  cout << "AC"
       << " "
       << "x"
       << " " << C0 << endl;
  cout << "WA"
       << " "
       << "x"
       << " " << C1 << endl;
  cout << "TLE"
       << " "
       << "x"
       << " " << C2 << endl;
  cout << "RE"
       << " "
       << "x"
       << " " << C3 << endl;
}
