#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  unordered_map<string, int> _map;
  _map.insert(pair<string, int>("AC", 0));
  _map.insert(pair<string, int>("WA", 0));
  _map.insert(pair<string, int>("TLE", 0));
  _map.insert(pair<string, int>("RE", 0));
  cin >> n;
  while (n--) {
    cin >> s;
    if (_map.find(s) != _map.end())
      _map[s]++;
    else
      _map[s] = 1;
  }
  for (auto it = _map.begin(); it != _map.end(); ++it)
    cout << it->first << " x " << it->second << endl;
  return 0;
}
