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