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