#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main(void) {
  int n;
  cin >> n;
  int a[n];
  string b[4] = {"AC", "WA", "TLE", "RE"};
  for (int i = 0; i < (int)(n); i++) {
    string tmp;
    cin >> tmp;
    if (tmp == "AC")
      a[0]++;
    else if (tmp == "WA")
      a[1]++;
    else if (tmp == "TLE")
      a[2]++;
    else if (tmp == "RE")
      a[3]++;
  }
  for (int i = 0; i < (int)(4); i++) {
    cout << b[i] << " x " << a[i] << endl;
  }
  return 0;
}
