#include <bits/stdc++.h>
using namespace std;
int main() {
  long n;
  cin >> n;
  unordered_map<string, long> mapa(
      {{"AC", 0}, {"WA", 0}, {"TLE", 0}, {"RE", 0}});
  while (n--) {
    string temp;
    cin >> temp;
    mapa[temp]++;
  }
  for (auto i : mapa) {
    cout << i.first << " x " << i.second << endl;
  }
}
