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