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