#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  string s;
  map<string, int> status = {{"AC", 0}, {"WA", 0}, {"TLE", 0}, {"RE", 0}};
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    status[s]++;
  }
  for (map<string, int>::iterator it = status.begin(); it != status.end();
       ++it) {
    cout << it->first << " x " << it->second << '\n';
  }
  return 0;
}
