#include <bits/stdc++.h>
using namespace std;
template <class T>
void printVector(const vector<T>& v) {
  for (T& i : v) {
    cout << i << " ";
  }
  cout << endl;
}
template <class T>
void printVectorsOfVector(const vector<vector<T>>& v) {
  cout << " [ " << endl;
  for (size_t i = 0; i < v.size(); i++) {
    cout << "  ";
    cout << " [ ";
    for (size_t j = 0; j < v[i].size(); j++) {
      cout << v[i][j];
      if (j != v[i].size() - 1) cout << " , ";
    }
    cout << " ] ";
    cout << endl;
  }
  cout << " [ ";
  cout << endl;
}
static int __ = []() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::cout.tie(nullptr);
  return 0;
}();
int main() {
  int t = 0;
  cin >> t;
  int arr[4];
  while (t--) {
    string v;
    cin >> v;
    if (v == "AC")
      arr[0]++;
    else if (v == "WA")
      arr[1]++;
    else if (v == "TLE")
      arr[2]++;
    else if (v == "RE")
      arr[3]++;
  }
  cout << "AC x " << arr[0] << endl;
  cout << "WA x " << arr[1] << endl;
  cout << "TLE x " << arr[2] << endl;
  cout << "RE x " << arr[3] << endl;
  return 0;
}
