#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int count[4] = {};
  vector<string> S(N);
  for (int i = 0; i < N; i++) {
    cin >> S.at(i);
    if (S.at(i) == "AC")
      count[0]++;
    else if (S.at(i) == "WA")
      count[1]++;
    else if (S.at(i) == "TLE")
      count[2]++;
    else if (S.at(i) == "RE")
      count[3]++;
  }
  cout << "AC x " << count[0] << endl;
  cout << "WA x " << count[1] << endl;
  cout << "TEL x " << count[2] << endl;
  cout << "RE x " << count[3] << endl;
  return 0;
}
