#include <bits/stdc++.h>
using namespace std;
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 << "TLEa x " << mp["TLE"] << endl;
  cout << "RE x " << mp["RE"] << endl;
}
