#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  int c_0 = 0, c_1 = 0, c_2 = 0, c_3 = 0;
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (s == "AC")
      ++c_0;
    else if (s == "WA")
      ++c_1;
    else if (s == "TLE")
      ++c_2;
    else if (s == "RE")
      ++c_3;
  }
  cout << "AC X " << c_0 << endl;
  cout << "WA X " << c_1 << endl;
  cout << "TLE X " << c_2 << endl;
  cout << "RE X " << c_3 << endl;
  return 0;
}
