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