#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  string s;
  scanf("%d", &n);
  int a = 0, b = 0, c = 0, d = 0;
  while (n--) {
    cin >> s;
    if (s[0] == 'A') {
      a++;
    } else if (s[0] = 'W') {
      b++;
    } else if (s[0] == 'T') {
      c++;
    } else if (s[0] == 'R') {
      d++;
    }
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << b << endl;
  cout << "TLE x " << c << endl;
  cout << "RE x " << d << endl;
  return 0;
}
