#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  cin >> t;
  vector<long long int> v;
  long long int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
  while (t--) {
    string s;
    cin >> s;
    if (s.length() == 2) {
      if (s[0] == 'A' && s[1] == 'C') {
        c1 += 1;
      } else if (s[0] == 'W' && s[1] == 'A') {
        c2 += 1;
      } else if (s[0] == 'R' && s[1] == 'E') {
        c4 += 1;
      }
    } else if (s.length() == 3) {
      if (s[0] == 'T' && s[1] == 'L' && s[2] == 'E') {
        c3 += 1;
      }
    }
  }
  cout << "AC X " << c1 << endl;
  cout << "WA X " << c2 << endl;
  cout << "TLE X " << c3 << endl;
  cout << "RE X " << c4 << endl;
}
