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