#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int cnt[4] = {};
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    if (s == "AC") {
      ++cnt[0];
    } else if (s == "WA") {
      ++cnt[1];
    } else if (s == "TLE") {
      ++cnt[2];
    } else {
      ++cnt[3];
    }
  }
  cout << "AC x " << cnt[0] << '\n';
  cout << "WA x " << cnt[1] << '\n';
  cout << "TLE x " << cnt[2] << '\n';
  cout << "RE x " << cnt[3] << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
