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