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