#include <bits/stdc++.h>
using namespace std;
long long n, test, p[4];
string s, st[4];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  test = 1;
  st[0] = "AC";
  st[1] = "WA";
  st[2] = "TLE";
  st[3] = "RE";
  while (test--) {
    cin >> n;
    for (int i = 1; i <= n; i++) {
      cin >> s;
      for (int i = 0; i < 4; i++)
        if (s == st[i]) p[i]++;
    }
    for (int i = 0; i < 4; i++) cout << st[i] << " " << p[i] << endl;
  }
}
