#include <bits/stdc++.h>
int main() {
  using namespace std;
  long n, a = 0, b = 0, c = 0, d = 0;
  char s[5], sa[] = "AC", sb[] = "WA", sc[] = "TLE", sd[] = "RE";
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    if (strcmp(s, sa) == 0) a++;
    if (strcmp(s, sb) == 0) b++;
    if (strcmp(s, sc) == 0) c++;
    if (strcmp(s, sd) == 0) d++;
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << b << endl;
  cout << "TLE x " << c << endl;
  cout << "RE x " << d << endl;
  return 0;
}
