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