#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, i, ac, tle, re, wa;
  cin >> n;
  vector<string> a(n);
  for (i = 0; i < n; i++) {
    cin >> a[i];
    ac = count(a.begin(), a.end(), "AC");
    tle = count(a.begin(), a.end(), "TLE");
    re = count(a.begin(), a.end(), "RE");
    wa = count(a.begin(), a.end(), "WA");
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
  return 0;
}
