#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int test = 1;
  while (test--) {
    int n;
    cin >> n;
    vector<string> vec(n);
    int i;
    for (i = 0; i < n; i++) cin >> vec[i];
    int ac = count(vec.begin(), vec.end(), "AC");
    int wa = count(vec.begin(), vec.end(), "WA");
    int tle = count(vec.begin(), vec.end(), "TLE");
    int re = count(vec.begin(), vec.end(), "RE");
    cout << "AC x " << ac << "\n"
         << "WA x " << wa << "\n"
         << "TLE X " << tle << "\n"
         << "RE X " << re;
  }
  return 0;
}
