#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  unordered_map<string, int> mp;
  mp["AC"] = 0;
  mp["RE"] = 0;
  mp["TLE"] = 0;
  mp["WA"] = 0;
  while (N--) {
    string s;
    cin >> s;
    mp[s]++;
  }
  for (auto m : mp) {
    cout << m.first << "x" << m.second << endl;
  }
  return 0;
}
