#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  int c = 0, d = 0, e = 0, f = 0;
  cin >> n;
  string s;
  while (n--) {
    cin >> s;
    if (s[0] == 'A' && s[1] == 'C') {
      c++;
    } else if (s[0] == 'W' && s[1] == 'A') {
      d++;
    } else if (s[0] == 'T' && s[1] == 'L' && s[2] == 'E') {
      e++;
    } else if (s[0] == 'R' && s[1] == 'E') {
      f++;
    }
  }
  cout << "AC x " << c << endl;
  cout << "WA x" << d << endl;
  cout << "TLE x " << e << endl;
  cout << "RE x " << f << endl;
  return 0;
}
