#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string str;
  int a = 0, b = 0, c = 0, d = 0;
  for (int i = 0; i < n; i++) {
    cin >> str;
    if (str == "AC")
      a++;
    else if (str == "WA")
      b++;
    else if (str == "TLE")
      c++;
    else if (str == "RE")
      d++;
    else
      continue;
  }
  cout << "AC x" << a << endl;
  cout << "WA x" << b << endl;
  cout << "TLE x" << c << endl;
  cout << "RE x" << d << endl;
}
