#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S[N];
  cin >> N;
  map<string, int> ans_num;
  string ans[] = {"AC", "WA", "TLE", "RE"};
  for (int i = 0; i < 4; i++) {
    ans_num[ans[i]] = 0;
  }
  for (int i = 0; i < N; i++) {
    cin >> S[i];
    if (S[i] == "AC") {
      ans_num[ans[0]] += 1;
    } else if (S[i] == "WA") {
      ans_num[ans[1]] += 1;
    } else if (S[i] == "TLE") {
      ans_num[ans[2]] += 1;
    } else if (S[i] == "RE") {
      ans_num[ans[3]] += 1;
    }
  }
  cout << "AC x " << ans_num[ans[0]] << endl;
  cout << "WA x " << ans_num[ans[1]] << endl;
  cout << "TLE x " << ans_num[ans[2]] << endl;
  cout << "RE x " << ans_num[ans[3]] << endl;
  return 0;
}
