#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
using u64 = uint64_t;
using u128 = __uint128_t;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
void solve() {
  int n;
  cin >> n;
  map<string, int> mp;
  mp["AC"] = 0, mp["TLE"] = 0, mp["WA"] = 0, mp["RE"] = 0;
  while (n--) {
    string str;
    cin >> str;
    mp[str]++;
  }
  cout << "AC"
       << " * " << mp["AC"] << '\n';
  cout << "WA"
       << " * " << mp["WA"] << '\n';
  cout << "TLE"
       << " * " << mp["TLE"] << '\n';
  cout << "RE"
       << " * " << mp["RE"] << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  solve();
  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << "s.\n";
  return 0;
}
