#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  map<string, int> ans{{"AC", 0}, {"WA", 0}, {"TLE", 0}, {"RE", 0}};
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string key;
    cin >> key;
    ans[key]++;
  }
  for (auto& [key, value] : ans) {
    cout << key << " x " << value << endl;
  }
  return 0;
}
