#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i;
  cin >> n;
  string s;
  map<string, long long int> mp;
  mp["AC"] = 0;
  mp["TLE"] = 0;
  mp["RE"] = 0;
  mp["WA"] = 0;
  for (i = 0; i < n; i++) 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;
}
