#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  int a = 0, b = 0, c = 0, d = 0;
  for (int i0 = 0; i0 < t; i0++) {
    string s;
    cin >> s;
    if (s.size() == 3) {
      c++;
    } else {
      if (s[0] == 'A') {
        a++;
      } else if (s[0] == 'W') {
        b++;
      } else if (s[0] == 'R') {
        c++;
      }
    }
  }
  cout << "AC x " << a << endl;
  cout << "WA x " << b << endl;
  cout << "TLE x " << c << endl;
  cout << "RE x " << d << endl;
  return 0;
}
