#include <bits/stdc++.h>
using namespace std;
string a[4] = {"AC", "TLE", "WA", "RE"};
int main(int argc, char const *argv[]) {
  int n;
  string str;
  int ans[4] = {0};
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> str;
    for (int j = 0; j < 4; j++) {
      if (str == a[j]) {
        ans[j]++;
      }
    }
  }
  for (int i = 0; i < 4; i++) {
    cout << a[i] << ' x ' << ans[i] << endl;
  }
  return 0;
}
