#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1001001001;
int main() {
  int n;
  cin >> n;
  string s[n];
  for (int i = 0; i < (int)(n); i++) cin >> s[i];
  int counter[4] = {0, 0, 0, 0};
  string ans[4] = {"AC", "WA", "TLE", "RE"};
  for (int i = 0; i < (int)(n); i++) {
    for (int j = 0; j < (int)(4); j++) {
      if (ans[j] == s[i]) {
        counter[j]++;
      }
    }
  }
  cout << "AC x " << counter[0] << endl;
  cout << "WA x　" << counter[1] << endl;
  cout << "TLE x " << counter[2] << endl;
  cout << "RE x " << counter[3] << endl;
  return 0;
}
