#include <bits/stdc++.h>
using namespace std;
void solve() {
  vector<pair<string, int> > v(4);
  for (int i = 0; i < 4; ++i) {
    v[0].first = "AC";
    v[0].second = 0;
    v[1].first = "WA";
    v[1].second = 0;
    v[2].first = "TLE";
    v[2].second = 0;
    v[3].first = "RE";
    v[3].second = 0;
  }
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    if (s == v[0].first) v[0].second++;
    if (s == v[1].first) v[1].second++;
    if (s == v[2].first) v[2].second++;
    if (s == v[3].first) v[3].second++;
  }
  for (int i = 0; i < 4; ++i) {
    cout << v[i].first << " " << v[i].second << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  solve();
}
