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