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