#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string input;
  unordered_map<string, int> res;
  res["AC"] = res["WA"] = res["TLE"] = res["RE"] = 0;
  for (int i = 0; i < n; ++i) {
    cin >> input;
    res[input]++;
  }
  for (auto r : res) cout << r.first << " x " << r.second << '\n';
  return 0;
}
