#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  unordered_map<string, int> ans;
  int iterations;
  cin >> iterations;
  string input;
  ans.insert({"AC", 0});
  ans.insert({"WA", 0});
  ans.insert({"TLE", 0});
  ans.insert({"RE", 0});
  for (int i = 0; i < iterations; i++) {
    cin >> input;
    ans[input]++;
  }
  for (auto pos = ans.begin(); pos != ans.end(); ++pos) {
    cout << pos->first << " x " << pos->second << endl;
  }
}
