#include <bits/stdc++.h>
using namespace std;
long long int mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  t = 1;
  while (t--) {
    long long int n;
    cin >> n;
    map<string, long long int> id;
    id["AC"] = 0;
    id["WA"] = 0;
    id["TLE"] = 0;
    id["RE"] = 0;
    while (n--) {
      string x;
      cin >> x;
      id[x] += 1;
    }
    cout << "AC * " << id["AC"] << "\n";
    cout << "WA * " << id["WA"] << "\n";
    cout << "TLE * " << id["TLE"] << "\n";
    cout << "RE * " << id["RE"] << "\n";
  }
  return 0;
}
