#include <bits/stdc++.h>
using namespace std;
int solve() {
  long long int n, x, wa = 0, ac = 0, tle = 0, re = 0;
  cin >> n;
  for (long long int i = long long int(0); i < long long int(n); ++i) {
    string s;
    cin >> s;
    if (s == "WA")
      wa++;
    else if (s == "AC")
      ac++;
    else if (s == "TLE")
      tle++;
    else
      re++;
  }
  string sac = "AC X ", swa = "WA X ", stle = "TLE X ", sre = "RE X ";
  cout << sac << ac << "\n";
  cout << swa << wa << "\n";
  cout << stle << tle << "\n";
  cout << sre << re << "\n";
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t = 1;
  for (long long int f = long long int(0); f < long long int(t); ++f) {
    solve();
  }
}
