#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  vector<pair<string, int>> v;
  v.push_back(make_pair("AC", 0));
  v.push_back(make_pair("WA", 0));
  v.push_back(make_pair("TLE", 0));
  v.push_back(make_pair("RE", 0));
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (s == "AC")
      v[0].second++;
    else if (s == "WA")
      v[1].second++;
    else if (s == "TLE")
      v[2].second++;
    else if (s == "RA")
      v[3].second++;
  }
  for (int i = 0; i < 4; i++) {
    cout << v[i].first << " x " << v[i].second;
    if (i < 3) {
      cout << endl;
    }
  }
  return 0;
}
