#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<string, int> m = {{"AC", 0}, {"WA", 0}, {"TLE", 0}, {"RE", 0}};
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    m[s]++;
  }
  for (auto const& it : m) {
    cout << it.first << " x " << it.second << endl;
  }
}
