#include <bits/stdc++.h>
using namespace std;
void hi() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
void bye() {}
void solve() {
  long long n, ans = 0;
  cin >> n;
  string s;
  map<string, long long> m;
  m["AC"] = 0, m["WA"] = 0, m["TLE"] = 0, m["RE"] = 0;
  for (int i = 0; i < n; i++) {
    cin >> s;
    m[s]++;
  }
  cout << "AC * " << m["AC"] << "\n";
  cout << "WA * " << m["WA"] << "\n";
  cout << "TLE * " << m["TLE"] << "\n";
  cout << "RE * " << m["RE"] << "\n";
}
int main() {
  hi();
  long long test_cases = 1;
  for (long long t = 1; t <= test_cases; t++) {
    solve();
  }
  bye();
  return 0;
}
