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