#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<string, int> freq;
  freq["AC"] = 0;
  freq["WA"] = 0;
  freq["TLE"] = 0;
  freq["RE"] = 0;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    freq[s]++;
  }
  for (auto i = freq.begin(); i != freq.end(); i++) {
    cout << i->first << " x " << i->second << endl;
  }
  return 0;
}
