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