#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  unordered_map<string, long long> freq;
  for (auto i : freq) i.second = 0;
  while (n--) {
    string s;
    cin >> s;
    freq[s]++;
  }
  cout << "AC X " << freq["AC"] << endl;
  cout << "WA X " << freq["WA"] << endl;
  cout << "TLE X " << freq["TLE"] << endl;
  cout << "RE X " << freq["RE"] << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
