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