#include <bits/stdc++.h>
using namespace std;
void b_judge_status_summary(void) {
  int n;
  string s[10000];
  cin >> n;
  for (int i = 0; i < n; i++) cin >> s[i];
  int ac_cnt = 0;
  int wa_cnt = 0;
  int tle_cnt = 0;
  int re_cnt = 0;
  for (int i = 0; i < n; i++) {
    string ss = s[i];
    if (ss[0] == 'A')
      ac_cnt++;
    else if (ss[0] == 'W')
      wa_cnt++;
    else if (ss[0] == 'T')
      tle_cnt++;
    else
      re_cnt++;
  }
  cout << "AC x " << ac_cnt << endl;
  cout << "WA x " << wa_cnt << endl;
  cout << "TLE x " << tle_cnt << endl;
  cout << "RE x " << re_cnt << endl;
}
int main() {
  b_judge_status_summary();
  return 0;
}
