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