#include <bits/stdc++.h>
using namespace std;
long long GCD(long long x, long long y) { return y ? GCD(y, x % y) : x; }
int main() {
  int N;
  cin >> N;
  map<string, int> mp;
  mp["AC"] = 0;
  mp["WA"] = 0;
  mp["TLE"] = 0;
  mp["RE"] = 0;
  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;
}
