#include <bits/stdc++.h>
using namespace std;
map<string, int> cnt;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0);
  cout.precision(10);
  cout << fixed;
  int n;
  cin >> n;
  while (n--) {
    string s;
    cin >> s;
    cnt[s]++;
  }
  cout << "AC x " << cnt["AC"] << "\n";
  cout << "WA x " << cnt["WA"] << "\n";
  cout << "TLE x " << cnt["TLE"] << "\n";
  cout << "RE x " << cnt["RTE"] << "\n";
  return 0;
}
