#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10, MOD = 1e9 + 7, INF = 1e9 + 5;
map<string, int> cnt;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  string str;
  cin >> n;
  while (n--) {
    cin >> str;
    cnt[str]++;
  }
  cout << "AC * " << cnt["AC"] << '\n'
       << "WA * " << cnt["WA"] << '\n'
       << "TLE * " << cnt["TLE"] << '\n'
       << "RE * " << cnt["RE"] << '\n';
}
