#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  string a[] = {"AC", "WA", "TLE", "RE"};
  vector<long long int> b(4, 0);
  map<string, int> mp;
  for (int i = 0; i < 4; i++) mp[a[i]] = i;
  int n, i;
  string x;
  cin >> n;
  for (i = 0; i < n; i++) cin >> x, b[mp[x]]++;
  for (i = 0; i < 4; i++) cout << a[i] << " " << b[i] << endl;
}
