#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, int> my_map;
  my_map.insert(pair<string, int>("AC", 0));
  my_map.insert(pair<string, int>("WA", 0));
  my_map.insert(pair<string, int>("TLE", 0));
  my_map.insert(pair<string, int>("RE", 0));
  int n;
  cin >> n;
  string tocmp;
  while (cin >> tocmp) {
    my_map[tocmp] += 1;
  }
  for (auto elem : my_map) {
    cout << elem.first << " x " << elem.second << endl;
  }
}
