#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vs = vector<string>;
using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vpi = vector<pair<int, int>>;
using vpl = vector<pair<ll, ll>>;
using ld = double;
const int MAX = INT_MAX;
int main() {
  int N;
  cin >> N;
  map<string, int> cnt;
  for (int i = 0; i < N; ++i) {
    string second;
    cin >> second;
    cnt[second] += 1;
  }
  cout << "AC"
       << " * " << cnt["AC"] << endl;
  cout << "WA"
       << " * " << cnt["WA"] << endl;
  cout << "TLE"
       << " * " << cnt["TLE"] << endl;
  cout << "RE"
       << " * " << cnt["RE"] << endl;
  return 0;
}
