#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
using pii = pair<int, int>;
int main() {
  map<string, int> ans;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string temp;
    cin >> temp;
    ans[temp]++;
  }
  string str[] = {"AC", "WA", "TLE", "RE"};
  for (int i = 0; i < 4; i++) {
    cout << str[i] << " * " << ans[str[i]] << endl;
  }
}
