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