#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  map<string, long long> m;
  for (long long i = 0; i < n; i = i + 1) {
    string s;
    cin >> s;
    m[s]++;
  }
  cout << "AC X " << m["AC"] << endl;
  cout << "WA X " << m["WA"] << endl;
  cout << "TLE X " << m["TLE"] << endl;
  cout << "RE X " << m["RE"] << endl;
}
